I have a new project I am working on and I would like to verify that my plan is sound. I am a programmer so when it comes to the code side of things I have no problem. But on the hardware side I need to make sure I am understanding things correctly.
I am going to make some animated LEDs. I plan on using three TLC5947 chips to control 24 rgb leds. I have the arduino communicating with the tlcs and doing some basic animations (solid color, fading, and random). I have a 4 button wireless remote I am using to cycle through colors and animations. Now I want to go to the next level.
I have been using a bare bone kit because the container I can put the arduino in is not very wide. the next step is I want to have frame based animation. The simple animations can be done in code, but others that I want to do will be easier if I can specify frames and delays.
So my idea for this, due to the arduino memory limitations, is to store the frame based animations on a microsd card. the file format will be simple. The first two bytes contain the number of frames and some 1 bit flags. The next section of bytes is one byte per frame specifying how long the frame will display in milliseconds. the rest of the file will be the frames. I have two formats either one byte per led or 3 bytes per led (one of the flags will determine this).
With the 1k of memory the arduino hs that isn't enough to store animations more than about 30 frames int he worst case scenario. So I need alternate storage. After reading this blog I think I can figure out how to read and write from the 25AA512 chip. 64kbytes should be plenty of space.
The idea then is when I switch animation it will load the animations file into the eeprom at address 0. I can store address 2 for the beginning of the delays array. Then calculate and store the address of the beginning of the frames. I can make a c++ class to make this easy to use. A function that does simple array calculations to get a specific led on a specific frame should be easy.
The next step I want to include wifi so I can control the LEDs with my ipod touch. I am thinking about getting the new Yellow Jacket from AsyncLabs. What would be awesome is if they released wishield 2.0 they release a new Yellow jacket that has that serial flash chip. I would get a wishield but it is too wide for the container I am going to use.
What would be icing on the cake is if I can have music modes included. Have the leds animate to music. I have a couple of ideas for this, but it would require taking audio input and splitting it into lows, mids, and highs. This I am not sure how to do.
So, the pins needed on the arduino: The tlc5947 needs 4, I am not sure if any can be shared with other pins, but I doubt. The eeprom, microsd, and wifi use spi, so those need the 3 spi pins and one cs pin per device - so 6 more pins. Though the wishield uses pin 2 as an interrupt also, correct? If I keep the 4 button remote (don't have my ipod handy) that is 4 more pins.
That's a total of 11. That means I would have to use a couple of the analog pins as though they were digital. that also would leave me at least 3 analog pins to dot he music mode if I get that far.
Is there anything I missed, didn't think of?
Oh yeah, power. The power source is going to be a 12v scooter battery. Why? Because they are cheap, small (3"x3"x4"), have plenty of mah, and easily recharged with a car battery charger. The LEDs I am using are designed for automotive use. They come on strips that can be cut every 3 LEDs and take a 12v source. I believe everything else can operate at 5v so a voltages regulator that has enough amps should suffice.
For wifi access later on I am thinking about providing a WAP that will automatically forward connecting devices to the arduino web server. A Fonera router can run on 3.3v (or 5v if you don't bypass the internal regulator) and is supported by OpenWRT and DD-WRT. So having it do HTTP redirects should be easy and running from a battery pack should work well. Doing this will allow anyone with a wifi device to control the project without needing to know the IP of the arduino - which would be a cool experiment.
Edit: forgot the microsd when counting up pins - added.