Wearables - Driving 24 LEDs from LilyPad - help, please!

Hi! My wife and I are working on a wearables project in which we’ll need to drive up to 24 [LilyPad Micro LEDs, individually addressable, from a [LilyPad 328 main board. The LEDs will be sewn into a garment with conductive thread, no more than 18" or so away from the main board. They are not in a matrix, nor are we able to wire them up in any complex way like charlieplexing. The garment lies flat against the wearer, so any circuitry in the project needs to be pretty low-profile, free of pointy bits that’d poke the wearer.

It seems clear that we’ll need shift registers or some other kind of controller, as there are more LEDs than we have output pins. I have lots of 74HC595N DIPs here already.

We could really use some advice on these questions:

  1. Is the 74HC595 the best choice for this project? If not, what should we use instead?

  2. How do we mount the shift registers (or whatever we use) so they can be easily connected to the threads coming from the LEDs? I have small PC prototyping boards, but I don’t know how to deal with connecting so many uninsulated threads to them. I’ve ordered a [LilyPad Protoboard but it seems like I’d need more than one of them…?

  3. Can we drive all 24 Micro LEDs through 3 shift registers by connecting the 5V pin from the LilyPad to the Vcc pins on the 75HC595, and connecting the LEDs to the 75HC595’s output pins? Or do we need separate power for the shift registers?

  4. Will a CR2032 coin cell work as a power supply for the LilyPad and/or shift registers? If not, what do we need to use, and roughly how long will it last if the LEDs are off most of the time, but occasionally “winking” in various patterns?

  5. We’d like to have a “master” brightness control for the project under software control, if possible. I have a [10K Digital Potentiometer on order – would that be appropriate, and if so, where would it go in the circuit?

I have plenty of coding experience, but neither of us are skilled in electronics. I’m able to solder and follow instructions, and have been working through lots of tutorials, but circuit design and power issues are a stretch for me. We’d really appreciate any help the SparkFun community can offer here, as we only have a couple more weeks to finish the project.

Thanks very much in advance!](Digital Potentiometer - 10K - COM-10613 - SparkFun Electronics)](LilyPad Protoboard Large - DEV-09101 - SparkFun Electronics)](https://www.sparkfun.com/products/9266)](https://www.sparkfun.com/products/10081)

While you can drive 24 LP uLEDs from just 3 of the '595s, you can’t drive them all on at the same time, unless the current through each is less than the usual 15-20 mA. Each pin of the '595 can source or sink (I recommend you do the latter) the 20 mA but the current through the '595’s Vcc or GND pin is limited to 70 mA max. Meaning 3-5 uLEDs on at any single time at the usual current draw. You should also expect that at any reasonable current draw the '595 will lose ~0.25v. Which leads to wiring and battery/supply voltage.

The LP uLEDs have a 100 ohm resistor on the board w/the actual LED. The uLED you linked to has a Vf of ~2.8v @ 5 ma, ~3.0v @ 10 mA and ~3.3v @ 20 mA. So you need at least 2.8v at the LED itself to get 5 mA flowing through it. 5 mA * 100 ohms = 0.5v, meaning 2.8 + 0.5 = 3.3v at the LP uLED contacts. Add in another 0.25v for loss in the '595 and you need a minimum of 3.55v from the battery to get the desired brightness. And if you’re using conductive thread, that adds in more resistance in series and increases the needed battery voltage. A single CR2032 is nominally 3.0v and that’s obviously not enough. Two of them stacked in series would give you a nominal 6v which might sound like more than enough (or just right depending on the length of thread used) but CR2032s aren’t really made to supply the current levels you’d likely see. At 28 mA each battery would lose ~0.4v and I’ll guess your average current draw would be > 28 mA. A small LiPo battery might be almost as easy to hide/wear and should mitigate the voltage droop problem, at least on the battery side. A lot depends on how bright the uLEDs need to be and how many are on, on average, at any one time.

As far as a brightness control, yes a 10k pot should work. You’d connect it’s ‘output’ to an analog input and read the voltage as is done in this tutorial.

http://arduino.cc/en/Tutorial/ReadAnalogVoltage

The method used to actually dim the uLEDs would be similar to PWM technique used here, but since you’ll be using shift registers you won’t use a PWM pin and analogWrite().

http://arduino.cc/en/Tutorial/Fading

As far as protoboards go, 1 1/2 of these (split into halves) might be easier to use and to hide.

http://www.radioshack.com/product/index … Id=2103799

https://www.sparkfun.com/datasheets/Dev … 6QWF-D.pdf

https://www.sparkfun.com/datasheets/Dev … ad-LED.pdf

https://www.sparkfun.com/datasheets/IC/SN74HC595.pdf

http://data.energizer.com/PDFs/cr2032.pdf