Go Down

Topic: Power supply for LEDs (Read 1 time) previous topic - next topic

marian42

Hi,

I have a modelmaking "village" with some houses. I want to put LEDs in them and light them like this:
- 16 LEDs to be controlled individually (with two 7HC595s) (houses)
- 10 LEDs to be on or off at the same time (maybe with a transistor?) (street lights)

If all LEDs are on, they draw about 26 * 40mA = 1A while the Arduino only provides 400mA.

How can I power the LEDs?

Grumpy_Mike

By using an external power supply to power the LEDs and arduino or by powering the LEDs and shift registers with a seprate supply. Join the grounds but not the plus.

CrossRoads

Here's a wallwart that will work nicely for that.
http://www.dipmicro.com/store/DCA-0520

Most LEDs have a continuous on limit of 20mA, not 40.  Check your spec.
74HC595 also has a limit of 70mA thru the device.
You're better off withTPIC6B595 to sink current from the LEDs.
TPIC6B595N, 82 cents at avnet.com
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

mixania

I DON'T THINK YOU WOULD EVEN REALLY NEED A SHIFT REGISTER IF YOU WANT TO CONTROL ALL THOSE LEDS. The Arduino has more than 20 pins (i think most have a bigger number than that), which are enough for your individually controlled 16 LED's and another pin to control all the street lights at the same time.Which makes it only 17 out of 20 pins used.
Just saying.. :)
Arduino Uno R3
Mac OSX Lion

CrossRoads

Yes, but if using an Arduino you run into the problem of total current draw limit thru the part as well. External  high-current capable shift registers take care of that.  Need something off board for the transistors any, so add 2 more chips and make life easier electrically.
Only Mega's have more than 20 IO.  Way less to add two 82 cent shift registers vs whatever an mega costs.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Boffin1

#5
Nov 09, 2012, 09:07 pm Last Edit: Nov 09, 2012, 09:12 pm by Boffin1 Reason: 1
As Crossroads suggests, if you use 3 TPIC6B595s, not only do you cut down on wiring ( only 3 wires to the Arduino board ) but you could also use 4 wires and dim them with pulse width modulating the blanking pins of the TPICs ( notG pin ).

We don't know the age of your " village" but it would leave spare pins for sequenced traffic lights, shop windows etc ?

And as Grumpy Mike suggests, if you use a seperate power supply, once you have it running you can put a 24 pin socket, a 5 volts regulator, a few caps and a resistor, and you have an embedded micro, to free your Arduino board....
With my mobile phone I can call people and talk to them -  how smart can you get ?

CrossRoads

"put a 24 pin socket"
well, maybe a 28 pin socket if you want to capture all of the leads ;)
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

marian42

I would like to do this using just the parts I already have.

I tested the 7HC595 with 8 LEDs on at a time and it worked.
Since they are very cheap, it wouldnt hurt if one breaks.

So the problem would be the power supply.
I have found these wallwarts:
4,5V 500mA
4,5V 800mA
5V 300mA
5V 1A

I guess the 1A one is the best. This is a USB cellphone charger so it would require me to solder a wire on a usb cable.

CrossRoads

1A would seem to be plenty for 21 LEDs.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Boffin1

#9
Nov 09, 2012, 10:25 pm Last Edit: Nov 09, 2012, 10:27 pm by Boffin1 Reason: 1
"well, maybe a 28 pin socket if you want to capture all of the leads smiley-wink"
I dont use Vref , MOSI, MISO, or SCK

OK lets be honest , this is good wine on the wifes'  birthday:-)
With my mobile phone I can call people and talk to them -  how smart can you get ?

brendanwilding

Personally I would not bother with the shift registers or external power. The cheapest way would be multiplex the LEDs - you just need 12 pins for 36 LEDs. You can switch em fast in arduino as long as arduino doesn't need any other thinking time. This way your using max 6 leds @ 40mA (240mA) at one time so your power will be fine, its just whether or not they will be bright enough for you.



Good luck and let us know how it all works out!

Disclaimer: Clearly I know next to nothing about electronics!


Go Up