This has all the steps you need to get your creations up and running. But first, the code for my program can be found here: http://dl.dropbox.com/u/16309910/test.ino or search for me on github: j-fray or clone it using https://j-fray@github.com/j-fray/Arduino---Simulating-bead-sort.git
There are also some pictures of the schematics which you can find here:
Imput layer: http://dl.dropbox.com/u/16309910/inputlayer.png
Output layer: http://dl.dropbox.com/u/16309910/outputlayer.png
Power layer: http://dl.dropbox.com/u/16309910/powerlayer.png
I will upload any remaining documents to my github as listed above.
Now obviously this program is meant for 6 matrices, but it should be pretty straight forward to alter it for any number of matrices.
Step 1 - Setup
A good place to start is to get one matrix up and running. You need 3 pins on your Arduino board, one for data, one for clock and one for load pins. With the MAX7219 these correspond to pins 1, 13 and 12 respectively on the shift register. Put the shift register on a breadboard and connect these up.
Then its time to connect the ground and power pins up. The ground pins on the 7219 are 4 and 9, the power pins are 18 and 19 (check the link to the schematic in part 1). Pin 18 needs to be connected to a 40KOhm resistor (or equivalent combinations) and then connected to the power supply.
Arduino boards in general have a 5V output and that's what I used, just make sure the pins are connected in series and not in parallel.
Step 2 - Connecting to matrix
Now to start connecting up the matrix. As mentioned in part 1 the pins mappings of LED matrices vary for each make so check the datasheet of your matrix to see what pins use what. In my case pins 1 - 4 and 20-24 control the rows.13-19 control the red cols and 5-12 control the green cols.
Connect your matrix up appropriately. It is worth uploading the program to the Arduino board first and connecting the pins one at a time so that you can see the matrix working and deduce if there are any problems with a particular row.
The result should be a small sequence on the matrix.
Step 3 - Repeat
Repeat steps 1 and 2 for however many matrices you want, remember to do small bits at a time and test them. The last thing you want is to wire the whole thing and find it doesn't work or you've wired it wrong.
Here are some pictures of my creation:
Schematics
Input layer |
Output layer |
Power layer |
Common problems (I found)
Matrix kept turning off
The most common problem I had was finding the matrix would just randomly turn off and wouldn't turn back on until I reset the Arduino board. I found out this was due to the resistance of the resistor I was using. There is a handy table on selecting the value for this resistor (Rset) in the guide in part 1.
The matrix is displaying my sequence/pattern incorrectly
This is most likely due to connecting the pins up incorrectly. Remember to check the pin mappings for your matrix and whether its common cathode or anode.
My sequence will stop/freeze
This will probably be due to the delays used in the program. If its anything like mine there will be a delay at the start/end of the sequence code. Playing round with that should get it working again.
Any other problems you have you're welcome to ask me about them, but I can't guarantee I'll be able to solve your problem :)
Thanks for reading and I hope this was helpful
Jake