Go Down

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

nickgammon

I seem to remember that happening to me a while back. I think if you edit the message it is still there, and then you could delete the smiley. Probably too late now, but info for next time.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

larryd

Quote
My iPad has a new smiley menu that the forum obviously can't handle.

Ever since I updated to iOS8.02 things like this haven't been a problem with our iPad. But who knows what's next?
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

louwin

He's gone for his nap so I can re type my question.  :)

I have come to the conclusion that the concept I had when I started this thread won't work? The 4 banks of 50?

I am now tending towards a "matrix" solution. A 14 by 14 matrix = 196 LEDs.  I need to run the concept past the forum?

For example I will use a 4 by 4 matrix....

Can I connect pin 1 to a 220 ohm resistor then the anodes of the first 4 LEDs, pin 2 to a resistor and the next 4, pin 3 next 4 and pin 4 to the last 4 working left to right.  Pin 5 to the cathodes of the top 4 LEDs. Pin 6 to the cathodes of the second horizontal row. Pin 7 to third row and pin 8 to the bottom row cathodes.  Will this work electrically?

Programmingwise pins 1 to 4 OUTPUT and pins 5 to 8 INPUT.  So to blink the top left LED pin 1 and pin 5 HIGH. The bottom right would be pin 4 and pin 8 HIGH?

Or have I got this wrong too.  :(

Or possibly a second LED blink but no common pins???? With copious use of "random". :)

I don't have any cables or else I would try it myself?
Newbie, bought a Uno because I had a $10 Paypal voucher  :)

I live in Perth, Western Australia.

nickgammon

#33
Oct 13, 2014, 08:28 am Last Edit: Oct 13, 2014, 08:42 am by Nick Gammon Reason: 1
As I mentioned in reply #10 you could use a MAX7219 to multiplex 64 LEDs. And of course, more of them to multiplex multiples of 64. How do you think those huge LED signs work? Not by having thousands of wires everywhere.

The MAX7219 provides current-limiting so there are no resistors needed*. I got one from eBay for $8 including shipping as described here:

http://www.gammon.com.au/forum/?id=11516&reply=2#reply2

That includes a 64-LED display and the circuit board. You can throw the LED in the bin if you want to use some other configuration.

Lol, those kits are down to $1.81, they must be buying in bulk. Search eBay for MAX7219. Chicken-feed.

Oh, wait. Someone else has them for $0.99** if you don't mind soldering SMD devices. That's funny.

* Apart from a single one as the "current set" resistor for the MAX7219.

** Opening bid, sorry. I thought that was too good to be true.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

louwin

I'm sorry Nick....   I want to simulate a starfield on my ceiling so, pardon me if I look sillier than I am,  how are 8 by 8 led modules going to help me achieve that?

Maybe I should have mentioned the starfield sooner?  :)

My search on eBay revealed all manner of beast under the guise of MAX7219!
Newbie, bought a Uno because I had a $10 Paypal voucher  :)

I live in Perth, Western Australia.

rlogiacco


I'm sorry Nick....   I want to simulate a starfield on my ceiling so, pardon me if I look sillier than I am,  how are 8 by 8 led modules going to help me achieve that?

Maybe I should have mentioned the starfield sooner?  :)

My search on eBay revealed all manner of beast under the guise of MAX7219!


Then you do not need the LED square matrix, but you need some LEDs and you need to wire them 'as a matrix' but not in a square shape.
Then you can drive 64 of them with one IC.

How many stars do you want to put in your starfield? Would be an assumption of 256 (or a little less than that) be a decent value?
If it is than all you need is:
- 4 MAX7219
- 4 resistors (value to be determined)
- 4 electrolytic capacitors (1uF or slightly more)
- 256 LEDs (ramp that up to 300 to be able to work around LEDs you are going to burn out by mistake)
- some 26 and 20 AWG stranded wire
- an Arduino board
- an AC-DC 5V transformer rated for 2A or more
- solder, soldering iron and a lot of patience

You wire the LEDs in 4 matrixes of 64 connected to the 16 pins of a MAX 7219. The ICs get connected daisy chained each other from the Arduino and they get powered from the power line (do not use the Arduino 5V pin to power all those LEDs or you'll burn it out) which share the ground line.

You can thus drive 256 LEDs using 5 pins on your Arduino: GND, V5, 3 digital pins of your choice, let's assume 3,4 and 5.

If you need schematics or more info on what I mean by "wiring LEDs in a matrix not square shaped" I suggest you the following link: http://www.jameco.com/jameco/workshop/diy/ledmatrixbuild-fig2.jpg
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


I'm sorry Nick....   I want to simulate a starfield on my ceiling so, pardon me if I look sillier than I am,  how are 8 by 8 led modules going to help me achieve that?

Maybe I should have mentioned the starfield sooner?  :)


Ah yes, page 3 of the thread and you mention what you are trying to do?

http://xyproblem.info/

Quote
how are 8 by 8 led modules going to help me achieve that?


Well they don't have to be arranged in a square do they? The concept is the same. Put the 64-LED module in the bin. But the concept of lighting up 64 LEDs doesn't change (as rlogiacco said).

Honestly, it is good to state your intentions. Your original posts hinted that you wanted to light up a lot of LEDs simultaneously, and then we wandered off into how to drive outputs from the 3.3V pin.

You could probably visualize your ceiling as an "exploded" 64-LED module. So if you run some wires east-west and some north-south, the idea of multiplexing is not at all silly.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

louwin

#37
Oct 13, 2014, 02:20 pm Last Edit: Oct 13, 2014, 02:34 pm by louwin Reason: 1
Okay, ordered 200 LEDs (already have 100) and in process of ordering 4 X MAX7219's. Also have about 200 jumpers (assorted) coming in 3 different orders. One, currently overdue, and 2 more from 3 different sellers.  ALL coming from Hong Kong and/or China so could be a month getting here (Perth, Western Australia).   :(  Already have the Uno and an 830 tie points MB-102 breadboard and one more coming  :).

If I'm ONLY going to have a MAX of 2 LEDs light at ANY time do I still need a separate power supply?

Meanwhile can I play with the 4 by 4 matrix I described before or isn't that viable?  I was a programmer for 40 years and the bug has bitten me recently   :)

Used to program in Assembler (long time ago) and BASIC (on a mainframe) and dabbled (wrote a Sudoku game for a PDA) in C# (Windows based).  Haven't programmed in about 10 years  :(  (Grandkids)  :)
Newbie, bought a Uno because I had a $10 Paypal voucher  :)

I live in Perth, Western Australia.

PaulS

Quote
I was a programmer for 40 years and the bug has bitten me recently

You can kiss all your spare time goodbye.  8)
The art of getting good answers lies in asking good questions.

louwin

Spare time?  What spare time? I babysit most of the day Monday to Friday   :D

Long term project, hence I need something to be going on with (4 by 4 matrix?) waiting for China eBay delivery  :D
Newbie, bought a Uno because I had a $10 Paypal voucher  :)

I live in Perth, Western Australia.

CrossRoads

Sounds like you're coming around to the solution I posted in #15 - four MAX7219s and a breakout board.
http://www.crossroadsfencing.com/BobuinoRev17/
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

louwin

Don't know if this thread is still alive or if anyone is still interested but here goes, an update.

I have received a couple of things from eBay (not all, just a couple)....  2 830 point breadboards, 10 220 ohm resistors, 300 LEDs and a couple of bunches of jump cables.

Also viewed a few YouTubes that put me on the right track.

I have designed, built and programmed a sketch that blinks ONE LED randomly in a 8 X 9 matrix (the most I could fit on the 2 joined breadboards).

I have decided on a 20 by 30 LED starfield, so 600 LEDs (waiting for 400 more and a Mega 2560 from eBay). I have ordered a few MAX7219s but will probably only play with them and will not use them as I have decided on simple column & row addressing in a common cathode setup.

I will extend the sketch to blink up to 4 (random (1 to 4)) LEDs at any one time.  The extension will check that neither the column nor the row is duplicated so not to draw too much current from ONE pin.  The sketch will use 50 pins so the Mega will have it well covered.  All the connections will be made to a "shield" so the Mega is removable for reprogramming should any new ideas arise.  :D

I am looking at an IR remote to turn it all off during the day (using "sleep" mode?).  Also considering "sleeps" instead of "delays".  I have worked out that even a one millisecond blink is a bit much but acceptable.

The sketch is extremely simple and way less than 2000 bytes on the Uno. My tests have proved that "random" can repeat the same number as often as 3 times.  :(

Just posting this update in case ANYONE else is silly enough to want to repeat the exercise. It can be done WITHOUT the use of any chips (no 595's, MAX7219s, shift registers nor transistors).

Thanks again to everyone who has helped me get here   :D
Newbie, bought a Uno because I had a $10 Paypal voucher  :)

I live in Perth, Western Australia.

KenF

Don't know if this thread is still alive or if anyone is still interested but here goes, an update.
I'm still reading and Yes it's still alive :)

I haven't had anything to add 'til now.  But I take it you realise, you can't drive that many LEDS JUST from the pins of your arduino?  With or without resistors.

You can CONTROL them but the current requirements would overwhelm the output pins of the mcu. 

louwin

#43
Nov 01, 2014, 06:57 am Last Edit: Nov 01, 2014, 07:01 am by louwin
Sorry, you misunderstand   :)

At the moment ONLY ONE LED is ever lit at any instant in time. I will be extending this to up to 4 LEDs lit at any time BUT NOT on a common pin.

Even with 4 LEDs lit they will NEVER share a column nor a row. I am using DelayMicroseconds(500)

The maximum draw on any pin will be, for half a millisecond, 20ma.  Each pin can provide 40ma so I am only using half what any pin can provide.
Newbie, bought a Uno because I had a $10 Paypal voucher  :)

I live in Perth, Western Australia.

KenF

The maximum draw on any pin will be, for half a millisecond, 20ma.  Each pin can provide 40ma so I am only using half what any pin can provide.
No problem. 

BTW.  If you put a hole at each end of the egg before you suck, the contents come out easier :)

Go Up