Need help with project - LEDs and SD

Hello. I am a computer programmer, though I haven’t done low level programming in some time. The software side I think I know what to do. It’s the hardware side I am having trouble with.

So, let’s start with what I want my project to do. I want to do some custom lighting on my motorcycle. I would like to put a bunch of LEDs organized around the bike. I want to be able to create custom animations, one being a VU meter that will connect into the stereo/ipod. The LEDs will be RGB.

I’ve been looking at different solutions to this. The arduino seems like it might do what I want and be economical. I saw that you can control many LEDs using daisy chained TLC5940 chips. I was wondering what the max number of tlc chips that could be used.

While researching the arduino I saw someone that interfaced with an SD card. That could be useful. I would like to have a fat formated SD card that I can put animation information on, assuming I use the tlc chips that has an animation function. It would seem the SD card and tlc chips would want to use the same pins on the arduino, is that going to be a problem? Can that be changed? Also I am a little confused on how to read from the sd card. I would want to populate the card with individual files for each animation. Would that be possible?

As an add on I might get a3 or 4 channel rf remote. Buttons would be on/off, animation change, and color change. Certain animations will use a solid color that can be changed. Some animation will use their own colors. I was thinking of one animation that the entire bike would be lit up with half brightness with a full brightness spot rotating around the bike.

My bike has a fairing so the electronics can be in there safe from weather. The bike should provide 12v-14v DC of power which should be fine, correct?

I am looking for suggestions on how to accomplish this idea. Thanks.

I think with research on several posts around here that all you are contemplating is possible with an Arduino. Unfortunately it’s hard to respond in details to all your wanted features, but I will comment on a few topics.

First, an SD storage option has several ways to go. Some SD modules just supply a raw interface to an Arduino and all the SD function code is performed in the Arduino. These can be a little cheaper and there are Arduino software libraries available to use. However it can become somewhat hard to handle that and all the other tasks you want to accomplish both from a speed and memory capacity point of view. Another route is to utilize a ‘smart’ type SD module that has it’s own processor chip and communicates with the Arduino Via simple serial or I2C communications commands. That places less of a software and hardware burden on the Arduino freeing up for handling your display and remote functions. Here is just one example of such a ‘smart’ SD module from SparkFun people. It can work either in raw 512 byte read/write mode or use the FAT16 file method, which would allow you to create the files on a PC.

Also while your bike’s 12vdc power will work with the Arduino you do need to take care that proper filtering and voltage clamping components are used as a bike or car can be a pretty electrically hostile environment.

Not sure how many TLC5940 chips you can wire in series but I’m sure it many more then you would have to worry about.

Good luck with your project. Take it a feature at a time and test each feature and function separately rather then try and write and troubleshoot it all at once. Also prototyping on a breadboard will save time in the long run to get all the hardware functioning before packaging it into the bike.

Lefty

Yes, I will take it one step at a time. The first step is to get an adruino and some tlc chips. At minimum I can get basic lighting on the bike a I go through each step. Putting the SD card on will be one of the last features. Right now I am more interested in just sequencing the lights and having a remote to control it. Then I would like VU meter interactivity. I plan on having the VU meter on the edge of my windshield. I am going to get my windshield etched with a wolf track pattern across the bottom. So the leds on the side of the windshield will light that up. The SD card is just a luxury. If I can easily swap out animation information it would be nice.

As for power if there is a way to get smooth power I am all ears. Here is my plan for power. LEDs don’t take up much power, probably even with the adruino. But if I am at a bike show for a couple of hours I don’t want my battery to be drained to the point it won’t start the bike. So I am going to do a little trick used with boats that want trolling motors to run while the boat is turned off. This product along with a small pocketbike battery that will be dedicated to to lighting system - properly fused and such of course. It depends on what I have room for. It depends on how I lay out everything on the bike.

I don’t think I need many LEDs. But if they are RBG that means I need 3 times as many TLC chips as a solid color. I am thinking 4 along each side, 2 on each side in the rear fender, 2 on each side under the tank lighting up the engine, 2 one each side in front fender, then the 10 for the 6 led stereo windshield VU meter. That’s 32 leds organized in an ideal fashion for tlc chip placement. Since it is easy to daisy chain them one set of tlcs will be under the tank handling the 16 LEDs in the center and rear of the bike. The other set of tlcs can handle the 16 LEDs on the front.

So the question is would 6 be too many? I’m not sure how the chips work, if there are code limits and physical limits. Or is there an alternative?

I am a software guy, but I can read a schematic. I do light electronics as a hobby. I’ve built several stomp boxes for my bass guitar. I can follow the instruction, but I don’t have the knowledge to modify a circuit much.

Is there a good article on debugging the code?

http://www.arduino.cc/playground/Main/UsbMemory

That is a possibility for storing files.

I think I will have two arduinos. They aren’t expensive. One for the VU meter display. The other for the led accent lighting.

I think I will have two arduinos. They aren’t expensive. One for the VU meter display. The other for the led accent lighting.

Keep in mind that you don’t always have to use a full Arduino board once you have the program working. A programmed chip can be removed from it’s socket on the Arduino board and then either be transferred to a minimum support board or even built onto a small perf board. A programmed chip only needs a 16mhz resonator and a pull up resistor for the reset pin, a 5vdc regulator chip and a couple of filter and bypass capacitor, probably $10 in parts. Then a new AVR chip with a installed Arduino bootloader can be purchased for around $7 or so. Just an option to learn about.

Lefty

I would want a voltage regulator like this for a stable power supply?

Would it be better to ask these question in one of the other forums?

http://elm-chan.org/fsw/ff/00index_p.html

That should work to read a fat filesystem?

If you want simplicity and a library that’s ready to go, you could try our product:

Rogue Robotics uMMC Serial Data Module

It’s a serially controlled, SD card module that can communicate up to 460800 bps. It accepts SDHC cards too (up to 32GB).

I’ve written a library for the Arduino already - I’m still flushing out the documentation:

Arduino uMMC Library

I’ll bet dollars to donuts that it will make your life much easier. If you need any help with writing code with the library, let me know.

You can get one from: Robotshop US, or from one of our other distributors: uMMC distributors

b

The code looks almost like normal C file handling. That should work. I don;t see functions to view files in a folder though.

Working on that… the functions are available on the hardware, just haven’t been written into the library yet.

Let me know what you need exactly, and I can whip that together quick like.

b

My plan is to just dump a file with animation info in it. As I come up with more animations I will just drop them onto the SD card. The code will need to see how many files are on the drive and access them. When I press the mode change button it will load the next file in the list, that type of thing.

So basics I need to list files available and read the files.

I was talking to a friend about this idea. Since we see you can put a basic web server on the arduino I might get a small used 802.11b router and create a webpage that anyone can control the color and modes. When we go to a show we’d take bets on what color and modes the bike would end up on ;D

I added the file listing commands: opendir(), filecount(), readdir()

uMMC_example2 demonstrates how to do the file listing.

b

That looks good. It looks like it supports folders as well. Good job. I will be looking forward to when I order this :slight_smile: