HELP: using IR LED in breadboard

Hello,
I am new to Arduino and I am facing a problem in connecting tools to breadboard.

I am trying to send IR signal using NodeMCU ESP8266 and by following these steps (HERE)

and this code:

/* IR_Remote.ino per http://community.blynk.cc/t/disconnetted-nodemcu/11599 */
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
// IR remote
#include <IRremoteESP8266.h>

char auth[]   = "xxxx";
char ssid[]   = "xxxxx";
char pass[]   = "xxxxxx";
char server[] = "blynk-cloud.com";

SimpleTimer testingTimer;

IRsend irsend(0); ///an IR led is connected to GPIO 0 --> D4

// ======= SKETCH IR

int pinValueV1;
int pinValueV4;
int pinValueV5;
unsigned int ScreenUp[63] = {1400, 400, 1400, 400, 1400, 400, 1400, 400, 500, 1200, 500, 1200, 500, 1200, 500, 1200, 500, 1200, 500, 1200, 500, 1200, 1350, 400, 500, 1200, 500, 1200, 500, 1200, 1400, 400, 1400, 400, 1400, 400, 500, 1200, 1350, 400, 1350, 400, 1350, 400, 500, 1200, 1400, 400, 1400, 400, 1400, 400, 500, 1200, 1400, 400, 1400, 400, 1350, 400, 1350, 400, 500};
unsigned int ScreenDown[63] = {1400, 400, 1350, 400, 1400, 400, 1400, 400, 500, 1200, 500, 1200, 500, 1200, 500, 1200, 500, 1200, 1350, 400, 500, 1200, 500, 1200, 500, 1200, 500, 1200, 500, 1200, 1400, 400, 1400, 400, 1400, 400, 1400, 400, 550, 1200, 1350, 400, 1350, 400, 1400, 400, 550, 1200, 500, 1200, 500, 1200, 500, 1200, 1400, 400, 1400, 400, 1400, 400, 1400, 400, 1400};


BLYNK_WRITE(V2) // ON/OFF
{
  int pinValue = param.asInt();
  if (pinValue==1)
  if ( param.asInt() && pinValueV1 == 1 )  // ON/OFF TV
  irsend.sendNEC(0xE0E040BF, 32);

}


// ========LOOP
void setup()
{
  Serial.begin(115200);
  Serial.println();
  Serial.println(F("Started"));
  irsend.begin();
   Blynk.begin(auth, ssid, pass, server); 
  Blynk.syncAll();
  
}

void loop()
{
  Blynk.run();
  testingTimer.run();
}

I believe the code is OKAY. But the problem is I don't know how to connect the tools together thought breadboard.

I have:

  • IR LED
  • Transistor 2n2222
  • Resistor 220 OHM
  • Resistor 1KB OHM
  • and as I said ESP8266 and breadboard

I tried to connect it like this pic, but it didn't work with me (USING D4 AS THE CODE IS WRITTEN).

Can you plz help me.

The resistors are essential to prevent damage, I don't see them in the circuit.

IR LED's have extremely low forward voltage. Usually near 1.5v and forward current about 100 mA. Putting straight 3.3v through it you have most likely burnt it out. You need a series dropping resistor. For your set up I recommend 13 ohms or bigger.

MarkT:
The resistors are essential to prevent damage, I don't see them in the circuit.

I found this pic in the internet
The resistor shown in the pic is [ 220 ohm ] , can you plz tell me where should I put the 1K ohm?

Between the pin and the base of the transistor.

You may also have burned out the transistor, BJTs always need a resistor in series with the base - though in this case the drivers on the ESP8266 may not provide enough current to burn out the BJT....

You need a new IR LED, btw, if that wasn't clear - if you used it the way you had it wired, you've almost certainly trashed it.

either test what you have with MM (diode check) or throw them out and start with new parts and this time use correct resistors on everything.

wolframore:
either test what you have with MM (diode check) or throw them out and start with new parts and this time use correct resistors on everything.

I have extra parts for each.
Before I connect my NodeMCU to the power, is what I am doing here is correct?

Oops the power rail connection doesn’t look right. Check where you’re suppose to connect the positive on your breadboard.

Nayyar:
I found this pic in the internet
The resistor shown in the pic is [ 220 ohm ] , can you plz tell me where should I put the 1K ohm?

The 1k normally goes to the base of the transistor (where the 220Ω resistor is drawn), and the 220Ω goes in series with the LED.

Indeed IR LEDs are often operated at 100 mA or even more, but only for short bursts as with all LEDs they will burn very quickly at that current.

TSAL IR LED's can take MAXIMUM 100mA DC and 200mA bursts.

wvmarle:
The 1k normally goes to the base of the transistor (where the 220Ω resistor is drawn), and the 220Ω goes in series with the LED.

Indeed IR LEDs are often operated at 100 mA or even more, but only for short bursts as with all LEDs they will burn very quickly at that current.

Guys I really really appreciate all your helps.
But I am still confused.

Could someone plz help me to wire the parts in this pic using a photoshop or any other image edit app.
Just help me by drawing some lines so I can understand what to do.
I am really sorry for my many asks.

Like this:
schematic.png

wvmarle:
Like this:
schematic.png

I tried to wire the parts as show in the pic but it didn't work
I also add the IR receiver to the circuit and try again, but it seems like no signal is sending through the IR LED.

Then I removed all the transistor and resistors from the circuit, and I connect only the IR LED and IR receiver.

IR LED
(+) >> OUTPUT (D3)
(-) >> GND

IR Receiver
DAT >> D4
VCC >> 3V3
GND >> GND

then when I click on the button (V2) in blynk, I see that the IR Receiver is blinking which means it is receiving signals form the IR LED. But the TV doesn't seems to receive any signals because it's not taking any actions. I know you guys told me I must use transistor, but I didn't know how to wire it on the circuit.

Most likely the LED is not bright enough for your TV to see properly.

An Arduino pin can delivery no more than 40 mA, so the LED is not going to be particularly bright. The original RC is probably pulsing its LED at much higher current.

wvmarle:
Most likely the LED is not bright enough for your TV to see properly.

An Arduino pin can delivery no more than 40 mA, so the LED is not going to be particularly bright. The original RC is probably pulsing its LED at much higher current.

Could the reason be because I used the LED without the transistor?
Someone told me that if I used the IR LED without the transistor then the LED will work only for a very few cm of distance from the TV, and for that reason transistor is important.

I have tried two different TVs and 3 different TV receiver.