Pages: [1]   Go Down
Author Topic: Power supply for LEDs  (Read 760 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 1
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 505
Posts: 31332
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 435
Posts: 23598
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

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.

Westbrook, CT
Offline Offline
Full Member
***
Karma: 2
Posts: 139
"Why should I bother with made-up games when there are so many real ones going on." (c) Kurt Vonnegut
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.. smiley
Logged

Arduino Uno R3
Mac OSX Lion


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 435
Posts: 23598
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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....
« Last Edit: November 09, 2012, 03:12:02 pm by Boffin1 » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 435
Posts: 23598
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"put a 24 pin socket"
well, maybe a 28 pin socket if you want to capture all of the leads smiley-wink
Logged

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.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 435
Posts: 23598
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1A would seem to be plenty for 21 LEDs.
Logged

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.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1183
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"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:-)
« Last Edit: November 09, 2012, 04:27:46 pm by Boffin1 » Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Logged

Pages: [1]   Go Up
Jump to: