new Arduino + TLC5940 project ... any advice? :)

I'm about to start a multi-LED project. All my parts arrive in a few days, so at this point I'm thinking it through and would love any advice from the experts on this board... gotchas I should be aware of, etc. [I'm have medium-level experience with this stuff but haven't built anything as large as this before.]

The project: drive 48 white PWM'd LEDs via 3 TLC5940's and a battery-powered Arduino.

The LEDs I'm using are LilyPad bright white (http://www.sparkfun.com/commerce/product_info.php?products_id=8735) with inline 100ohm resistors. I'll probably use a LilyPad board although I also have a few other varieties at hand, like the ArduinoUSB and SparkFun Wee. Software's not really an issue; I've already written a test case that animates correctly with 4 LEDs using the native PWM outputs. The various online resources I've found have been incredibly helpful so I'm pretty sure I'm ready to switch to a 5940 library and do serial output instead of directly driving the LEDs on Arduino pins. I've found great docs that show how to set up a single 5940 and I think I can handle the chaining to get 3x16 = 48 separate PWM'd LEDs.

My concerns: * power usage - Can a single Arduino board power 48 LEDs? The data sheet shows them using ~20mA so that's close to an amp if all on, but my application doesn't really need more than a few to be simultaneously lit. If I do turn too many on, can I hurt the Arduino? (I've read that the 5940 has current limiting built in so it seems safe.) * power supply - I'm planning on using a few rechargeable AA's but don't know the best configuration. LilyPad requires 3.3V but the power supply (http://www.sparkfun.com/commerce/product_info.php?products_id=8466) is out of stock now and I don't know of an existing batter-powered 3.3V supply I could sub in. I'm not very familiar with regulator circuits but I suppose I can copy the LilyPad's schematics and build my own to use a few AA's in parallel? And the ArduinoUSB I have can run off of a 9V so I have that as a backup plan - the LilyPad just has a more convenient portable form factor. * pre-wired resistors on my LEDs - they're 100ohm. Is that a problem? I've typically been using 1Ks but that's on the ArduinoUSB with red LEDs. My calculations tell me 100 is perfect for a 3.3V (white) LED from a 5V source, but I don't know enough to reconcile in my head how this can still work on a 3.3V supply (both LilyPad and 5940 are 3V)

Well, those are the only concerns I can think of right now. I'm sure I'll hit some snags along the way, but the excellent tutorials produced by forum members are giving me confidence that this shouldn't be too hard...

Thanks, Steve

You won't need the resistors on your LEDs as the 5940 takes care of limiting the current for you. All you need to limit the current to 20mA is one 2k resistor between the IRef and GND pins on the 5940. Also, it doesn't matter what voltage you drive your LEDs at.

One thing to look out for:- The data sheet for the LED says that it can produce a maximum forward voltage of 4.0v, and a typical of 3V3, so you might find some won't light up if you only power them with 3v or indeed 3v3.

Here's a very similar approach.

You might want to look at this guys notes: http://www.macetech.com/blog/node/36

Thanks everyone for your input!

Re: the LED resistors, the problem is that they're embedded on the LED package so I can't easily bypass them. This particular package is perfect for the application (wearable) so I'd rather not switch to standard tailed LEDs if I don't have to. Will they be a problem? I don't yet have a 5940 I can test against but I -think- that since I'm running at the same voltage as the LED's Vf then the resistor is a non-issue?

Grumpy_Mike I see what you're saying, but it seems that these are sold as a kit with the rest of the LilyPad arduino board, which runs at ~3.3V, so I assume they're usually "typical" else there'd be more complaints :) Thanks for the heads-up though.

The project from MaceTech is very clever but I think it might be a bit beyond what I need. With only 3 5940's I'm probably safe to draw from my power pack (am I? :) ). Also, I followed up with the fellow who built it and he pointed out that the multiplexing of LEDs does dim them a bit, just as PWM would... I'd like to be able to get full brightness on a few LEDs at a time. For others who might find this topic useful, this project has been the most helpful (code & wiring diagram are both easy to understand!) http://pixelriot.com/pmatp/node/15

At this point I think the thing I'm most concerned about is the power draw, I have a few potential power sources including a regulated lithium pack that I might try... Not sure what I'm in for with this many LEDs.

Thanks again all, Steve