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
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.
study these and you'll know just what to do...
Arduino to Breadboard
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).