Arduino Forum

Forum 2005-2010 (read only) => General => Exhibition => Topic started by: FrancisShanahan on Jan 03, 2009, 02:09 am

Title: (not another) LED Matrix project
Post by: FrancisShanahan on Jan 03, 2009, 02:09 am
Kicking off soldering tonight on an RGB matrix project. Here's the schematic. Will post back when done.

(http://picasaweb.google.com/lh/photo/4m0f5w6KA1bAIHIswXBFcg?feat=directlink)
http://picasaweb.google.com/lh/photo/4m0f5w6KA1bAIHIswXBFcg?feat=directlink
Title: Re: (not another) LED Matrix project
Post by: halley on Jan 03, 2009, 03:10 am
Now THAT is what I would like to try.  There are a lot of projects that are using these Maxim parts that are ridiculously expensive; I don't want to spend over $10 each cathode for R G B matrices.  You're using four 74HC595 packages, which are (in DIP form) about $0.60 each.

The layout of your schematic is a bit odd, but it looks like you're shifting in the bits for each row of cathodes in parallel.  Then you are using one more shift package to drive one anode at a time.

No support for dimming the board, as far as I can tell, but if you can tune the right resistors, it should look great.

Going to do more than one matrix?
Title: Re: (not another) LED Matrix project
Post by: FrancisShanahan on Jan 03, 2009, 07:26 am
Some decent progress made tonight, should easily finish tomorrow assuming I haven't screwed something up.

(http://lh3.ggpht.com/_45WOFW8ZSb4/SV8CIrplyNI/AAAAAAAAFHM/_zVWJ-m9qYE/s800/061.JPG)

To answer your questions though:

Let me preface with : I'm a complete noob, this is my 2nd project and am learning as I go.

I'm using an RGB 8x8 common anode matrix from LedSee (only $10 on ebay). I agree I think the matrices available out there are way overpriced at $35++ and then you have another $30 for the driver boards. And what's the point? For me I wouldn't have learned much from using those.

I've already roughed this up in a prototype which you can see here:
(http://lh5.ggpht.com/_45WOFW8ZSb4/SV8CMUwQHmI/AAAAAAAAFIk/dtM0myXcaZI/s800/050.JPG)

I was able to get fading implemented using some code from this guy:
http://blog.spitzenpfeil.org/wordpress/page/2/

Basically I'm building the same project as him only he knew what he was doing. It's fun though and I'm learning a lot.

The reason for the layout is to try to squeeze everything underneath a single matrix (6cm X 6cm). One of the shift registers will be on the outside but no biggie. As will the arduino.

Here's a snap of the PWM working in mockup.

(http://lh3.ggpht.com/_45WOFW8ZSb4/SV8CMg2dWRI/AAAAAAAAFIs/OrBKCo3X0Vg/s800/049.JPG)

more tomorrow probably.

regards,
-fs

http://www.foolstr.com
Title: Re: (not another) LED Matrix project
Post by: madworm on Jan 03, 2009, 09:31 am
well done!

being told that 'I knew what I was doing' doesn't happen too often  :D
be sure to post more of it when it is up and running.

cheers,

robert



Title: Re: (not another) LED Matrix project
Post by: anachrocomputer on Jan 03, 2009, 04:02 pm
If you want to implement PWM brightness control for the entire display at once, you can connect the /OE pins not to ground but to an I/O pin on the Arduino.  If you choose one of the PWM pins, just remember that it's /OE, that is, it's enabled when the pin is LOW and the analogWrite() function will work backwards (0 = full bright, 255=off).
Title: Re: (not another) LED Matrix project
Post by: FrancisShanahan on Jan 03, 2009, 04:48 pm
Robert, thanks for the help so far. You may recall on Youtube I commented that I couldn't light more than one color in a given LED at a time. The ISR code was a great help to me and the fact that you got everything working made me realise it was possible and that I had something wrong in my wiring. It turned out to be that I was not accounting for RED's forward voltage being lower than green and blue in the matrix, hence RED was always on and at a specific voltage green would turn on, as opposed to and even fade from red to green. I've accounted for this with 330 and 220 ohms resistors which seem to be a good match.

Anyway thanks again, you definitely know what you're doing (at least relative to me  ;) )

regards,
-fs

http://www.Foolstr.com
Title: Re: (not another) LED Matrix project
Post by: FrancisShanahan on Jan 04, 2009, 07:07 am
well I got it working after clearing up a few shorts. I must say it looks great but very hard to photograph or video tape.

Here's a link to the finished product.

(http://lh4.ggpht.com/_45WOFW8ZSb4/SWBQHtQt2pI/AAAAAAAAFRw/dai3yTOun2o/s128/arduino%20led%20matrix%20005.JPG)

(http://lh3.ggpht.com/_45WOFW8ZSb4/SWBReEeSaQI/AAAAAAAAFT8/pLOqMLchvG4/s800/001.JPG)

and the gallery is here:
http://picasaweb.google.com/francisshanahan/20090104ArduinoLedMatrix


Next step will be to make a nice enclosure and program a few cool animations.

I've tried linking to it interactively from Processing but seems like the refresh rate is pretty slow. Any idea what the quickest way to send down 3x64 bytes of data would be?

regards,
-fs

http://www.Foolstr.com
"the fool is proud of the one thing he knows"
Title: Re: (not another) LED Matrix project
Post by: joe912 on Jan 29, 2009, 08:37 pm
any chance you could post the processing code you used in the video along with the arduino code?
Title: Re: (not another) LED Matrix project
Post by: Oracle on Jan 29, 2009, 09:06 pm
Any chance of turning it into a shield and open sourcing the boards?  Especially if you put together a good library.
Title: Re: (not another) LED Matrix project
Post by: melka on Jan 30, 2009, 04:46 pm
Haven't had a good look at it, but I guess you can make a PCB the right size using only SMD components ^^
Gonna give it a try right now ^^
Title: Re: (not another) LED Matrix project
Post by: Oracle on Jan 30, 2009, 07:12 pm
A shield can be bigger than the Arduino (like the danger shield is).  Though if you can fit the parts, it's amazing how tightly you can route things with 2 layers.
Title: Re: (not another) LED Matrix project
Post by: melka on Jan 30, 2009, 08:44 pm
(I think) I finished routing a board, using SMD packages. Everything fits under the display.
Not really sure that all the connections are good, as I don't have the display here and therefore cannot test pinspacing and such.
PDF : http://melka.one.free.fr/temp/74HC595_RGB_MATRIX_DRIVER_BOARD.pdf
EAGLE : http://melka.one.free.fr/temp/74HC595_RGB_MATRIX_DRIVER_BOARD.zip

Cheers
Title: Re: (not another) LED Matrix project
Post by: halley on Jan 30, 2009, 09:12 pm
melka, looks awesome.  I like the attractive X style placement.

Why'd you put all components on the "bottom" of the board in Eagle, though?  You could have built it all with components on the top as usual, keeping in mind the reversed pinouts of the headers only.  Many places charge extra for silkscreening on the "bottom" and you can't just swap bottom for top.

Have you run the SparkFun set of rules?  Any traces too close or too far?  They look for 8 mil spacing and paths.
Title: Re: (not another) LED Matrix project
Post by: halley on Jan 31, 2009, 02:25 am
melka, I hope you don't mind I started with your schematic and did some of my own adjustments.  Besides flipping the components so they nestled on the "top" layer between the PCB and matrix, I made these changes.

(1) I corrected the pin spacing for the GYXM-2388AURPGB parts that I got from LEDsee.com.  You were slightly off the grid left/right for a couple of the pin spots.  The two rows are 1.9" or 19 pins apart.

(2) I reordered the anode pins so the rows are in QA,QB,QC,...,QH order from the anode driver.

(3) I took Anachrocomputer's suggestion, and tied the R, G and B chips' "G" aka "/OE" pin to a sixth input called DIM on the jumper.  I did it on the cathodes and not on the anodes, because I might want to fine-tune RGB balance with separate PWM inputs sometime (not in this revision).  If the user doesn't want any PWM support, they can supply GND connections offboard.

(http://i315.photobucket.com/albums/ll450/HariEdo/74HC595-Matrix-Driver.png)

I'll supply EAGLE files back after I take a little more time for review.
Title: Re: (not another) LED Matrix project
Post by: melka on Jan 31, 2009, 06:01 pm
Sorry for answering so late ^^

Quote
Why'd you put all components on the "bottom" of the board in Eagle, though?  You could have built it all with components on the top as usual, keeping in mind the reversed pinouts of the headers only.  Many places charge extra for silkscreening on the "bottom" and you can't just swap bottom for top.

I was originaly going to route a single sided board, so that it can be easily home-etched, but well, that didn't work. I went for the double sided PCB but I forgot to switch the component to the top side. Sorry guys ^^

Quote
melka, I hope you don't mind I started with your schematic and did some of my own adjustments.

No problem at all, everything I did is free to use. Well, I didn't do much, but use it as you want ^^

I have a little question : what is the wiggly line inside the board edge ?

Nota bene : I used resistor networks in a QSOP package, but those don't really come cheap.
R220 = 2.35$ : http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=VSSR16-220-JI-ND
R330 = 1.89$ : http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=VSSR16-330-JI-ND
It might be interesting to use 0603 resistors instead, to cut the price down.

In addition, if someone wants to use several boards+display side to side, maybe we should add a row of headers, with the DIM / SCK / SCI / VCC / GND shared with the already existing 6 pins header going to the arduino, and taking the SERIAL OUT of the 4th 74HC595 and wiring it to the SER pin of the "outgoing" header". Not sure if I'm clear here ^^

Nice to see that this board might be useful to someone.
Title: Re: (not another) LED Matrix project
Post by: halley on Jan 31, 2009, 06:06 pm
Quote
I have a little question : what is the wiggly line inside the board edge ?


It's to guide the attachment of the matrix to the board.  The only way to identify pin 1 from pin 17 is to notice the key grooves on the matrix part.    The actual matrix outline in yellow is showing the key grooves; the white wiggly line is for the silkscreen to help show this relationship.

(http://halley.cc/arduino/ledsee-8x8-rgb-led-matrix-74hc595-small.jpg)

Quote
In addition, if someone wants to use several boards+display side to side, maybe we should add a row of headers, with the DIM / SCK / SCI / VCC / GND shared with the already existing 6 pins header going to the arduino, and taking the SERIAL OUT of the 4th 74HC595 and wiring it to the SER pin of the "outgoing" header".


I was also thinking the same thing, but I wasn't sure of the best approach.  Ideally, a ribbon cable with identical wiring to all boards would be nice, but I think you're right, two headers, one for input, one for output, may be required.

I don't think one Arduino could manage all the data required for two matrices, anyway.  The generic 6-pin header is to go to any interested hardware, whether it's an ATmega168 or something larger.

However, I'm trying to make the empty space in the middle large enough I can optionally attach an Arduino Pro Mini to it.  It would fit between the matrix board and the matrix itself, listen to commands in some way, and manage the refreshes.  Any ideas there would be welcome.

Unfortunately, a Mini Pro + Matrix Board will probably be the same cost (or worse) than the existing Matrix Backpack at Sparkfun.
Title: Re: (not another) LED Matrix project
Post by: melka on Jan 31, 2009, 06:35 pm
Don't know if you saw my current project that I called matriduino.
http://melka.one.free.fr/blog/?p=145

What I want to do is attach an ATmega168 on the bottom side of a PCB, and an 8x8 LED Matrix on the top side. I have a few more chips with it (TLC5940, ULN...) to control the thing.

Maybe we could do the same with this baby : just have a 7805, ATmega168, XTAL and Stuff, program it via ICSP and have a connector for I2C / Serial communication. This way, the board + matrix can be standalone or controlled via a master chip using the I2C connection.

The matriduino is bit more complex, as I want to have PWM control over each leds, "high power" via 12V supply for the leds, etc... but the idea is the same.

But this can be expensive and not worth trying to do, as Sparkfun already have done it...
Title: Re: (not another) LED Matrix project
Post by: halley on Jan 31, 2009, 06:41 pm
Yup, watched your matriduino threads, but as you say, it's a lot more complicated.  And when you're done, you still just have 8x8 lights.  Gotta see how we can economize to support those big red/blue light towers in your website photo.
Title: Re: (not another) LED Matrix project
Post by: melka on Jan 31, 2009, 06:43 pm
Not sure we can... ^^
Title: Re: (not another) LED Matrix project
Post by: BroHogan on Jan 31, 2009, 07:50 pm
Gentlemen,

I like where this is going!

Having worked with the MAX72xx and RG matrices for about a year now I'd really like to see a low cost RGB "backplane" with PWM.

I'm sure you will get a lot of suggestions, so I might as well express two thoughts.  ;)

- I like the idea of being to expand horizontally - add more matrices - but I also like the idea of being able to expand vertically - i.e. "sandwich". Bringing the I2C, SPI, and COMM out of the bottom of the board as discrete connectors has served me well. It's made it easy to add RTC, EEPROM, RS232, IR, etc.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1214682544/0

- When you finalize the design, perhaps it might be a good candidate for Seedstudio's propaganda service. They could also supply a compatible matrix.

All the best with this project.

John

Title: Re: (not another) LED Matrix project
Post by: halley on Feb 07, 2009, 01:46 am
Quote
Nota bene : I used resistor networks in a QSOP package, but those don't really come cheap.
R220 = 2.35$ : http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=VSSR16-220-JI-ND
R330 = 1.89$ : http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=VSSR16-330-JI-ND
It might be interesting to use 0603 resistors instead, to cut the price down.


Well, I got around to looking at the datasheets for these little QOIC resistors, and also sampled some of those 0603 types.  I already have a PCB on the way, so I will use the QOIC for that one, but the 0603 types are way way way cheaper (can't buy less than ten, and it's still cheaper).  For whatever reason, 330ohms was 2/3 the price of 220ohm in the QOIC also.
Title: Re: (not another) LED Matrix project
Post by: melka on Feb 07, 2009, 06:28 pm
keep us posted as you receive the PCB ^^
Title: Re: (not another) LED Matrix project
Post by: halley on Feb 19, 2009, 04:20 pm
Yet another update.  I'm still waiting for my rev01 board (based on melka's original) to be delivered, but I finished routing my rev03 board ideas already.

The rev03 has:

* ten pin connection
* only five pins required (GND, VCC, SCL, SCK, SERIN)
* another five pins optional (SEROUT, GND, DIMR, DIMG, DIMB)
* solder jumpers to connect DIMR, DIMG, DIMB to GND if not desired
* one 0603 pad for capacitor

It may be required to have more capacitors to deal with major current switching, but I'll wait until I have the rev01 board in-hand to evaluate the situation on an oscilloscope.  It may be a non-issue for one matrix.

This is part of what BatchPCB.com shows you when your design passes all the tests for isolation and trace sizes:

(http://i315.photobucket.com/albums/ll450/HariEdo/6560_top_lg.png)

I'm also starting to think about how I can drive two 8x8 RGB matrices using three TLS5940 packages.  Each package has 16 PWM outputs, so you either use 1.5 of the packages on one matrix, or three packages on two matrices.
Title: Re: (not another) LED Matrix project
Post by: FrancisShanahan on Feb 21, 2009, 01:17 am
WOW this is so awesome. I hadn't checked back at this thread for a while and am amazed at all the great work. I had thought to make a PCB but my Eagle skills are non-existent so I'm very grateful that folks have taken the time to do this. Looks excellent.

I had a small update on my end; I completed an enclosure for the device. I've uploaded some pics here:

http://picasaweb.google.com/francisshanahan/20090108LedMatrix#

The enclosure is cherry, lexan and 4 flat head stainless steel bolts to dress it up.

Again, for whatever reason I can't figure out how to get some decent pics of it.

Some Video:
http://www.youtube.com/watch?v=j6nK33QI-So

Also had a video up on YouTube of my daughter playing with it.
http://www.youtube.com/watch?v=QMKiN_5nrUI

What's great about this is the kids. They love it and it's a great learning tool. My youngest uses it to learn colors (red + blue = purple) and my daughter uses it to learn letters.

Overall this is was a great little project. Again, really excited to see where you guys take it.

Keep us posted.

-fs

http://francisshanahan.com
http://foolstr.com
http://karenscancer.blogspot.com

(http://lh5.ggpht.com/_45WOFW8ZSb4/SZOwDs2nexI/AAAAAAAAFb0/_bdwyBNZOfs/s576/022.JPG)
Title: Re: (not another) LED Matrix project
Post by: melka on Feb 21, 2009, 11:54 am
Rickrolling RGB style ^^
Title: Re: (not another) LED Matrix project
Post by: halley on Feb 24, 2009, 12:08 am
(http://halley.cc/pix/rgb8x8-rev01.jpg)
Title: Re: (not another) LED Matrix project
Post by: melka on Feb 24, 2009, 12:22 am
video
video
video
video
video
Title: Re: (not another) LED Matrix project
Post by: halley on Feb 24, 2009, 05:14 am
Argh, well, it was good practice (my first SMD soldering job).  I did okay with the soldering, and did get some lights to light up, but there are some circuit issues in my rev01 board that won't be easy to fix up in code or with a razorblade.  (Some traces I would need to cut and re-route are underneath the SMD parts.)

The good news is that I think my next rev will be ready to run with the existing sketches found on madworm's original blog ("My 2µF"):  http://blog.spitzenpfeil.org/wordpress/2008/09/21/8x8-rgb-matrix-first-prototype-on-perfboard/

Just have to wait for it to arrive.  >sigh<
Title: Re: (not another) LED Matrix project
Post by: sosox on Feb 24, 2009, 10:16 am
I have just got this LED matrix today, that's what  I would like to learn later.
But I have not it's spec so that I even don't know the definition of all the pins...
Would u like to show me some  information  about the LED matrix ~
thx~ ;)
Title: Re: (not another) LED Matrix project
Post by: halley on Feb 24, 2009, 01:14 pm
As with any part, google for the word datasheet and whatever part number you find stamped on it.
Title: Re: (not another) LED Matrix project
Post by: melka on Feb 24, 2009, 09:35 pm
halley : what are the exact problems you're facing ? just curious
Title: Re: (not another) LED Matrix project
Post by: halley on Feb 24, 2009, 11:07 pm
melka, your schematic differs from madworm's in two ways, which is fine-- my rev01 which is based on your original schematic might even work with some software changes to madworm's example sketches.

The easier difference is the order of the 595 chips.  Yours routes Green, Anodes, Red, Blue, which may have been useful in your PCB arrangement, but seems somewhat arbitrary in code.  madworm's routes Anodes, Blue, Green, Red.  This ordering is important as you shift all the bits into place.

melka, you take in SCL and route it to all 595 SCL; madworm takes in RCK and routes it to all 595 RCK.  The unused pins are attached to VCC or GND in either case.  So the SPI conversation needs to deal with this difference.  I couldn't get it to work last night, but I expect it's possible.  It might cause some blurring or flicker if done one way or the other, if I understand the datasheets correctly.

A third issue I have is the current OSX 0013 ISR problem.  I changed the sketches to simply loop tightly and call the isr() routine directly, to avoid the ISR register bug on that version of the compiler.  The ISR is the right choice, but I'll work around it until the compiler package is updated with the true fix.

I'm not complaining at all-- it was interesting excuse to study the two proposed schematics and the actual workings better.
Title: Re: (not another) LED Matrix project
Post by: madworm on Mar 15, 2009, 12:37 am
Any progress on this project ?

I had my matrix doodad manufactured at seeedstudio and am still waiting for the PCBs to arrive. It's not a shield, but something like the sparkfun matrix controller/driver with the option to stack further shields onto it. The stacking headers expose PORTC and PORTD and provide power. I'm planning to build a battery backpack with a boost converter to make it run from 2 cells. The pin spacing should be perfboard compatible.


(http://farm4.static.flickr.com/3443/3314956692_867edcee7e_m.jpg) (http://www.flickr.com/photos/madworm_de/3314956692/)

If it should turn out that we can share some code for driving the matrix, we might add it to the playground to share it with the community. Seeedstudio should provide easy access to boards as soon as I've confirmed it actually works :-)
Title: Re: (not another) LED Matrix project
Post by: melka on Mar 15, 2009, 12:55 am
Nice one, madworm ^^
Everyone is gonna have his little personal matrix, that will be nice, maybe we should have a contest ^^
Title: Re: (not another) LED Matrix project
Post by: halley on Mar 15, 2009, 04:32 am
My next revision of my RGB board (no embedded atmega) should arrive any day now, I'll let you know whether it works or not.  It's not meant to be a shield, really, but it just so happens to fit the Duemilanove pin-outs for SPI and power.  It should be able to use madworm's code directly.

It also uses those insanely tiny resistor arrays.

(http://i315.photobucket.com/albums/ll450/HariEdo/img24706.jpg)

The one on the xacto blade is a four-resistor array, that's 8 pins to solder.  The ones in the tape package are eight-resistor arrays with 16 pins.  Should be fun... I don't have any solder paste.
Title: Re: (not another) LED Matrix project
Post by: madworm on Mar 15, 2009, 01:40 pm
Nice. I hope you won't have to wait for long.

I have a feeling that a few more eyes on that framebuffer routine will be a good thing. I haven't put any effort in speed optimization yet. Maybe it can be pushed to do more than 32 steps of brightness per color and leave a bit more cpu time for serial/I²C I/O. Maybe moving away from arduino's I/O functions could squeeze out a few µs. If that's documented well it should be understandable for people after a bit of reading.

Good luck with the resistor arrays.

May the flux be with you  ;)





Title: Re: (not another) LED Matrix project
Post by: florinc on Mar 15, 2009, 03:04 pm
I am just wondering, isn't there any maximum current/power limitation on the resistors? Theoretically, they should be able to take 160mA (20mA x 8 LEDs) at some point?

Title: Re: (not another) LED Matrix project
Post by: becksradke on Mar 15, 2009, 10:55 pm
if it happens that i have a 14x14 common cathode RGB matrix, will some of what is posted here, will help me?
Title: Re: (not another) LED Matrix project
Post by: florinc on Mar 16, 2009, 01:47 am
Maybe. Principles are the same. Start small, with an 8x8, and maybe not even RGB.
The difference between an RC model airplane and a real one is just the scale :)

Title: Re: (not another) LED Matrix project
Post by: madworm on Mar 16, 2009, 08:47 am
@becksradke:

The biggest difference between the 8x8 and 14x14 RGB  matrix is, that you will need more RAM to store the data. So you should go for the atmega328 chip.

The 2nd issue maybe is speed. The 14x14 has about 3x as many LEDs as the 8x8.

The 3rd issue is that you'll have to devise a way to address the hardware efficiently, as the 8bit shift registers won't hold 14 bits.

The 4th issue may be current. I noticed that when driving the LEDs with full current I was over stressing the "driver" chips and got funny colors.

But in principle it should work. The 74hct595 are extremely cheap, so get them anyway :-)

Title: Re: (not another) LED Matrix project
Post by: halley on Mar 22, 2009, 06:20 pm

Huzzah, the rev04a board works!

(http://i315.photobucket.com/albums/ll450/HariEdo/img24714.jpg)

Still a couple tiny things I'm not happy with, but it uses madworm's 15-bit RGB interrrupt service routine with only one small change.

http://www.youtube.com/watch?v=uexTSntRucM
Title: Re: (not another) LED Matrix project
Post by: JayCollett on Aug 25, 2009, 08:13 pm
halley,

Any update on this, looks fantastic!
Title: Re: (not another) LED Matrix project
Post by: novice on Sep 20, 2009, 07:34 am
Interesting work halley