Go Down

Topic: Power 2 IR LEDs Off 1 Arduino Uno Digital Pin  (Read 1 time) previous topic - next topic

davie_gravy

Let me start off my saying I do not know the hardware side of the circuits well enough to build my own safely and I'd rather not brick anything if I didn't have to learn the hard lesson.

I have been working on a universal IR remote project for some time now.  It is currently working great with 1 IR LED but I would like to have 2 connected.  The problem is I'm not sure how to design the IR circuit to use 3.3 or the 5v rail instead of the supplied power from the digital pin.

I have found the following diagram from a post where they have designed a circuit for multiple IR LEDs. 

My issue is I'm using D10 as a ground control pin because I must have the IR circuit disabled while the screen is operational (D3 is used by my 2.4" TFT screen and is also the default transmit pin for IRRemote TIMER2 [D9 is also used by the TFT which I could configure for TIMER1 but in the same boat]) and write LOW on D10 when I'm ready to transmit the IR signal.

I would be so grateful if someone could tell me how I could modulate this design or design my own circuit to accomplish having D10 as a ground gate for the enabling/disabling of the IR circuit with 2 IR LEDs connected .

I attached a crude paint drawing of how my IR LED is currently connected in my setup and an image of the circuit diagram I'm trying to model. 

Any help is greatly appreciate. 



PaulRB

#2
Dec 04, 2019, 08:04 pm Last Edit: Dec 04, 2019, 08:18 pm by PaulRB
Your diagram shows no series resistor. This could damage both the Arduino pins and possibly the IR led also. Did you simply forget to draw the series resistor?

IR LEDs have low forward voltages, e.g. around 1.5V. What forward voltage are yours? You may be able to put 2 LEDs in series and use a lower series resistor.

I can't make sense of why you are using D3 for both purposes (and therefore having to use D10 to enable the ir LED). You should post a complete schematic showing all major components, post links to the specs of the components.

davie_gravy

Please excuse my ignorance.  I do not have a series resistor in my circuit.  Is that a standard value per LED?

I'm using this KY-005 for the LED and this wiring diagram and was able to get it working. https://arduinomodules.info/ky-005-infrared-transmitter-sensor-module/

I then am using a 2.4" TFT screen which when in operation utilizes pins D0-D9 according to the documentation.  The IR remote library will only work with the timers which are tied to pins D3 for TIMER2 and D9 for TIMER1.  Both which are occupied by the TFT when operating.   

I have found, through much troubleshooting, that if I tie the ground pin of the IR to D10 (which is not in use by the TFT), then as long as I write that pin HIGH, it disables the IR LED thus freeing up D3 for the TFT which allows it to draw and refresh and then when I need to send an IR signal, I write D10 LOW which connects the circuit and allows me to quickly transmit.  Then i write D10 HIGH again to allow the TFT to continue.

I hope that makes sense.  I'm sorry this is hard to understand.  I do not have a thorough understanding of all this. 

Thank you for your response. 


davie_gravy

Here is a picture of the circuit with the TFT shield detached for detail.

Once again, thank you.

Paul__B

Well, there are a whole lot of problems here!

From your description, you are attaching the IR LED between two port pins.  This immediately tends to limit the current which would be a somewhat good thing given that you have omitted the obligatory current limiting resistor.

 The description of the KY-005 module is somewhat unhelpful as it incorrectly suggests both that the module requires a 5 V connection - which it does not - and that it is acceptable to connect it without the series resistor which it does not include.  It might be expected to connect to a "servo" spill such as on various headers with a 3-wire servo cable which would be practical if the board actually provided for a series resistor.

I do not have a series resistor in my circuit.  Is that a standard value per LED?
No, not really though you might use rule-of-thumb values for each LED colour.  For an IR LED with 1.5 V drop and 25 mA as being a practical current to be supplied by the Arduino, the drop across the resistor would be 5 V minus 1.5 or 3.5 V, and at 25 mA (which is an allowable current for the ATmega chip), a 150 Ohm resistor would suit.

In fact, with an effective 50 Ohm internal resistance of the chip drivers, a 120 Ohm resistor would be quite satisfactory.  (Note that it is acceptable to include the internal resistance in the calculation as long as the resultant current is correct.)

davie_gravy

Thank you for the reply on the correct resistance for the current limiting resistor.  Can you tell me how that circuit would change for 2 IR LEDs connected instead of just the one?  Can I still power it off the D3 pin or would I need to incorporate 3.3 or 5V as the power source?

Would I just use 2 120 ohm resistors in place of R1 and R2 in the diagram (omitting the 3rd LED in the example)?

Thank you very much.
 

PaulRB

#7
Dec 05, 2019, 08:10 am Last Edit: Dec 05, 2019, 02:55 pm by PaulRB
How are you physically connecting the shield and the led at the same time?

You can use Ohm's law to calculate the series resistors for LEDs. To do that you need to know the forward voltage of the led and the current you want to flow. The current, of course, must not exceed the max current the led is specified for, or the max current that can be provided by the driver, in your case the 2 Arduino pins. You don't have to use the highest possible current, you can choose a lower current to dim the led.

Ohm's law says R=V/I where V is the voltage across the series resistor and I is the current flowing through it. The voltage between the two pins is, in theory, 5V. Let's say your led has a forward voltage of 1.5V. So the voltage across the resistor will be 5-1.5=3.5V. If you want 25mA to flow, the resistor should be = (5-1.5)/0.025=140R. You then need to pick the closest standard resistor value that is above that, eg 150R.

If you put 2 LEDs in series (not in parallel as shown in the schematic you posted earlier), their forward voltage add together. Let's say that's 2x1.5=3.0V. So your series resistor can be (5-3.0)/0.025=66R. Nearest standard value is 68R.

Paul__B

How are you physically connecting the shield and the led at the same time?
Take a look at the photo.  :smiley-lol:  This is a variant with a double row of connector holes.

PaulRB

Take a look at the photo:smiley-lol:  This is a variant with a double row of connector holes.
Ooops. So it is. I'll delete that question!

davie_gravy

How are you physically connecting the shield and the led at the same time?

You can use Ohm's law to calculate the series resistors for LEDs. To do that you need to know the forward voltage of the led and the current you want to flow. The current, of course, must not exceed the max current the led is specified for, or the max current that can be provided by the driver, in your case the 2 Arduino pins. You don't have to use the highest possible current, you can choose a lower current to dim the led.

Ohm's law says R=V/I where V is the voltage across the series resistor and I is the current flowing through it. The voltage between the two pins is, in theory, 5V. Let's say your led has a forward voltage of 1.5V. So the voltage across the resistor will be 5-1.5=3.5V. If you want 25mA to flow, the resistor should be = (5-1.5)/0.025=140R. You then need to pick the closest standard resistor value that is above that, eg 150R.

If you put 2 LEDs in series (not in parallel as shown in the schematic you posted earlier), their forward voltage add together. Let's say that's 2x1.5=3.0V. So your series resistor can be (5-3.0)/0.025=66R. Nearest standard value is 68R.
Thank you so much for this.  I was on to this last night some searching around.  I found this site : http://led.linear1.org/led.wiz
My main concern was series vs parallel, but with you reply and this websites recommendation, it seems that though series is the way to go.  Thank you both PaulRB and Paul__B. 

I've always heard the R=V/I formula but I was never really able to apply it practically till now.  I'm now conscious aware of forward voltages and expected current. 

Thank you!

PaulRB

#11
Dec 05, 2019, 08:45 pm Last Edit: Dec 05, 2019, 08:47 pm by PaulRB
Yes, that is a useful an page. For example, my calculation above was incorrect. But the web page gives the correct answer: 82R not 68R.

I have used that web page before. Usually it is excellent. But sometimes it gives answers that are theoretically correct, but for practical situations are not safe. If it suggests any solution where the series resistor is below 50R, you should perhaps not choose that solution. This is because the forward voltage of LEDs is often not exactly as described by the seller or manufacturer. Forward voltage is never exactly the same for any 2 LEDs, even if they were manufactured in the same batch. It also varies with temperature and current. With a very low series resistor, there is a danger that a small error in the led forward voltage can result in a large error in the current, causing a chip or led to fail after a time. So if the web page suggests two or more solutions and one suggests series resistors below 50R, choose one of the other solutions.

Go Up