Light up 5x 3.4V 20mA LEDs on one pin (A0)

Hi there.
Since the Arduino UNO only provides 5V, how would I go by to make 5, maybe more, 3.4V 20mA LEDs light up at the same time from one pin (A0 in my case)?

For one led, I just connect the anode to the pin, through a 150ohm resistor, and cathode to the gnd. But connecting more than that, even just two, in series will probably overload the chip - i guess...

So how would I go by to make at least 5 of the mentioned LEDs to work with Arduino UNO?

They don't have to shine super bright, so I think approx. 50%-75% would be ok since they're going to be placed inside small boxes with frosted glass in the front. I can also put some aluminium foil in the back for reflection...

How would the schematics look like to make this work?

Thanks in advance..

Hi, use a npn transistor, like bc337. Put a 2K2 resistor between the transistor's base and A0. The emitter connects to 0V and the collector to the led cathodes. Each led should have its own 150R series resistor connecting the anodes to 5V.

Paul

You can't connect the LEDs in series there is not enough voltage. You can connect them in parallel each LED with it's own resistor, but you will have to change the resistor value so that the total current does not exceed 40mA or 30mA to be on the safe side.

The best way is to use a transistor to switch the five LEDs then you can run them at what ever current you want.

Hi. Thanks for your quick reply.
I came across this setup (on google):

I just want to comfirm that this is what you guys meant?

Also, is there a calculator somewhere that can tell me what resistor to use in my setup?

That looks exactly what was described.

In saturation, the transistor will drop about half a volt. If the LEDs (obviously not red ones then) actually drop 3.4V that leaves about 1V for the resistor, so about 50 ohms for 20 mA. 47 ohms is the nearest standard value.

But note you should not be powering the LEDs from the 5V regulator on the Arduino - it will work (5 LEDs at 20 mA, total 100 mA) if powered from USB, but if from another source through the Vin or "barrel jack", then you need a separate regulator.

On the other hand, if for example, you are using a 12V regulated supply, then you could use series pairs of LEDs, total 6.8V plus half in the transistor, about 7.3V, subtract that from 12 (if it is actually 12) is 4.7V suggesting a 220 ohm resistor.

I presume 3.4V indicates white LEDs?

but if from another source through the Vin or "barrel jack", then you need a separate regulator.

I would disagree with that. An extra load of 100mA is well within the scope of the regulator on the arduino.

See :-

http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html

and

http://www.thebox.myzen.co.uk/Tutorial/Power.html

Well, to be honest, I'm not quite sure if the LEDs I'm planning to use is exactly 3.4V, it says "Working voltage: 3.2~3.4V; Current: 20mA" (exLED 5mm LED).

I'm trying to measure them, but haven't got the multimeter to work the way I want it to. The "how to's" does not work for me either...

But it's the green LEDs I'm planning to use in my setup...

How would I go by to measure how much voltage, and current runns through my setup in order to verify I'm within the limits for the pin, or the board?

I'm not quite sure if the LEDs I'm planning to use is exactly 3.4V

The exact voltage is a bit irrelevant providing it is in the right ball park. The current draw is determined mainly by the resistor.
So say it is 3.4V then if you feed it through a resistor with 5V and you want a current draw of say 20mA then:-
(5 - 3.4) / 0.02 = 80 Ohms.

However say you used 80R but the voltage was in fact 3.2V then you would get a current of:-

(5 - 3.2) / 80 = 22.5mA so not much difference from your designed current.

In fact as 20mA is the maximum recommended I would try and design for something like 15mA, you will hardly see the difference.

Mind you DX are some what of a crap supplier and those specifications do not ring true. Each colour will have a difference forward voltage. There is no way you are going to get anything like 3.2V across a red LED.

The best way to test this voltage is to wire one up to 5V with a 100 Ohm resistor and measure the voltage across the LED. Then you can work out the proper resistor for your design.