having just finished my first project, lighting up a model of the USS Voyager with 7 LED´s and an Arduino Uno, I wanted to also build the Enterprise. But this time I want a smarter, more efficient way of doing things. Because of space requirements I plan to use an Arduino Nano. Having already been at the limit with the UNO in therms of current, I read up on possibilities to power and control them seperately.
From what I understood I can use an Arduino and a Shift Register together. The arduino telling the shift register what pins to turn on, while the Shift register is powered by an external power source (something with 5V and around 1A possibly?).
My question now is, how can I power the shift register and the Arduino?
Is there a smarter way of controlling the LED´s? I plan to use around 10 LED´s.
Thanks in advance.
Tim
Additional Info:
-I got the Arduino Nano with the ATMega328P chip
-I have not chosen a shift register to this point (if this is even the right way to do the tast :D)
-I would like to power the whole thing with a powerbank (5V, 5000mAh)
-I am a total beginner, sorry
Power everything from the same 5V, simplest, easiest. You need to choose shift register chips capable of
the current you need - there are various sorts, some with higher drive ability. So what LEDs are you thinking of?
MarkT:
Power everything from the same 5V, simplest, easiest. You need to choose shift register chips capable of
the current you need - there are various sorts, some with higher drive ability. So what LEDs are you thinking of?
Ok, so I use, for example the TPIC6B595. How can I power it with a powerbank and can the arduino be powered by the same powerbank?
Here's an example with 3 shift registers.
Each LED will need it's own current limit resistor.
5V - resistor - LED anode
and
LED cathode to shift register output pin.
LED will turn on when a High bit is shifted in.
Or daisychain* 10 WS2812Bs, can even get them as friendly to use thru hole parts
One of the Sparkfun examples
daisychain: the power & Gnd go to all LEDs in parallel. Data to first LED comes from Arduino to the first chip, chip #1's Data Out goes to Chip #2 Data In, etc. down to all devices.
Then use Adafruit Neopixel library to drive them, or FastLed.h library.
Sending a byte or two to a shift register is easier coding wise. Wirint 10 LEDs in parallel is easier hardware wise. So it's a tradeoff.
MAX7219 requires shift register kind of writes, with my board you then just need 2 thin (30 guage wirewrap) wires out to each LED, no current limit resistors.
You say that you are at the limit of allowable current for direct driving them from the Nano. I find this hard to believe. Did you use current limiting resistors? Most LEDs are so efficient that they can achieve a respectable brightness at 1-2mA. I'm sure you can find 10 outputs on the Nano if you're only blinking LEDs. This is much easier than any NeoPixel or shift register or even LED driver IC.
aarg:
You say that you are at the limit of allowable current for direct driving them from the Nano. I find this hard to believe. Did you use current limiting resistors? Most LEDs are so efficient that they can achieve a respectable brightness at 1-2mA. I'm sure you can find 10 outputs on the Nano if you're only blinking LEDs. This is much easier than any NeoPixel or shift register or even LED driver IC.
Thanks to all for your suggestions. 2 of the 10 LED´s will be 3mm ones blinking. The other 8 LED´s will be 5mm constantly on. But you are right. Maybe I can use the Nano with effiecient LED´s. I got the 5 mm LED´s already here and will test it out if it works.
Is this calculation right?:
The white LED´s in 5mm says they need 20mA and 3.1V
The arduino supplies 5V so if I use a 330Ohm resistor that gives me:
(5V-3.1V) / 330 Ohm = 0.0057 A which is 5.7 mAh for white, green and blue LED´s
(5V-2.1V)/ 330 Ohn = 0.00878 A -> 8.7 mAh for the Red LED´s
Which in total gives me 6White + 3Red + 1*Green = 66mAh in Total
Will the Nano then be able to supply that? Provided the LED´s will be bright enough when I use the mentioned Resistors.
equinox:
Is this calculation right?:
The white LED´s in 5mm says they need 20mA and 3.1V
You're misinterpreting the specification. That is not a minimum current, it is a maximum. So you don't "need" 20mA. You should try out all your LEDs and see what brightness you can get from them. I usually start out with 1k resistors and almost never need one less than that. Usually, it's the other way around - I sell a device with a panel pilot light, the resistor is 10k for 12V. It is very bright.
Some other things - you can dim any LED that is on a PWM capable pin. If you use VIN for power on the Nano, you have to be careful to not exceed the 5V voltage regulator power dissipation limit. The processor itself is limited to 200mA total current for I/O (actually specified at the supply/ground pins).
aarg:
You're misinterpreting the specification. That is not a minimum current, it is a maximum. So you don't "need" 20mA. You should try out all your LEDs and see what brightness you can get from them. I usually start out with 1k resistors and almost never need one less than that. Usually, it's the other way around - I sell a device with a panel pilot light, the resistor is 10k for 12V. It is very bright.
Some other things - you can dim any LED that is on a PWM capable pin. If you use VIN for power on the Nano, you have to be careful to not exceed the 5V voltage regulator power dissipation limit. The processor itself is limited to 200mA total current for I/O (actually specified at the supply/ground pins).
Yeah, I understood that that is a maximum.
But is the calculation correct? Will they draw the calculated power with the resistors I chose? Thanks for the advice, I will test 1kOhm resistors too and see if it works!
The power dissipation is only an issue when I use a supply that delivers something else than the 5V taken by the USB input of the Nano, right?