Go Down

### Topic: I want to blink more LEDs than available pinouts (Read 9445 times)previous topic - next topic

#### louwin

##### Oct 07, 2014, 02:32 pm
Okay, hear me through

I have a Uno and am happy to get a Mega (to get the 54 pins) but I want to run a question past the forum for feasibility.

I want to blink 200 LEDs. Yes, I know there are only 54 pins BUT what I want to do is use 4 banks of 50 LEDs giving 200 LEDs.

So pins 0 to 49 will have 4 LEDs connected to EACH pin(or plug or whatever they are called)

The first LED from each pin will be connected to pin 50. The second LED from each pin will be connected to pin 51. Third to pin 52 and fourth to pin 53.

One of pins 50 to 53 will be switched on at random.  This will activate one bank.  Within that bank I will randomly blink one LED.

So 200 blinking LEDs but will this work?  Pins 0 to 49 will have to be input, right? And pins 50 to 53 output?  If I put the 220 ohm resistor on pins 50 to 53, can I do it all with FOUR resistors.  I will vary the delay (and interval) for each blink but only ONE LED will be firing so current drain is not a consideration

I have been programming computers for more years than I can remember so the logic will be child's play to me.

My question is - Will this concept work?

I suppose I could try 4 banks of 10 on my Uno but I thought I would just ask you bright sparks on the forum before I go and buy a Mega

TIA
Newbie, bought a Uno because I had a \$10 Paypal voucher

I live in Perth, Western Australia.

#1

#### PaulS

#2
##### Oct 07, 2014, 02:36 pm
Quote
I suppose I could try 4 banks of 10 on my Uno

You could have tried one back of 4 in the time it took you to post that missive. Yes, it should work.
The art of getting good answers lies in asking good questions.

#### AWOL

#3
##### Oct 07, 2014, 02:49 pm
I'd go with 15 pins of charlieplexing (210 LEDs worth)- it's a lot of wiring though!

#### syedamerali

#4
##### Oct 07, 2014, 03:03 pm
The economical option is of course using shift registers - but requires a lot of wiring. I was achieving refresh rates of 75 Hz for 20 LED strips each a meter long with 60 LED's on each strip.
The costly way is to daisy chain individually addressable LED strips (NeoPixels?) the down side of this approach is cost and speed.

#### louwin

#5
##### Oct 10, 2014, 01:32 am
Thanks for the replies....  Very helpful

I researched "charlie" and other suggestions but will stick to my "banks" idea.  As I said - retired programmer not electrician

I'm puzzled by my recollection of  "P = IR"  from school days 55 years ago, which suggest to me that the 220 ohms has to carry 4.4 watts?  20MA X 220ohms = 4.4 watts?  I must have it wrong somewhere?

My gut tells me that the power would be negligible?
Newbie, bought a Uno because I had a \$10 Paypal voucher

I live in Perth, Western Australia.

#### PaulS

#6
##### Oct 10, 2014, 06:12 am
Quote
I must have it wrong somewhere?

It's V = IR, not P = IR. The voltage will be 4.4 volts. Power is volts times amps. 20mA * 4.4V is 0.088 watts.
The art of getting good answers lies in asking good questions.

#### MKII1200

#7
##### Oct 10, 2014, 06:24 am
You can handle all those leds with a a few 595 chips, they will use just 3 arduino pins

#### louwin

#8
##### Oct 10, 2014, 08:20 am
Thanks PaulS.

I'm sorry MKII1200, I don't expect you do do it for me but I need more than "You can handle all those LEDs with a few 595 chips".

Also my whole source of hardware is eBay so if it isn't available there I can't get it.

Thanks for all your replies....
Newbie, bought a Uno because I had a \$10 Paypal voucher

I live in Perth, Western Australia.

#### AWOL

#9
##### Oct 10, 2014, 08:42 am
http://www.ebay.co.uk/itm/2-PCS-74HC595-CMOS-IC-Bargain-Pack-74595-74LS595-CERAMIC-DIP-DIL-/320924233205?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item4ab8932df5

I'm sure there are other, maybe better, deals.

#### nickgammon

#10
##### Oct 10, 2014, 09:04 am
With a fairly simple setup I am blinking 32 LEDs:

Or you can use a MAX7219 to handle 64 LEDs if you wire them in a matrix:

http://www.gammon.com.au/forum/?id=11516

Personally I would look at a few 74HC595 chips. After all, you are going to have to run wires one way or the other to 200 LEDs. May as well delegate the job. In any case trying to run them all from the main processor, you are likely to hit output pin limits. In other words, it probably won't be able to provide enough current to light 200 LEDs without transistors.

You can get LED strips fairly cheaply, and they run hundreds of LEDs from only 4 wires (power, ground, data, clock).

\$17 per metre of LEDs (30 LEDs per metre).

From eBay?

http://www.ebay.com/itm/10M-3528-SMD-600LEDS-RGB-2X-5M-led-light-strip-44-Key-IR-Remote-Controller-/141282109267?pt=US_String_Lights_Fairy_Lights&hash=item20e511e753

Judging by the photo it uses the same concept (4 wires). You may have to play a bit to work out the connections but it shouldn't be that hard.
Please post technical questions on the forum, not by personal message. Thanks!

#### rlogiacco

#11
##### Oct 10, 2014, 09:28 am
I believe the guy might need some hints on what is a 595.

They are serial to parallel converters: you send in an information 8 bits long using three wires (plus power lines) and they convert those 8 bits in 8 output lines.

So, without even trying to describe how you send those 8 bits to the 595 chip, if you send the binary sequence 01001000 it will turn on pins 3 and 6 and it will turn off all the remaining pins (out of a 0 to 7 numbering).

That means you have already added 5 pins to your pinout: using 3 pins you are able to drive 8. Those chips can be also daisy chained, meaning they provide an additional output pin which can be connected to the input pin of another one so that any data "overflowing" the chip is going to be "pushed" in the subsequent.

In other words, if you have two 595s daisy chained you can send them 16bits rather than 8: the first 8 bits will end up in the second chip (the one at the end of the chain) and the second 8 bits into the first one (that's why we call it overflowing).

With two daisy chained 595s you can drive 16 pins by using 3 pins on your arduino (not counting the Vcc and GND power lines).

There's a limit on how many 595s can be effectively daisy chained, but you can ramp this up a quite a lot before hitting those limits: I know guys driving 10 of those chips from an arduino with no troubles at all.

Now go read the 595 datasheet and get a better understanding if you think this might solve your problem, but do not forget 595s are not meant to provide a lot of current: the normal DIP package has a quite low limit on the amount of current you can provide from a chip, which is LOWER than the amount of current it can provide from each single pin if all the pins are turned on...
Please, do not send me personal messages containing forum related questions: I will not answer.

I share my discoveries and thoughts at http://rlogiacco.wordpress.com

#### MKII1200

#12
##### Oct 10, 2014, 09:44 am
I wish someone had given me an explanation as the above one when I was trying to understand how these chips work.
It would have saved me a lot of time and troubles.

#### rlogiacco

#13
##### Oct 10, 2014, 09:52 am

I wish someone had given me an explanation as the above one when I was trying to understand how these chips work.
It would have saved me a lot of time and troubles.

Me too!

That's why I tried to put it the simple way, even if I know it does contain some imprecision, but at least he should now have an understanding what we are pointing him at.
Please, do not send me personal messages containing forum related questions: I will not answer.

I share my discoveries and thoughts at http://rlogiacco.wordpress.com

#### nickgammon

#14
##### Oct 10, 2014, 12:30 pm
You might find this interesting:

http://www.gammon.com.au/forum/?id=12298

I took a scrolling LED sign, worked out how it was wired up, and drove it from an Arduino.

It had 10 x 595 chips, plus 7 transistors. Between them they drive 504 LEDs. There is some multiplexing involved as clearly 10 x 595 chips can't directly drive 504 LEDs.

So, 9 of them drive the columns (9 x 8 = 72) multiplexed with 7 rows (7 * 72 = 504) giving 504 LEDs for a cost of only 10 chips.

You can buy 10 x 595 chips on eBay for around \$1.50 so you can see the cost is not that high.
Please post technical questions on the forum, not by personal message. Thanks!