Go Down

Topic: 8x8 rgb led matrix + 4bit pwm, irq code speed (Read 14032 times) previous topic - next topic


I'm experimenting with toner transfer right now to get a decent pcb done for this project. Seems I'll be needing a laminator - or much more practice and pressure. My tiny iron just doesn't do a good job for more than 25x25mm. So far I've tested this with "HP Premium Plus Photo Paper, satin matte" (for inkjets, but printed with a laser of course). Except for some defects at the edges it delivers a remarkably sticky layer on the copper with sharp edges. Not worse than most of the photo transfer I've done so far, and less chemicals :-)

I bought the blue press 'n peel before I'd heard of using photo paper.  So I've never actually tried photo paper, but I found the press 'n peel very easy to use, I got a perfect impression (about a 2x3" board) the first time and every time.  Since then I've read that photo paper can be just as good, but if you're having that much trouble, maybe try the real thing?

I'll post some pictures and videos of the current status when I wake up again. Right now there's also code for individually addressing each of the 64 rgb leds, set a HUE value, set RGB values and some fader effects for testing. Right now the PWMing is done with an ISR routine and supports 28 brightness levels for each colour channel. Anything above that takes longer than timer2 can support. I'll switch to timer1 to get more time in the ISR routine.

This has been a very interesting thread.  I'm curious how long your ISR is now.  Earlier you were talking about it being in the 20mS range, which could be a problem with your main program halting for long periods of time (if you're doing anything more complex than setting up the values for the ISR).  


Right, the ISR time is quite maxed out right now. I haven't had the nerve to touch my old oscilloscope yet to get some real numbers for that. This magnificent piece of electronics really triggers a primeval urge in me to kick it off the table.

Using timer2 the arduino can handle about 28 levels of brightness, anything above that freezes the code. I take it that the ISR gets called again before ever finishing, thus no time is left for the main loop to manipulate the leds. I'm hoping to fix that with timer1, as is takes longer for it to trigger an OVF interrupt. This will of course affect overall responsiveness of the thing, but I haven't put the code for serial transfer in yet.  ::)


Aug 03, 2008, 07:37 am Last Edit: Aug 03, 2008, 09:24 am by madworm Reason: 1
Forgot to comment on the press'n peel.

Some distributor I found sells it for about 4.60? a sheet, now I'm officially "not amused". Also my private laserprinter can't stand the HP photo paper at all (doesn't even fuse the toner to it), the one in my office worked fine. And all the other "high gloss" magazine papers that need soap and some rubbing after ironing just create paper jams.  >:(

oh well, back to work...

edit: will give the toner transfer paper by 'pulsarprofx' a shot. at least for me it's cheaper than the p'n p sheets.


Aug 12, 2008, 09:46 pm Last Edit: Aug 13, 2008, 06:09 am by madworm Reason: 1
woohoo ;D

The pulsarprofx toner transfer paper really works for me.
Except for some minor toner sticking problems (might have touched the paper with my greasy fingers), the transfer is really easy. I even managed to apply too much pressure with my tiny clothes iron and smudged some tracks. The wet phase just takes about 15 seconds and the paper comes off without any residual fibers. No hot water/soap/rubbing required.

I will do some more tests tomorrow.

images of 1st test on aluminum board

edit: well, a bit more tricky than expected with the old iron. there's enough heat, but getting the right amount of pressure is hard. if using the tricks given on the homepage with a piece of round wood, the toner sticks like mad but the details are smudged. just pressing down the iron gives near perfect details (down to 4pt fonts), but the toner doesn't stick properly. at least not on aluminum.

ordered a laminator.


Aug 18, 2008, 12:01 pm Last Edit: Aug 18, 2008, 12:02 pm by madworm Reason: 1
ad laminator:

Got me a 'GBC Heatseal H212', the same brand that's sold by the pulsar people.
I managed to pass 16 sheets of paper through it, which is about 1.72mm or 68mil (uncompressed). Unfortunately it stalls with 1.5mm PCBs. Will test with 1.0mm / 0.8mm PCBs as soon as I can get my hands on them.

I'm starting to feel sorry I sold the UV thingy I once had...


Aug 18, 2008, 09:48 pm Last Edit: Aug 18, 2008, 10:01 pm by madworm Reason: 1
Ok, so the laminator had to be modded. Some (actually 10) plastic paper guides got in the way of the PCB and 2 of them broke off instantly. So I had to remove them all. The Fuser is springloaded and 1.5mm PCBs (64mil) are no problem for it.

Unfortunately the toner transfer process seems more intricate than expected and is not as easy as displayed on some websites out there. The copper surface needs some special treatment and I don't have mastered that apparently (yes I scrub it, clean it, degrease it, dry it and so forth). Also I need to pass the PCB through the laminator about 15 times to make the tracks stick. If I'm out of luck, the laminator doesn't get hot enough. It's plenty hot for burning my fingers though. I really don't want to mess with its temperature control circuitry, don't want to break it, already getting sick and tired of it. Oh, and it STINKS... like a motor getting way too hot. You don't want to use it in your living room.


The lines are 0.25mm wide, as well as the spacing in between (left spiral)

Compared to my dim memories of photographic transfer with a good UV box, toner transfer - to me - is much more work. Sure more chemicals involved, but NaOH is cheap, doesn't stink and once the UV timer is set properly and the amount of NaOH for the developer solution is determined, the results are basically perfect every time.

Oh waily waily, why did I ever quit using photographic transfer ? Tell me !
I definitely need severe reprimanding for that, maybe like this: spanish inquisition


Sep 11, 2008, 03:20 pm Last Edit: Sep 11, 2008, 03:21 pm by madworm Reason: 1
OK fellow readers and readeresses, I've had it with toner transfer.
I hereby declare that the type of toner transfer known to me officially sucks.

After getting in touch with the people at pulsarprofx and hacking my laminator to get hotter (and lethally smelly), the darn toner still won't stick/refuse as advertised. Going back to photographic transfer.

Don't buy GBC-H212 if you think about toner transfer. Won't work, just STINKS.

The latest matrix code can be found here


  • switched to timer1 to get more time inside the ISR
  • reorganized parts of the code
  • adapted the code to UDN2981A source driver which is hooked up to the row driving 595 shift register (display enable pin 9)

unfortunately the udn2981a seems to add some timing issues as some leds don't turn off 100% with this chip added. without it the leds switch perfectly, but cannot get as bright. when cranking up the current without the source driver, there's crosstalk...
need to get a decent DSO to see what's going on. that'll have to wait till xmas though.

latest schematic:

           |                       |                            |                      |
           |                       |                            |                      |
        row                red column          green                   blue
        select             cath. 0-7             cath. 0-7              cath. 0-7
      (row anodes)


Finally, I managed to build a prototype on perfboard. It will be done tomorrow I hope. Now it's just a minimalist arduino with lots of chips still missing.


Sep 21, 2008, 09:20 pm Last Edit: Sep 21, 2008, 09:37 pm by madworm Reason: 1
DONE... stuff like this should not be done without having a proper pcb. All the wires, just wires, heaps of wires.

latest vid: http://www.youtube.com/watch?v=CYNmS_5qc6o

Now that I've had the chance to let it run for more than just a few minutes, it's turned out that there must be a bug in the code. Only shows up after running more than just a few loops.


Sep 25, 2008, 08:06 pm Last Edit: Sep 25, 2008, 08:07 pm by madworm Reason: 1


Great work, i read the whole thread.  Did you ever figure out a good at home solution for PCB printing?



Sep 30, 2008, 06:04 pm Last Edit: Sep 30, 2008, 08:14 pm by madworm Reason: 1
Well, I know that the photographic method works. I've used it for years, till I stopped doing electronics. Thanks to arduino, I started again :-)

Some time ago I heard of this toner transfer thingy and tested it, but couldn't get it to work properly with _my_ equipment. I don't claim it cannot work, but I'm just so fed up with it. The crucial point here is to get the "right" amount of heat with the "right" amount of pressure, which I couldn't get. Not even with a laminator. Seems like a lot of guesswork to me. I just wanted it to work 100%, so no redrawing of bad lines with a pen and stuff like that. But apparently there's lots of people who've managed to get good results with it.

So if you want to try it, give it a shot. But before you spend 100s of your favourite money unit on a laminator and supplies, better find s.o. who's had success with it to share his knowledge. Preferably within driving distance.

Now I've got a good excuse for another project: UV LED exposure unit  ;D

p.s.: The schematic I've posted before contains an error. The caps @ the quartz are 22pF not 22nF !


Hey i just got a sparkfun 8x8 rgb matrix and tried out the code at the top of the page im wondering whitch parts effect each element of the matrix my intent is to control 2x2 squares of the matrix individualy any imput would be greatly appreciated


Oct 24, 2008, 06:57 am Last Edit: Oct 24, 2008, 06:58 am by madworm Reason: 1
Hmm. That code is a bit old I guess. The latest incarnation of it can be found on my blog.

Ok aside from the innermost workings the color for each led is stored in an array. One for red, green and blue.

The interrupt routine (ISR) permanently scans the array and updates the leds in the background. To get the colors to mix in shades each led and single color is also controlled by pulse width modulation (switching it on/off very fast, but with different on/off times).

I've added some functions to set single leds, rows and columns and so forth to a given color value. Either in RGB or HSV color space. HSV is good for rainbow effects :-)


Code: [Select]


rgb: 0-255
hue: 0-360

Using these basic functions you can set any pattern you like.
The color mixing takes a lot of cpu time though, so refresh rates of the whole matrix won't be good for fast stuff.


hey  uploaded the program from your website and connected pins
13 to sck
12 to do
11 to di
10 to cs
and 9 to 5v and it gives me a slow fading light on column 1  in a dim orange that blinks 3 times then stops for a long time and repeats and wont do anything else
i also acceidentaly found that if i run 5v into icsp pin1 a bright orange light will quickly scroll across the board twice then rapidly blink in red and blue  all over the board
i dont know if either of these things are what the program should be doing or if its not where i pluged in wrong to rectify the problems
again any help would be greatly appreciated

Go Up