IR LED emitter not responding to the commands

Hello everyone! I have recently made project for sending IR signals to the tv, but IR LED is not responding on any command. I checked it on phone camera and IR LED by itself is working.
When i press the button , i see no light emiting from IR LED, but the code works fine. ( It prints message "Sending signal" when i press the button).

This is the code:

#include <IRremote.h>

int button = 12;
char buttonState = LOW;

IRsend irsend;

void setup(){
 Serial.begin(9600);
 pinMode(button, INPUT);

}

void loop(){

buttonState = digitalRead(button);

if(buttonState == HIGH) {
  Serial.println("Sending signal...");

for( int i = 0; i < 3; i++) {

irsend.sendNEC(0xC90 , 32);
delay(40); 
  
}
delay(1000);
  
}

 
}

What could possibly go wrong?

Thank's everyone for help i appreciate every comment.

How do you expect to see the LED being one and off several times over a few milliseconds? You need a better way to determine what is being sent by the IR LED.
Paul

I tried to change to 4000 ms , but it's same. That's the code from youtube video and it's working on that video. I don't know any other way, can you suggest me something?

Typically the output pin of an Arduino cannot supply sufficient current to drive and IR LED so you will want to implement a simple driver circuit using NPN transistor and a 470 ohm resistor is shown here:

Maybe this is the problem?

"Typically the output pin of an Arduino cannot supply sufficient current to drive and IR LED"
That's incorrect.

"What could possible go wrong?"
Is your IRED (IR LED) backward?

Some (many?) cameras these days have IR filters.
You can place a red (or other color) LED for a sanity check.

No, it's not backward.

Yes, i checked IR LED on camera and it's working absolutely fine , but when i connect it to arduino it's not working. It's not emiting anything

On which pin is it supposed to be outputting?

The output pin of IR LED is digital pin 3

Where's that in the sketch?

And i'm working on ardiino UNO not nano.

The "sketch" around here is your 'program'.
Where is there defined anywhere anything about "pin 3".

1 Like

It's supposed that automatic defined pin is pin 3. So there is no need to be defined , i didn't find anywhere on internet defined in program. IRsend function "knows" that's led is connected on pin 3

Did you try using a red LED, for troubleshooting (to see blinking)?

https://forum.arduino.cc/t/arduino-ir-send-no-output-on-ir-pin/309399/10

Yes, red led is working fine. The strangest thing is that i have IR arduino transmitter , and it didn't work either, but the led working light is working absolutely

I don't know but i have a doubt if a arduino uno board is fake or not working correctly , i don't know. I have really tried everything

IR receiver is working perfectly btw

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.