I am using the IRremote library to clone the signals from an Air Shark remote controlled helium airship toy. Very much like this tutorial (which I have updated for the latest IRremote library API):
Sniffing the codes is working (even though they have quite a bit of noise - I use multiple for each command), but it only really works well when the the transmitter and reciever are almost inline. The official remote control works a lot better from a lot more angles. It also seems to bounce off walls better.
Currently I am using 2 IR LEDs, driven by a bc550c transistor on the 5V pin of an Arduino. This is the schematic:
Is there any way I could get a better signal? It seems like the LEDs can run at 50mA - would that be worth trying? Could I push it higher? As I am using a 38kHz signal and it is usually off.
Or are there any LEDs with a wider beam? Would scuffing the surface help by diffusing it more? Or some way of bouncing the IR light?
Replacing the transistor with a MOSFET will help.
LEDs can be red, orange, yellow, green, blue, white, or violet and that color is determined by the semiconductor materials used in it. If you have an RGB LED, which has a red, green, and blue LED very close together, you can even make practically every color on the spectrum.
Many of our projects have LEDs in them and it’s important to know the voltage and current required to properly drive them when they are being jused. Check out the VF needs in the datasheet for your particular LEDs while you’re planning how to power them. This link will help:
Where does the 5V supply come from? Is the UNO plugged into USB?
Anyway, I would suggest you put the two IR LEDS in series, with one limiting resistor of about 47 ohms, or maybe even 22 ohms. And if you have a 220ufd or 470ufd electrolytic capacitor you can put across the 5V supply, that would help.
Edit: So the Vf of an IR LED under load is about 1.5V, and two in series would be 3V. Then the 5V supply less the 3V leaves 2V across the resistor. A 47R resistor would then pass about 42mA, and a 22R resistor would pass about 90mA. A normal TV remote would draw several hundred mA at least, but here we have to deal with the limitations of the Uno's 5V supply. But putting the LEDs in series gives you twice the IR power at the same current. Free lunch.
That is correct but from what the OP has given he is not driving the LEDs hard enough. Switching from the Transistor to the MOSFET will give him more current as the CE voltage drop will be eliminated. The schematic shows Blue LEDs his statement states IR LEDs.
According to the datasheet of your LED, the viewing angle (30deg) is not particularly narrow, I expect that you just need more power.
The Vf is about 1.3V at 50mA
So you could put 3 of them all in series with 22ohm resistor for most efficient circuit.
Your transistor is not completely saturated with 4k7 base resistor, and so limiting the current flow little bit as well. Use 470R or 1K.
While above gives you safe 50mA approach, IR-LEDs are commonly driven with much higher currents, which is possible because the signal is so short and duty cycle is low.
That's the low current (20mA) Vf voltage of an IR LED.
That increases to about 1.6volt @ the max continuous current of common 5mm IR LEDs of 100mA. These LEDs can be driven safely with 180mA@50%pulse train 38KHz.
@OP, put the two LEDs in series (more efficient), lower the 4k7 base resistor to ~330 Ohm and the 180 Ohm LED resistor to 10 Ohm. Add a 470uFcap on the 5volt rail too, to smooth the peak currents. The transistor should be a 2N2222 or BC337 (a BC550 is only 100mA).
Leo..
Thanks for all the replies! Sorry for not replying earlier, but I was purchasing a multimeter to be able to measure things better. I have measured the LEDs as having a forward voltage of 1.084V each - this was using the multimeter diode test, so I am not sure what current that was using.
Using a 47 ohm resistor and a 4.7K resistor on the transistor base I am getting a measured current of 39mA. This is with setting the Arduino pin to a continuous 5V.
I did try changing to a 22 ohm and a 10 ohm resistor and got similar results. Reducing the base resistor appeared to make the current go down.
I think the 30 degree beam angle is correct, but I was hoping to flood the room with IR and get some bouncing off the walls / ceiling.
The fact it is only sending small bursts of signal makes it harder to work out what is going on. THe new multimeter does have a built in osciloscope, but I don't know how to use it properly yet!
Do you think I could get away with not having any resistor inline with the LEDs?
Sorry about the colour confusion, but I used Tinkercad circuits to generate the above schematic and it doesn't have IR as an option! i have started looking at LTSpice and KiCAD, but there is a bit of learning curve.
It seems that your 5V supply for the IRLED has limited current. No matter what you do, it looks like about 40mA is all you can get. Your transistor is kinda puny, but it’s rated at 100mA, which should be ok. Are you powering the Arduino from USB? What is the source of the 5V supply?
When you’ve learned to use the scope, you can put it in Single mode and measure the voltage drop across the current-limiting resistor. Then you use Ohm’s law to figure the current. Assuming your scope/meter is battery powered, you can connect the probe to one side of the resistor, and the ground lead to the other side. (You wouldn’t do that with a regular earth-referenced scope.)
It’s better to measure current that way as opposed to driving the LED with constant current. These LEDs can handle a lot of current at a 30% duty cycle, and for milliseconds, but continuous current will make them overheat pretty quickly, losing all their magic smoke.
Yes I am powering the Arduino from USB and I am powering the LEDs from the Arduino 5V pin. So yes I am a little current limited, but I figure it should be plenty for a couple of LEDs!
Not all LEDs can stand over current for a short time. You need to lookout the data sheet to see if they can take a peak current of what you are trying to give them.
Ignoring the data sheet and assuming they can be will only lead to failure. Maybe not immediately, but they will have a much shorter life before they fail completely.
Post#23 here shows a good IR LED drive circuit.
Peak currents with a 3.3Ohm sense resistor are about 200mA.
That 100mA average current @ 38KHz shouldn't be a problem for 5mm IR LEDs.
Nor shouldn't it be a broblem for the 5volt rail of an Uno.
Leo..
In that situation, you are powering the LED directly from the USB through a mosfet, and the Arduino's 5V regulator is not involved. So there should be plenty of current available. It may be helpful to measure the voltage across each item in the current path, beginning with the 5V line itself to make sure it's not drooping. Then find the voltage drop across the resistor, the LED and the transistor.
I think I have found where the problem is coming from, but I am really not sure why.
The signal generated by the IRremote library only has a vpp of 1.5V (it is the expected 5V if I just set it to HIGH). I have tried this on 2 seperate boards and got the same result (both Arduino UNO R3's - the orginal ATmega328 version). I even get this with no circuit connected - just measuring the pins connected directly to the oscilloscope. Any idea why this would be happening??
Not sure if the IR remote code sets your output pin to OUTPUT mode or if you have to do that yourself with pinMode (IRpin, OUTPUT);
If the pin is still an INPUT, then driving it HIGH/LOW will just enable/disable pull up, resulting in a weak HIGH.
Leo..