Drive 10 LED´s with Arduino Nano and Shift Register

Hello together,

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?

Many people use the TPIC6B595 high power shift register. It is open drain, so you can power the LEDs separately from the Arduino.

Google "arduino TPIC6B595" for examples.

Honestly, for only 10 LEDs you should consider charlieplexing.

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?

Easier to use some form of WS2812 LEDs, AKA "NeoPixels".

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.


The caps are 0.1uF, attach to each chips Vcc pin.

I also made a board with an FTDI module and a 328P chip, basically a Duemilanove, and those 3 shift registers

Could also use a MAX7219, drive up to 64 LEDs.
I made a little board to make it simple for standalone projects

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.

Thank you all!

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?

Thanks all!

The other 8 LED´s will be 5mm constantly on.

Then they do not need to be connected to the Arduino.

jremington:
Then they do not need to be connected to the Arduino.

Okay, but how do I get the power out of the Powerbank, into the LED´s and connect the Arduino to the same circuit?

With wire, just like you would the Arduino. Connect all the grounds together, and don't forget the current limiting resistors on the LEDs!

You will probably want a switch in the battery lead.

circuit.png

circuit.png