Introduction: Flames Effect With a 8x8 LED Matrix and ATMega328
With help from a friend, Uriel Guy, we managed to figure out how to make it work. Well, actually, Uriel did most of the work… including of cleaning up the code, modifying it to work with Arduino, and optimize it. I’m just writing the instructable because he got lazy :-)
By the way - the code itself is a piece of art. Check it out if you want to see how to implement 16 levels of red using the dot matrix.
Step 1: Materials
- ATMega328
- 8x8 LED matrix. I used the 38mm x 38mm (see the comments below)
- Metal pins
- 10k ohm resistor
- 100uF capacitor
- 2 x 22pf Capacitor
- 16 MHz crystal
- AVR programmer
- Soldering iron and assorted accessories
- Power source. I used 2 x CR2032 cell batteries connected in series
Step 2: Getting Everything Ready + Testing
We will start by putting everything together on a breadboard, just to make sure you got all the parts working. To make life easier, we left the pins required for programming free.
You should first place the "Arduino" parts (ATMega, crystal, etc) and try a blink example (sorry, but I won’t cover this part in this Instructable).
After you got the example to work, hook up the matrix and load the code using Arduino IDE (or whatever IDE you are using). Make sure you got Pin #1 of the matrix in the right place (as shown on my lovely sketch).
Is it working? Great. Time to do some soldering.
Attachments
Step 3: Soldering
A little bit of warning now – this part can get really confusing, so read carefully. We actually got everything soldered the wrong way on the first attempt… and it was a pain to take apart.
The first thing you should do is to solder “extensions” to the legs of the matrix because they are not long enough to reach the legs of the ATMega. Don’t worry if the extensions are too long – you can always shorten them with your trusty cutter.
Bend down all the legs of the ATMega that goes to the matrix. You need to do this anyway, and it will make it easier to figure out the correct orientation.
Now for the tricky part - put the matrix with the leds facing DOWN. Pin #1 of the matrix should be on the upper left corner. Place the ATMega in the middle of the matrix, facing DOWN as well. ATMega pin #1 (reset) is the upper left pin. You might want to flip the ATMega pin mapping image so you won’t get confused. Seriously, this can get confusing. If you are not sure – look at the photos I placed here.
Bend the matrix legs (with the extensions) so they touch the correct ATMega pins and solder them. If some of the legs are too long, just use a cutter to shorten them.
Using a piece of wire, connect VCC to AVCC (#7 to # 20).
Solder the resistor from pin #1 to the VCC pin.
Solder GND to GND (#8 to #22). As you can see in my photos, I used a longer wire here.
Solder the crystal and 22pf capacitors.
Solder the 100uF capacitor.
Connect VCC and GND to a power source.
Done!
What about the cool wooden frame, you ask? It will have to wait for another Instructable. I am still working on that :)

Participated in the
Epilog Challenge V
30 Comments
8 years ago on Introduction
Hey there, I am really interested in getting into Micro controller based projects.
I asked around on Reddit and it turns out the Arduino Nano can be used in place of the ATMega328 (I have next to little knowledge with Arduinos)
I was wondering if you could help me with the wiring to the Nano? The Nano has D2-13 but I'm not sure what the other pin outs are, such as A0-7
I'd really appreciate if you could give me a hand as I'd adore it if I could make this Instructable to get myself into Arduinos and programming
8 years ago on Introduction
8 years ago
no resistor needed for row or column dot matrix ?
8 years ago on Introduction
i know this is a year old, but have you updated your code to be used with the MAX7219 chip?
Reply 8 years ago on Introduction
nope. never worked with the MAX7219. But you are welcomed to try :)
10 years ago
Thanks for the quick response! I'll have to give it a shot! Any good resources I should be aware of in terms of creating that flame affect? I've started to mess around with writing individual bmp's but can't shake the feeling there's an easier way to go about it.
10 years ago
Any ideas on wether or not this code could work with an 8x8 matin backpack from adafruit? It's so awesome I would love to replicate it!
Reply 10 years ago on Introduction
I am not sure whether it will work. I think that Adafruit's backpack only allow you you to turn the LEDs on and off (but no gradient). I actually bought one an Adafruit matrix to try it out, but never found the time to actually do it :)
10 years ago
I wanna make an arch, and I wanna put these LED displays. Can someone do an instructable! Or gear me in the direction of how to program multiple Boxes. maybe what the easiest book of instruction is for programming these LeDs? Or something!!! Thanks
10 years ago on Introduction
Hello.
PLS. I use different matrix too:
(http://www.ebay.com/itm/170667263843?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649),
but not work-(all leds is on and sometimes flash) - I try more connecting but with same result. (I trying googled, of course)
Can You help me pls? How to change wires or code?
Thanks.
Reply 10 years ago on Introduction
I have same problem.Just swap rows with columns - Arduin Pin:PB1 to Matrix Pin: 13 , Arduin Pin:PC2 to Matrix Pin:9 and so on.
Reply 10 years ago on Introduction
Matrix Pin: 13 3 4 10 6 11 15 16
Arduin Pin: PB1 PC3 PB0 PC1 PD0 PD7 PD1 PD5
Matrix Pin: 9 14 8 12 1 7 2 5
Arduin Pin: PC2 PD2 PD3 PB2 PD6 PC0 PC4 PC5
10 years ago on Introduction
Could you possibly point me (on ebay) in the direction of the 'avr programmer' i need, and maybe even a tutorial somewhere on how to program up that chip. Very new to this, eager to learn. Thanks.
Reply 10 years ago on Introduction
You can either use an Arduino as an avr programmer (Google it... I haven't tried it) or get a USBTinyISP from ebay (see how to use it here - https://www.instructables.com/id/Atmega-Programming-with-USBtinyISP-and-Arduino/)
If you are going for the USBTinyISP, just search for it on ebay, there are plenty of them there. I also recommend you get one of these adapters, they come in handy (and save you time when you first try to figure out the wiring) - http://www.ebay.com.au/itm/10PIN-6PIN-ISP-Adapter-to-breadboard-for-Atmel-AVR-ISP-/121083178910?pt=US_Audio_Cables_Adapters&hash=item1c311eaf9e
10 years ago
I used a different model matrix and had to switch some wires but it works great! It definitely looks better when diffused.
10 years ago on Step 2
I would put resistors in series with the leds to limit the current. Sure, there is some internal resistance in the led matrix, atmega, battery, etc. but it's not reliable.
Other than that nice project :)
10 years ago on Step 3
Why not save the crystal as timing on this is not that important, and set the chip to internal RC oscillator. Still I like this. Also maybe port this to an ATtiny 84 to cut cost more.
Reply 10 years ago on Introduction
It should be possible switch to the internal oscillator, haven't tried it. You can't use ATtiny 84 though (unless you add more components) - you'll need something with enough pins to match the pins on the matrix. Maybe an ATMega8.
Reply 10 years ago on Introduction
Yes, after writing I realized that, and to add another chip to this negates the cost saving. Looks the mega 328 is best here. Thanks for the share of this..
10 years ago on Introduction
It looks like there is something going on with the 4 LEDs in the upper left.