Troubleshooting faint output from IR LED's

This is my first time ever hooking up anything more than a simple 12v circuit. I have done some homework, but am still falling short. I figured I'd chance the verbal beating and ask the question that so many other folks who are new to this stuff ask, "What the heck am I missing with my circuit?". I'll also hope I can properly explain what I've done - because again, I'm new to all of this. :smiley:

Project Objective:

  • Initial/Current - to turn on a single TV with a single IR emitter (that's where I am now)
  • Final/End-Goal - send signals to several different IR emitters to activate five same-brand/model TV's simotaneously

Issue/Problem:

Circuit will light a LED without issue. Using a phone camera to test IR and can see VERY slight illumination of IR LED, but it's very dim and will not trigger TV power.

Parts:

  • IR LED - GIKFUN (This is the link / Size: 5mm / Forward Voltage: 1.2-1.4V. / Forward Current (mA): 100mA/ Wavelength (nm): 940nm.)
  • Transistor - NPN 2N3904
  • Resistor - 100 Ohm
  • Arduino - UNO and NANO (have tried both - currently working with UNO)

My code is nothing more than a modified version of the example that came with the IR library:

#include <Arduino.h>
#include "PinDefinitionsAndMore.h"
#include <IRremote.h>

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(9600);
  Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
  IrSender.begin(IR_SEND_PIN, ENABLE_LED_FEEDBACK); // Specify send pin and enable feedback LED at default feedback LED pin
  Serial.print(F("Ready to send IR signals at pin "));
  Serial.println(IR_SEND_PIN);
}
// When I ran the simplereceiver code, it gave me back this:
// Protocol=NEC Address=0xAA Command=0x1C Raw-Data=0xE31C55AA 32 bits LSB first
// and I decided it fit into the variables like this:
uint16_t sAddress = 0xAA;
uint8_t sCommand = 0x1C;
uint8_t sRepeats = 3;

void loop() {
  Serial.println();
  Serial.print(F("Send now: address=0x"));
  Serial.print(sAddress, HEX);
  Serial.print(F(" command=0x"));
  Serial.print(sCommand, HEX);
  Serial.print(F(" repeats="));
  Serial.print(sRepeats);
  Serial.println();

  Serial.println(F("Send NEC with 16 bit address"));
  Serial.flush();

  IrSender.sendNEC(sAddress, sCommand, sRepeats);
  delay(400);
  Serial.print("Sending RAW ");
  Serial.print("0xE31C55AA");
  IrSender.sendNECRaw(0xE31C55AA, sRepeats);
  delay(5000);
}

I got the RECEIVE IR demo to work and was able to obtain the following output from same:

Protocol=NEC Address=0xAA Command=0x1C Raw-Data=0xE31C55AA 32 bits LSB first

I tried to make a drawing of the circuit. Don't know a lot other than what I have read about doing this kind of diagram, but here's what I came up with:
circuit-2
Please forgive me if I got something backwards. Emitter, collector, anode, cathode, photos of Elvis, etc.. I'm still learning... and yes, I have more reading to do tonight!

Anyway, any help anyone can give me with getting the IR LED to blink brighter and actually turn on the TV is appreciated. Also, if anyone has any suggestions on how to take this to the next-level and stack more LED's in the mix, those are appreciated too! :slight_smile: Thanks to all!

First I must say your first attempt at seeking help is very good, you have tried to add all the detail and outlined the problem.

Now for the roasting :grinning:
You really need a resistor in series with the IR emitter to limit the current else you may damage your LED and Arduino. The IR LED you linked to does not show the part number for the IR emitter so I assume the values (forward current/voltage) are correct for the ones your using.
Using this calculator with the values 5V/1.4V/50mA you need a 72ohm resistor.
A 100 ohm resistor (if you don't have a 72 ohm) will still give you about 35mA current that should be fine.

The schematic does not show the transistor mounted correctly. This could be just the drawing or you may have wired the thing the wrong way round. Pin 1 should connect to ground, pin 2 connected to Arduino pin (via resistor) and pin 3 connected to LED.

Your sketch looks okay.
Put the resistor in series with the LED, use a new LED just in case the old one is damaged, check your transistor is connected correctly and maybe try a new one just in case.

If it is correct then the reversed transistor has saved the life of the IR diode by an inferior current amplification.

Rating the output of the IR diode by a phone is questionable due to IR filters with the camera. How does it compare to the output of an original remote control?

Phone cameras generally have IR filters in them, so I am surprised you can see anything at all to be honest.

You can see the IR from a normal TV remote control?

Filter does not mean full suppression.

Try it and get back to me. :slight_smile:

I just saw your post before mine, seems we are arguing the same point, testing IR output with a phone camera isn’t ideal.

It would be nice if there was some way to confirm that the code is right. Even if it's dim, it should work if you get the IR LED right up next to the TV IR receiver. I mean like half an inch away.

What model TV and remote do you have? It may be possible to confirm the code from online sources.

The key to the phone detector is whether a normal remote control is much brighter on your phone than your circuit is. If they are the same, then the code may be wrong.

I think most TV remotes power their IR LEDs at considerably more than 100mA. The other issue is how you are powering the LED, or more specifically how you are powering the Arduino. Are you powering it at Vin? With what?

I would be suspicious of the 1.4 Vf number. I think IR LEDs are usually higher than that. But with 5V power, you could probably use two in series with the same current. It's the only free lunch in electronics.

The LED in the remote control shows up on the camera very brightly. These don’t. There’s a very faint Flash at the base of the lamp. I suspect I may have damaged the LED (as others have suggested). Probably going to pull a new one out of the box and see what I get

Please do not delete your posts. :roll_eyes:

There is an edit icon - the pencil - below your post that you can use if you need to add information to a post.

1 Like

Please do not delete your posts. :roll_eyes:

There is an edit icon - the pencil - below your post that you can use if you need to add information to a post.

Understand. Thanks for the guidance.

A few reasons the IR LED would look dim (it probably isn't) or why the receiver might not respond properly...

  1. The viewing angle is probably quite narrow narrow and not best suited for this application (the image in the link shows a relatively narrow lens. Actual specifications for this would be nice. I suppose if checked on the phone camera if its brightness quickly diminishes as your viewing angle changes, then the IR LED has a narrow focus.
  2. I wonder if the receiver is a good match ... like what its peak sensitivity is at and what the lens specifications are.
  3. Note you phone camera probably has similar response to infrared as the graph below. Looking at the graph, your phone's camera would only show 15% of your 940nm IR LED's output power, but if you look at a visible red LED at 640nm, it will show 85% of its light.

image

@ShermanP

What model TV and remote do you have? It may be possible to confirm the code from online sources.

It's a Pioneer PDP-6020FD. The IR remote for the TV does show brightly in my camera. Not so much with the IR LED. Again, I got the codes I am using from the IR receiver project... I'd think they'd be right - but heck, I'm totally lost and trying to figure it all out. I know Remote Central has a Pioneer PDP model or two listed, but I'm not sure what to do with those big long strings of commands. More reading for tonight!

@j64c - Not sure if you saw my other response, but the TV's remote IR LED does show in my camera very brightly. My project's LED, well, not so much. It's a faint purple flash.

TV Remote:

My Project:

I'm wondering if maybe this is what I should expect for brightness and I may need to tinker with the code some more?

@DrDiettrich - Sorry about that. I think I just drew it wrong. I'm pretty sure I have the legs correctly positioned, as I can get the same circuit to light a red or blue LED with the long/short leg in the same places. The IR LED is where the issue comes in, and it glows faintly...

@Riva,

You really need a resistor in series with the IR emitter to limit the current else you may damage your LED and Arduino. The IR LED you linked to does not show the part number for the IR emitter so I assume the values (forward current/voltage) are correct for the ones your using... A 100 ohm resistor (if you don't have a 72 ohm) will still give you about 35mA current that should be fine.

I looked at the GIKFUN webpage and looked through all the IR Emitters they sell. I'm making the assumption that these are the same ones they sell as singles, only in a ten pack. I tried to add a 75 Ohm resistor between the positive rail and the anode. From there, we're on the shorter cathode leg going to the transistor's emitter and the collector to ground. I added a 220 OHM resistor between pin 3 and the base. Zero luck turning off the TV. The constant running of MASH is getting old. :smiley:

Final note - I had some trepidation about requesting help. Have seen several posts where folks aren't so friendly to people who are asking their first (stupid) questions. Am glad I made the post. Everyone here has been VERY friendly and I really appreciate all of the help! Thanks to all who responded! :slight_smile:

Hey @dlloyd,

Your post went in as I was working through thoughts in another post. I'm starting to think the LED is doing what it's supposed to do and perhaps I have something else going on. GIKFUN doesn't show a spec sheet for this specific IR LED pack. They do have these numbers:

Size: 5mm / Forward Voltage: 1.2-1.4V. / Forward Current (mA): 100mA/ Wavelength (nm): 940nm.)

... on a single and other packs they sell. I'm thinking they're likely the same thing, just packaged differently and working based on that assumption.

Also, the graph does make an interesting point - the remote itself must have quite a burst going on to show up on the camera as it does. I'm guessing this emitter must not pack the same punch as the one in the remote.

The point I was trying to make with the graph is the phone's rapidly diminishing ability to see higher infrared wavelengths.

Say for instance the remote's IR LED has identical specifications as the GIKFUN LED, except for the wavelength. If the remote has 780nm LEDs and both types are being driven at 100mA and both types have equal luminous intensity (millicandela), the remote's IR LEDs would look more than 3X brighter (but they really aren't ... the phone's camera just becomes more blinded when looking at the GIKFUN 940nm IR LED).

I have tried the irremote library v3.x on both the UNO and ESP8266 and cannot get it to work.

If I change the irremote library to version 2.8.1 and use the below sketch it works okay on the UNO
The only difference between the sketch I tested and the sketch below is the IR code I sent was 0x5F0800FF that is the power toggle command for my Foxsat box.

#include <IRremote.h> // v2.8.1

IRsend irsend;

void setup()
{
  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(115200);
  // Just to know which program is running on my Arduino
  Serial.println(F("START " __FILE__ " from " __DATE__));
  Serial.print(F("Ready to send IR signals at pin "));
  Serial.println(IR_SEND_PIN);
}

void loop()
{
  Serial.println("Sending 0xE31C55AA"");
  irsend.sendNEC(0xE31C55AAUL, 32);
  delay(5000); //5 second delay between each signal burst
}

@dlloyd - That makes sense to me. If I had a 940nm (which I do in my project) and the remote was 780nm, the remote would logically be brighter. That may be the answer to the difference in the appearance of the IR emitters.

Thank you for that insight! :slight_smile:

The codes for your TV are available directly from Pioneer:

https://www.pioneerelectronics.com/PUSA/Support/Home-Entertainment-Custom-Install/IR+Codes

You'll get a ZIP file for your model which has an MHT file inside. I was able to open that in the Edge browser. It looks like some of the buttons use two hex bytes, while others use four.

I still think if you can see anything at all on your phone, your circuit should work if placed right next to the TV's IR receiver - if the code is right. It looks like AA1C is right for power on/off. I don't know what the raw stuff is all about.

Edit: I would also try it with different numbers of repeats, including none.

Hi,

  1. Thanks for the very detailed information in your post! :+1:

  2. Remove the line IrSender.sendNECRaw(0xE31C55AA, sRepeats); from your code, it is meant only as an alternative for old codes you do not use.

  3. I did all my tests on all platforms the last 3 years with no transistor and only a 270 ohm resistor in series to the IR diode. This may not support very long distances, but it removes a point of failure!

  4. What happens if you try to receive the sender signal with your Other Arduino?

  5. Remove delay(5000); and increase sCommand every loop. Switch on your TV and wait for around 256 seconds. If nothing happens with your TV, then

  • the address is wrong
  • the distance is too big
  • the diode is defect / not suitable
1 Like

I think there were a few issues afoot:

  • First, @dlloyd is absolutely right - this IR emitter doesn't seem to send at a wavelength my camera has the ability to see well. I found I also had to move this particular emitter very close to the sensor to make it work. No big deal, as I intend to put the sensors close anyway.
  • @Riva - I downgraded the libraries and afterwards upgraded them back. Seemed to work for me either way - but that doesn't mean "jiggling the dial" by downgrading and upgrading didn't do something.
  • @ShermanP - Didn't quite make it here yet - but I will take a look at the resource you provided. It may be helpful with a future project. :slight_smile:
  • @ArminJo - You threw me a suggestion that also proved very helpful, as I grabbed my Nano off of the shelf and built an IR reader as a test device.

... so, I think I'm all good now and can move forward with my project... maybe! :smiley: Will see as I progress. Thanks again to everyone!