SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By voxel
#30899
Hello everyone,
I'll start off by saying I am very new to all this, but I'm trying to be patient and learn as much as I can!

I've had this idea for a while, and have been gradually researching how I might accomplish it..
Basically, I want to create a poster-size LED array (~500 LEDs I suppose) that can display user-defined patterns and hopefully act as an audio spectrum analyzer as well.

I think the best way to get a nice even spacing would be to use some pegboard from a hardware store that has 5mm holes.

I've also been pondering about ways of controlling the matrix, as I'd like to be able to do something real-time (like an audio spectrum analyzer) as well as 'patterns' that can be just looped and possibly 'random' patterns. I think a convenient way of controlling it for both these purposes would be over a network, and I noticed the Olimex LPC-E2124 in the Ethernet to Color LED Matrix tutorial... but its $100 :?
But if the network-control option is feasible, then the Java program mentioned in the Ethernet LED matrix tutorial would be perfect.

Also, I figured I'd like to have a way of being able to easily replace individual LEDs in case of failure..

Does anyone have any ideas/suggestions on where I start/etc. (I realize this will take quite some time for me) Or am I completely in over my head :)
User avatar
By bigglez
#30902
voxel wrote:I've had this idea for a while, and have been gradually researching how I might accomplish it..
Basically, I want to create a poster-size LED array (~500 LEDs I suppose) that can display user-defined patterns and hopefully act as an audio spectrum analyzer as well.
Greetings voxel,

Others have a similar dream. Check out this thread.
voxel wrote:Does anyone have any ideas/suggestions on where I start/etc. (I realize this will take quite some time for me) Or am I completely in over my head :)
Your project needs three electronic elements, plus the physical construction (by selecting peg board you have a good jump start).

(1) Power Supply (small LEDs consume 15mW each * 500 = 7.5W)
(2) LED matrix driver (Hint: Rows and Columns are m*n)
(3) Controller (that receives data from another source and formats it to drive the matrix of LEDs).

Forget battery power. A commercial power supply will suffice. If the matrix was 512 (instead of 500) you'd have binary weighted numbers for m and n of, say, 32 * 16 or two sets of 16 * 16, lending itself to standard byte size ICs. The controller will be tied up all the time unless the display is latched with dedicated hardware. Running it from a PC port would be a waste of the PC's power, so a dedicated uC would make more sense. That uC could talk to the PC or other hardware with any flavour of interface including ethernet running a web application.

If I were you I'd start with a very small matrix of LEDs (1*8, 4*8) and a uC, get that working first, then scale it up. Your big matrix could be built from identical blocks of smaller size, that is how the "Las Vegas" outdoor video screens work, and they often have one million LEDs or more.

5mm LEDs will cost 34cents each (qty 1) and 11cents qty 500. If you can deliver "LED controller channels" for fifty cents an LED, that's around $300 budget for the project (not sure why you scoffed at $100 earlier...).

Comments Welcome!
By voxel
#30909
Thanks for the fast reply bigglez!
I've learned quite a bit since posting earlier :)
Greetings voxel,
Others have a similar dream. Check out this thread.
I had checked out that thread already, unfortunately a lot of the lingo being used is over my head making it hard to follow :(

(1) I had already figured using a commercial power supply would be the best way to go.
(2) So I would need a LED matrix driver for each smaller 'sub-matrix' (eg. 5x7 LEDs) making up the larger array?
A few articles I've come across mention this matrix LED driver, and most other drivers seem to be segmented (which, I learned is for a digital-clock-type display) or 5x7 LED matrix.
Now, from what I can gather from the MAX6952 specs, it can handle four 5x7 LED matrices... So could I just create smaller 4x(5x7) matrices and use multiple drivers?

You mention using standard byte size ICs if the matrix was 512 (which is fine, by the way), then you state that a dedicated microcontroller would make more sense. What type of microcontroller would I be looking at to control a smaller matrix for testing? (I really don't know where to start or what I'm looking for)

As far as the LEDs go, I've got a bag of 500 blue LEDs already, and I'm not sure what you mean by "If you can deliver "LED controller channels" for fifty cents an LED"... $300 isn't too bad I suppose (over time..hehe)
I only scoffed at the (extra) $100 for being able to control the large matrix via ethernet using the Olimex LPC-E2124...
User avatar
By bigglez
#30917
voxel wrote:So I would need a LED matrix driver for each smaller 'sub-matrix' (eg. 5x7 LEDs) making up the larger array?
At the end of the day, each LED needs three things: (1) A power source and (2) A switch to turn it on and off, and (3) A memory to keep it turned on while your controller is busy with the other LEDs in the array.

The switch is controlled by your data stream, and how you get that to the LED can take many forms. Discrete transistors, standard logic, general purpose ICs, or Application Specific ICs. A lot depends on your budget, timeline, and access to parts.

A small array of, say, 16 LEDs could be driven by a single IC, either a uC or a ASIC intended for a larger array. If you can build this one, you can turn the crank and make a larger array. There's a point where the smallest element becomes too costly (to reproduce in quantity) but we're getting ahead of ourselves.
voxel wrote: Now, from what I can gather from the MAX6952 specs, it can handle four 5x7 LED matrices... So could I just create smaller 4x(5x7) matrices and use multiple drivers?
Yes. This IC will do a lot of heavy lifting for you. Perhaps the MAX7219, MAX7221 Serially Interfaced, 8-Digit, LED Display Drivers from Maxim make more sense as they can drive 64 LEDs. So you'd only need to construct seven more of these modules once the first one is running. (512/64 = 8). Today I'd want to know if those ICs are available in ten unit quantity and how much? With one (perhaps a free sample or two?) you could build a prototype and use it to justify or modify the main project. Your next step might be to download the data sheet and see if it makes any sense (we're here to help if it's a complete fog!).
voxel wrote:You mention using standard byte size ICs if the matrix was 512 (which is fine, by the way), then you state that a dedicated microcontroller would make more sense. What type of microcontroller would I be looking at to control a smaller matrix for testing? (I really don't know where to start or what I'm looking for)
You can use any of many types on the market, depending upon your starting point and current skills. At the entry level expect to pay more for the hardware as it's an educational tool. I'm thinking of the BASIC stamp or PICAXE products. With a bit more skill you can go straight to the IC level hardware and use the popular PIC (Microchip) or AVR (ATMEL) devices.

Regardless of hardware your project will require custom software that you have to write, debug, and load into the target hardware. A PC and text editor are the basic tools, but along the way you'll need to buy or borrow a programmer of some sort. You can make one from scratch, but that's a project unto itself.
voxel wrote:As far as the LEDs go, I've got a bag of 500 blue LEDs already, and I'm not sure what you mean by "If you can deliver "LED controller channels" for fifty cents an LED"... $300 isn't too bad I suppose (over time..hehe)
I only scoffed at the (extra) $100 for being able to control the large matrix via ethernet using the Olimex LPC-E2124...
My bad. I thought you were expecting to do it all for not much money, perhaps under $100. I put the budget out there to make you aware of the cost for materials to build a project of this type. I assume you're providing the labour and that you have access to basic tools and test equipment to complete the task?

Comments Welcome!
By winston
#30919
bigglez wrote:[ (3) A memory to keep it turned on while your controller is busy with the other LEDs in the array.
Surely the display will be multiplexed, so you won't need an active element to keep the LED turned on once the uC turns its attention to another row of pixels? Certainly, all the matrixes I've seen that you can buy commerically do not have anything to keep the LED turned on when you turn your attention to the next row. Presumably you can get away with a 1:8 duty cycle on each LED (since many of the LED blocks come in 8x8 matrices).
User avatar
By bigglez
#30926
winston wrote:Surely the display will be multiplexed, so you won't need an active element to keep the LED turned on once the uC turns its attention to another row of pixels?
Greetings winston,

The display will be MUX'd to reduce the number of drivers; a static display would require 512 drivers in this case, but MUX'd that number falls to just 48 (32 + 16).
winston wrote:Certainly, all the matrixes I've seen that you can buy commerically do not have anything to keep the LED turned on when you turn your attention to the next row.
The data supporting the LEDs must be stored somewhere. The MAXIM driver IC has a 64 bit RAM, other schemes require additional memory. A static display requires that the drivers have memory (latches), while a MUX'd display requires that the data is strored in the MUX controller (a uC, perhaps). Without memory the display would have to capture fresh data from the host in real time.
winston wrote:Presumably you can get away with a 1:8 duty cycle on each LED (since many of the LED blocks come in 8x8 matrices).
The OP is using discrete LEDs. Placing them in blocks of 8 does help with reducing the hardware while keeping a reasonable duty-cycle. It also gives the OP a chance to built a small array to explore the concept, and expand from there.

Comments Welcome!
By voxel
#30974
Wow, you guys are great! I really appreciate all the help!
Perhaps the MAX7219, MAX7221 Serially Interfaced, 8-Digit, LED Display Drivers from Maxim make more sense as they can drive 64 LEDs.
64 LEDs per driver sounds good to me :) I checked the maxim-ic website and they are available in quantities 1-24 @ ~$7 each. It also looks like I can order a sample, which would be perfect because I can try that out with the LEDs I have! Would this particular driver (MAX7219/7221) be ok for 'faster' applications (like an audio spectrum analyzer)? Also, what is the difference between serial 3-wire interface and serial SPI interface? which would you recommend for me to try/test?
So, equipped with a PC, a breadboard, one of the MAX7219/7221 and some LEDs I could start experimenting?
I assume you're providing the labour and that you have access to basic tools and test equipment to complete the task?
Yes, I'll be slowly working on this between university assignments :)
User avatar
By bigglez
#30978
voxel wrote: It also looks like I can order a sample, which would be perfect because I can try that out with the LEDs I have!
voxel,

I'd request two samples - it's a system critical component and when you break or drop the first one you'd have to wait for a replacement. Having done this myself on other projects...
voxel wrote:Would this particular driver (MAX7219/7221) be ok for 'faster' applications (like an audio spectrum analyzer)?


Yes. The industry standard is 5MHz on the data bus for LED drivers, this one is rated to 10MHz. Worst case your 512 display LEDs could be changed at, say 20kHz, to follow audio. (20kHz * 512 is about 10MHz.)More likely the fastest changes are one percent of that rate. (2kHz * 512 is about 100kHz.)
voxel wrote: Also, what is the difference between serial 3-wire interface and serial SPI interface? which would you recommend for me to try/test?
The serial 3-wire interface requires a clock and data to send the data to the MAX ic. When all the serial data is read in the third line is used to load the new data (MAX7219). The CS/ line is used to select (activate) the device (MAX7221), which is structured differently to the MAX7219 to make it compatible with published bus structures (microwire, SPI, QSPI).

My personal choice would be the MAX7219 with DIN,CLK, LOAD as I've used this format before, and don't plan to interface with the other standards that require a CS/ line.
voxel wrote: So, equipped with a PC, a breadboard, one of the MAX7219/7221 and some LEDs I could start experimenting?
Well, umm, yes. The PC could talk directly to the MAX ic over the parallel port (if it has one). You won't touch the upper speed on the MAX ic, but you should be able to stuff it full of data and have the LEDs respond.

The MAX ics (both) have smarts to decode the data, and format it for seven segment displays. You are interested in control of 64 discrete LEDs, so select the no-decode control option.

Comments Welcome!
By voxel
#31035
bigglez wrote:and when you break or drop the first one you'd have to wait for a replacement
Good call ;)

I went and requested 2 samples of the MAX7219, and have found an article on the maxim-ic website that explains how to use a PC to experiment with the MAX7219 :)
bigglez wrote:You are interested in control of 64 discrete LEDs, so select the no-decode control option.
How do I do that?

Now I'm just waiting on my 2 MAX7219's... and then I can hopefully start experimenting :D
User avatar
By bigglez
#31038
voxel wrote:I went and requested 2 samples of the MAX7219, and have found an article on the maxim-ic website that explains how to use a PC to experiment with the MAX7219 :)
bigglez wrote:You are interested in control of 64 discrete LEDs, so select the no-decode control option.
How do I do that?

Now I'm just waiting on my 2 MAX7219's... and then I can hopefully start experimenting :D
voxel,

That's way Kewl!

The Visual Basic utility program has buttons to write to the control registers, in particular 0x9 (Decode Mode). According to table 4, page 7, of the MAX7219 data sheet, 0x00 sets it to no-decode.

The use of developed and tested MAXIM VB5 software will shorten your development cycle. (I had a feeling you might get bogged down on the PC software - that would also be my weakness!).

My thoughts were to suggest that you run just eight LEDs at first, add groups of eight later, once the first string works (no point in ripping up all 64 if they're backwards). You will need a 1Amp rated 5V supply, as 64 LEDs at 10mA each will need 640mA.

As things are going so well - you really have a construction project ahead, not software and hardware development - perhaps you should think about installing 64 LEDs?

You haven't indicated your PC or other code skills. The next project would be to write some code to run on a PC that does something useful with your matrix. In my world that could be as simple as random or timed routines that fill and empty the matrix, or do so with fading (PWM) instead of bang-bang switching.

As the MAX7219 provides seven-segment decoding, and if you had some spare LEDs, you could built a giant clock display with strings of LED "dots" to form the segments.

No doubt others will jump in here with application hints!

Comments Welcome!
By Morrog
#31109
Just a quick note:
I think it would be easiest to use SPI (MAX7221) if you plan on controlling 512 LEDs from a single microcontroller. A lot of microcontrollers have builtin SPI support, and by using the CS/SS line you can control all the MAX7221 chips with just 8+3 pins. 8 pins for each SS line on each MAX7221, and 3 for the shared IN, OUT, and CLK lines.

Anyway, thanks to voxel I discovered the free samples of MAX7221 chips and ordered 2 for myself :) They'll be fun to play with and possibly use instead of shift registers in my project.
User avatar
By bigglez
#31110
Morrog wrote:Just a quick note:
I think it would be easiest to use SPI (MAX7221) if you plan on controlling 512 LEDs from a single microcontroller. A lot of microcontrollers have builtin SPI support, and by using the CS/SS line you can control all the MAX7221 chips with just 8+3 pins. 8 pins for each SS line on each MAX7221, and 3 for the shared IN, OUT, and CLK lines.

Anyway, thanks to voxel I discovered the free samples of MAX7221 chips and ordered 2 for myself :) They'll be fun to play with and possibly use instead of shift registers in my project.
voxel, Morrog,

The MAX ICs *are* shift registers! The 7219/7221 have additional features, but data passes in serially in 16 bit words.

The same data passes out serially from the first chip to the second and subsequent ones. So you only need *three* IO pins on a uC (four if you loop the last MAX IC back to the uC - a good way to automatically measure the message length, but we're getting ahead of ourselves again).

The difference from SPI to other formats is that one requires a CS/ instead of a LOAD signal line. Either will work in this application. The demo software (from Maxim) caters to both types.

So, it's a race to see which of you get the first LED to light!

Gentlemen, start your engines (and soldering irons)!

Comments Welcome!
By Philba
#31112
with a little tweaking, you can usually make any SR work with SPI HW if you control the CE (or enable or load) pin separately. Of course, SPI is pretty easy to do in software.
By Morrog
#31114
Oh I see, I hadn't looked at the MAX's datasheet yet. Thanks for the info.

In any case, I've already lit LEDs with my shift registers. ;) They animate and everything. I'm just putting together diagrams and part lists for the next phase of my project.
By voxel
#31131
bigglez,
starting with a group of 8 LEDs is a good idea, and once I get the hang of that I'll expand.
I have lots of programming experience in C, Java, and other languages and have very strong PC hardware and software skills... I've just never done any of my own hardware programming, so it should be fun (and probably frustrating) :)
bigglez wrote:perhaps you should think about installing 64 LEDs?
Yes, and as I said before I was considering using some kind of pegboard to get a nice even spacing for the LEDs, but it would have to have 5mm holes... I'll have to ask around for that.
Also, as I mentioned before I'd like it so that I could fairly easily replace individual LEDs if any happen to fail, so what would be a good suggestions for that?

I've managed to locate an old parallel cable and sliced one end off to be able to access the wiring, I'm going to map out the pins that I need according to the diagram in the article I found and had mentioned earlier.
I had a couple questions about the diagram: pins 18-25 show as being connected to ground (0V)... Does that mean that pins 18-25 are ground, or does it mean that they need to be grounded to some 'external' ground?
I'm pretty sure those pins act as ground, and if thats the case, can the the 0V ground under the 220pF capacitors just be connected to the ground pins 18-25?
Also, the diagram does not mention what V+ should be? 5V?
I figure I'll have my parallel cable hooked up to my PC, then run to a breadboard with that circuit (in the diagram) built, and then probably to a bigger breadboard for the LEDs

Morrog,
free samples are always good in my books! I can't wait until I get mine in the mail :)

And I have to say it again, I really appreciate all the help, input, suggestions, comments and guidance from everyone!