8bit shift register 74HC595 - Power up 16 leds !

Hello i bought this chip https://www.sparkfun.com/products/733 and i found tutorials to make it work with 8 leds and i was wandering if i can make it work with 16 leds ! im using basic blue leds (20mA each)

tutorial with 8 leds http://bildr.org/2011/02/74hc595/

i want to make something like this with 16 leds :



2 first leds ligth together , off , 2 second leds ligth together , off , 2 third.....

Find out all about that at the following link http://www.arduino.cc/en/Tutorial/ShiftOut

N.B. They show a capacitor in the circuit/pictures -- DO NOT use it, omit it! .

thanks for answering , i dont want to power them up one after other, i want to power up the 1 red an green at the same time , you game me an idea to use 2 chips in order to do this , but my thought was to make it with one chip , do you know if i can do this ? thank you so much !

I think that you could, maybe, because the outputs can source and sink, have one LED+resistor pulled up and another LED+resistor pulled down, but when one is on the other will be off, and vice versa - but not both or neither. Is that what you mean?

+5-----330?---A_K----|----A_K---330?---Gnd
                     |
                     |
                595 outpin

Or you could have a red and a green LED in series with a resistor (330?). And they would both go on or off together. Is that what you mean?

1 2 3 4 - - - - GREEN - - - - RED

All leds are off , 1 second , GREEN and RED les of column 1 are ON , next second , column 1 is OFF , column 2 is ON , next second , column 3....

did you understand ? i think its the last sentence of your post ! :)

i dont want to power them up one after other, i want to power up the 1 red an green at the same time

Despite the fact that one SR is located after the other using two shift registers has no affect on when the LEDs light or in what order. That's entirely up to your program.

You send 16 bits to the 2 SRs, nothing happens to the LEDs however until you toggle the latch pin. Then they all change at the same time.


Rob

Graynomad:

i dont want to power them up one after other, i want to power up the 1 red an green at the same time

Despite the fact that one SR is located after the other using two shift registers has no affect on when the LEDs light or in what order. That's entirely up to your program.

You send 16 bits to the 2 SRs, nothing happens to the LEDs however until you toggle the latch pin. Then they all change at the same time.


Rob

so you say to make the "3. Add a second set of LEDs." of http://www.arduino.cc/en/Tutorial/ShiftOut and instead of putting leds at one row , put them at two , and ligth shift registers at the same time ?

Yes that's right. How you physically arrange the LEDs is up to you.


Rob

The 75HC595 is not ideal for driving LEDs because it is rated for 70mA total Vcc or ground current. That's just under 9mA per pin if you are using all 8. If you exceed the 70mA rating, it's unlikely to fail immediately, but don't expect it to last very long.

True, there are better options that function the same, for example the TPIC6B595.


Rob

All leds are off , 1 second , GREEN and RED les of column 1 are ON , next second , column 1 is OFF , column 2 is ON , next second , column 3....

This means dc's warning does not really apply, as at any time you run not more than 20mA by your single 75HC595

If you wire them like this:

    |----A_K---A_K----100?---Gnd
    |    red  green
    |   
 595 outpin

your 5V Vcc for your 75HC595 might be at the limit, but you must not remove the resistor completely. (Assuming you don't have 6V as Vcc available anyway )

If you wire them this way

    |----A_K----680?---Gnd
    |    red
    |
    +----A_K----470?---Gnd
    |   green
    |  
 595 outpin

you risk to exceed the total current limit of max 2*10 mA. ( Two 330? resistors might be too small )

So dc is correct somehow: 75HC595 is a logic brick, not a led driver.

My questions are: why do you always light a red and a green led at the same time? There are yellow leds, too. Won't you like to be more flexible ? Control all 16 individually, use parts allowing to light them in parallel? Have a look at 20 leds are enough using no parts but an arduino, resistors and leds ;)

using no parts but an arduino, resistors and leds

Sparkfun do a 4-digit 7-seg display and don't even bother with the resistors. That's 32 LEDs.


Rob

Graynomad:

using no parts but an arduino, resistors and leds

Sparkfun do a 4-digit 7-seg display and don't even bother with the resistors. That's 32 LEDs.

One should apply a knight rider effect there, too. ;)

dc42: The 75HC595 is not ideal for driving LEDs because it is rated for 70mA total Vcc or ground current. That's just under 9mA per pin if you are using all 8. If you exceed the 70mA rating, it's unlikely to fail immediately, but don't expect it to last very long.

so these 2 tutorials are not so accurate ? http://bildr.org/2011/02/74hc595/ , http://www.arduino.cc/en/Tutorial/ShiftOut , do you suggest replacing with something like this ? https://www.sparkfun.com/products/734

Graynomad: True, there are better options that function the same, for example the TPIC6B595.


Rob

its the same wiring as the chip i have now , but it can provide more current to each pin right ?

michael_x: My questions are: why do you always light a red and a green led at the same time? There are yellow leds, too. Won't you like to be more flexible ? Control all 16 individually, use parts allowing to light them in parallel?

I want to simulate water flow , so i want 16 blue leds at two rows light as i said , 2 at a time , not all together. Sorry for messing with colors i didnt know it makes any difference !

"Won't you like to be more flexible ? Control all 16 individually, use parts allowing to light them in parallel?"

How ? i dont mind if lighting them up is programmatically or hardware done. i just want to ligth 2 of 16 leds each second !

How i will know what resistors i will need ? Im using 5V power supply ! , one tutorial uses 180Ω and the other 220Ω

How i will know what resistors i will need ? Im using 5V power supply ! , one tutorial uses 180? and the other 220?

That’s not a really significant difference: 220 is safer, 180 is brighter :wink:

But red led vs. blue led is a big difference ! ( you can’t have 2 blue leds in series at a 5V source , as they need a significantly higher voltage than a red led. )

Edit: and you probably prefer a lower resistor for a blue led than for a red led, if both should get the same current.

its the same wiring as the chip i have now , but it can provide more current to each pin right ?

Yes, same pinout IIRC.


Rob

So i can do 2 things !

Use 2 74HC595 chips to control individually 16 leds and just ligth 2 of them together (programmatically)

or

Use 1 TPIC6B595 chip to control 16 leds , connected at pairs !

Is that correct ?

probably i will need external battery supply for my leds because 5V DC wall supply wont be enough for 2 blue leds ! thanks for mentioning this

invader7:

dc42: The 75HC595 is not ideal for driving LEDs because it is rated for 70mA total Vcc or ground current. That's just under 9mA per pin if you are using all 8. If you exceed the 70mA rating, it's unlikely to fail immediately, but don't expect it to last very long.

...

I want to simulate water flow , so i want 16 blue leds at two rows light as i said , 2 at a time , not all together. Sorry for messing with colors i didnt know it makes any difference !

If you will be lighting up no more than 2 rows at a time and each row takes no more than 35mA @ 5V, then you will remain at or below the per-output-pin limitation (35mA) and the per-device limitation (70mA) of the 74HC595. Just be careful to turn it off smartly if you get the software wrong and end up lighting more than 2 rows.

If you need to use more than 5V (e.g. to run more than one blue LED in series), or more than 35mA per row, using the TPIC6B595 instead.

Like what’s been said the 74hc595 is really not made for leds that will be on all 8 at a time and 16
on one chip not a good Idea.
The TPIC6B595 as pointed out is made to drive leds can use the same code for a 74hc595 but can handle up to 850mA a chip or 120mA a pin not to go over the total 850.

But you could use two driver chips and two more pins on the arduino and 74hc595 and light 16 leds at 20mA safely

invader7: So i can do 2 things !

Use 2 74HC595 chips to control individually 16 leds and just ligth 2 of them together (programmatically)

or

Use 1 TPIC6B595 chip to control 16 leds , connected at pairs !

Is that correct ?

probably i will need external battery supply for my leds because 5V DC wall supply wont be enough for 2 blue leds ! thanks for mentioning this

If you run the LEDs at 17mA or less, you can connect two of them + series resistors to each output of a single 74HC595, without exceeding the 35mA pin rating. And if you are only lighting up one pair at a time, the total current will be below 35mA too, keeping you within the 70mA total current rating.