I had several 8x8 LED matrices with a MAX7219 driver board lying around for a clock/message board project i'm working on.  I'm heading to RobotFest in MD this weekend with my kid and thought it'd be fun to make a wearable message board to clip on my backpack since I had the parts lying around.


Time to build: 4-6 hrs
Cost: $20-$30 depending on parts and how much stuff you have laying around and if you want to make it bluetooth enabled.

I am using a bluetooth module I have for another robotics project that was very simple to integrate, and I wanted to build my first stand-alone  ATmega328 project instead of doing everything on an arduino all the time.
This project is fairly simple and inexpensive.  The "MAX7219 8x8 LED matrix kit" boards can be found on ebay for as low as $2.70 with free shipping, ATmega's with the arduino bootloader are about $4, the capacitors and oscillators are only a 10-50 cents per part if you buy a bunch at a time.  The bluetooth module is more expensive but i am using a much more expensive model than what is really required for the project.  You can do the same thing with a cheaper version that is only around $8.  Or leave out the bluetooth all together and just run a pre-set series of animations or text.

(estimated costs in USD)
1 x ATmega328P-PU ($4)
1 x 28 Pin DIP IC Socket ($0.20)
1 x 16Mhz Crystal Oscillator ($0.50)
2 x 22 pF capacitors ($0.20)
1 x Bluetooth Module ($8-30)
1 x 8x8 MAX7219 LED Matrix board kit ($3)
1 x 3AA Battery Holder ($2.50)
3 x AA batteries ($3)
1 x piece of breadboard ($2.50)
Total: $24 -  $46

Various header pins (male and female), hookup wire, solder, some kind of enclosure, Arduino for programming the ATmega328

Soldering iron, dremel for enclosure


Step 1: Prototype Circuit

It is recommended to prototype every project on a breadboard before soldering everything on a board.  This project is no exception.  I had no problems going from my prototype to my breadboard and it actually made development much easier because I had enough parts to keep the prototype in-tact and then use it for programming on a full arduino so i didn't have to keep re-burning my ATmega over and over.  (I really need to get an FTDI programmer for future projects.)  

The included schematic is SIMILAR to what you'll be building.  I couldn't find a fritzing part for the led matrix i used so i just grabbed a sparkfun one but it actually is a 3 color display instead of a single color matrix like i'm using.

I didn't bother adding the reset button, or the led's etc because i was just popping the chip out of the arduino and dropping it right onto a DIP socket.  This is the EASIEST (and laziest) way of transferring an arduino project to your own PCB.  If you want to do this the right way, you'll add an ftdi header and also probably want at least a reset button in case you need it.

Reference materials:
study these and you'll know just what to do...
Arduino to Breadboard
Arduino Standalone
ATmega pinout 

Based on reference above:
- Put your ATmega on your breadboard first.
- Add the oscillator to the board between pins 9 and 10 of the ATmega (be sure to note which way the chip is facing so you don't put them on the wrong pins)
- Place your capacitors between the pins of the oscillator and the ground line of the breadboard
- Run lines from the VCC and AVCC pins on the ATmega into the positive lines of the breadboard
- Run the 2 ground pins from the ATmega into the ground lines of the breadboard
- Plug in your battery holder (without batteries) to the positive and ground lines of the breadboard

As of now you have a fully functioning standalone arduino.  If you burn an arduino sketch to this board it should function exactly like the arduino did.  You can try it with a blink sketch to be sure everything is working correctly.  Just load blink onto the chip then add it back onto the breadboard and attach an led with resistor up to pin 13.  LINK TO BLINK 
NOTE:  You may need to burn the bootloader If your atmega doesn't already have the arduino bootloader on it, you may have to burn a bootloader onto it. You'll know you have to do this if arduino gives you a message like "avrdude: stk500_getsync(): not in sync:..."  This can be done using an arduino and you can just follow the instructions on the arduino site.  

Now onto our project...
- Add a presoldered 8x8 LED matrix on MAX7219 board to the circuit with the inputs into the breadboard (mine have 5 input pins and 5 output pins)
- Run a jumper between the positive line on the breadboard and the VCC pin of the 8x8 Matrix board
- Run a jumper between the ground line and the GND pin of the 8x8 Matrix board
- Run a jumper from D10 of the Atmega and CS of the 8x8 Matrix Board
- Run a jumper from D13 of the ATmega (SCK) and the CLK pin of the 8x8 Matrix Board
- Run a jumper from D11 of the ATmega (MOSI) and the DIN of the 8x8 Matrix Board
(look at this reference for explanation of SPI)

You can also now add a bluetooth module if you want to use bluetooth to update the messages.  I used an Adafruit BlueFruit EZlink but like i said before, they're a little pricey especially for this.  

Attach the bluetooth module and connect VCC and GND.  Then run TX to RX and RX to TX on your breadboard and bluetooth module.  TX=transmit (pin 3 on the atmega, RX=Recieve (pin 2 on the atmega).  So what is transmitted to the bluetooth needs to be recieved by the ATmega and vice versa.  BE SURE TO REFERENCE YOUR PINOUT on the atmega datasheet to make sure all your pins are correctly attached. 

You can now test your build by burning the included arduino sketch onto the chip and popping it back on the breadboard.  If everything went well you'll have a series of several icons i put on there showing up in sequence and looping.
 If you have the bluetooth module on it... install Bluetooth Serial Controller on your android.  Go into the terminal view and send a text string to the device. It should start a ticker rolling of the text you just sent.  you can start the animations again by sending the string "ani" (without quotes).

<p>Hello,</p><p>So i modified your code a little bit for my own application. But how can i send bitmaps to a second matrix? Id really like to see it work so i can make 8x16 animations. </p><p>also here is a cool little animation.:</p><p>void spaceinvader() {<br> <br> memset(mBitmap,0,sizeof(mBitmap));<br> aniFrames=2;<br> int wait =300;<br> mBitmap[0]=B00011000;<br> mBitmap[1]=B00111100;<br> mBitmap[2]=B01111110;<br> mBitmap[3]=B11011011;<br> mBitmap[4]=B11111111;<br> mBitmap[5]=B01011010;<br> mBitmap[6]=B10000001;<br> mBitmap[7]=B01000010;<br> <br> mBitmap[8]=B00011000;<br> mBitmap[9]=B00111100;<br> mBitmap[10]=B01111110;<br> mBitmap[11]=B11011011;<br> mBitmap[12]=B11111111;<br> mBitmap[13]=B00100100;<br> mBitmap[14]=B01011010;<br> mBitmap[15]=B10100101;<br><br> dBitmap();<br>}</p>
<p>Greetings most15,</p><p>Your instructions on instructables was a good one as I'm new to arduino.</p><p>I did stumble on the code though after downloading the necessary and including #include &lt;Adafruit_HEX.h&gt; </p><p>#include &lt;Max72xxPanel.h&gt;</p><p>and try to verify Snake in the Arduino 1.0.5 sketch window it stopped @</p><p>Max72xxPanel matrix = Maxx722xxPanel (pinCS, numberofHorizontalDisplays, numberofVerticalDisplays);</p><p>The error window shows 'Max72xxPanel' does not name a type also</p><p>inside window shows snake:9 error 'Max72xxPanel' does not name type</p><p>snake.for: In function 'void setup'():</p><p>snake:20: error: 'matrix' was not declared in scope</p><p>snake.pre: In function 'void loop()':</p><p>snake:47 error: 'matrix' was not declared in this scope</p><p>If you can decipher this please help, I am using Max7219 matrixes.</p><p>Kind regards</p><p>Jaffa</p>
<p>it looks like you have a typo on the line where you're initializing the panel. your code says max722xxpanel(...). should be max72xx instead. </p>
<p>corrected the typos but still no joy,still getting error message of the matrix not being declared in void seup. Don't want to give up on this one because it's a real cool gadget if working...........Any ideas could it be something missing from downloading the Max72xxPanel.h zip file?</p>
<p>you ALSO need the adafruit gfx library. and make sure your libraries are in the right location. I think I'm the arduino ide under settings you can specify a folder to use, or put them in the default libraries location. http://www.arduino.cc/en/Hacking/Libraries</p>
<p>if you can padte your full code in here I can take a look. or copy and paste this code http://matthewroy.com/WearableMessageBoard/WearableMSGv1.ino</p>
<p>Thanks for speedy reply I will scrutinize my coding more closely when I next fire up my sketch and let you know if it repaired the issue</p><p>Thanks</p>
<p>Sorry correction on your name mroy15</p>

About This Instructable


68 favorites


More by bluesthue: Pallet Wood Derby Cars (almost free) Wearable Message Board
Add instructable to: