I need help with my daughter's Lilypad project with LEDs

tl;dr: Can you help review my circuit and offer guidance on batteries, components, and approach? I have LEDs that are dimming unreliably on the breadboard prototype.

Backstory:

I bought a Kepler kit to work through some projects with my daughter and we've been enjoying ourselves. But after we successfully turned some LEDs on and off the first afternoon I mentioned that there are sewable boards and that we could sew some lights on her backpack and she got super excited. We planned out some letters with ~3-5 LEDs each and I went ahead and purchased a Lilypad and a bunch of the sewable LEDs (some name brand, some off brand from Amazon), conductive thread, etc.

I prototyped it on a Rasp Pi Pico W with a single LED per pin per letter and wrote code to flash them in fun patterns, leave them all on for a while, etc. I wrote the same stuff on the Lilypad USB Plus and it works with the LEDs on the integrated Protosnap Plus fine. She's excited!

But before unsnapping everything and starting to sew I did some more prototyping on a breadboard. At some point I realized that 5 LEDs x 4 letters is a lot of LEDs for the microcontroller. I don't think I fried anything, although there is a lingering smell of something that I'm sure everyone here is familiar with.

I realized we'll need some more power for the LEDs and not try to power 5 LEDs per GPIO pin when sometimes ~20 would be on simultaneously. I recalled some electronics from playing with this stuff a decade ago when she was a baby and remembered that a transistor could act as a switch. There's a few in the kit we bought so I stumbled through creating a circuit. ChatGPT helped. Or not. It works sort of.

Here's the diagram as I understand what I built, for one letter:

circuit-2

The LEDs are the Lilypad style ones with integrated resistors, so I think they need wired in parallel as I did. (Specifically I am prototyping with these off brand ones.)

Right now both power sources are a single CR2032 cell battery.

Right now I've wired up three GPIO pins to a single LED and resistor for the first three letters, and then the above circuit with 5 blue sewable LEDs on a fourth GPIO pin for the fourth letter. I blink them on one at a time and it seems to work. But then I blink them all together and after that I leave them all on. When they're all on the blue LEDs start to dim and then they go out, and then they don't work anymore — not broken, after I turn the power to the chip off and on again, they work again but fade as before.

My most general question is: Do you have any advice for this project?

More specific questions are:

  1. Is this general approach with external power for LEDs controlled by the GPIO to the base of a transistor as a switch feasible?
  2. Is there a better approach I should be taking instead?
  3. Do you have a recommendation for power supplies? My instinct is that a single CR2032 is enough to power the Lilypad, but that something else should power the arrays of LEDs.
  4. Is the LED dimming I'm observing on the breadboard likely to be from battery issues?

Thank you for any help and guidance you can provide!

Ian

circuit-2

To start with:

  • Both batteries are connected backwards.

  • The battery on Vin would need to be at least 7-9V.

  • The LED battery will probably have to be a higher voltage as a fresh CR2032 is only 3V.

  • The LED transistor should be common emitter configuration.

You might consider using high current batteries, AA.

Two will give you 3v, three 4.5v, four 6v

Also, a Boost/Buck converter will squeeze every last electron out of the batteries :wink:

It appears you are turning on all the LEDs at once. If this is so look at multiplexing them to lower the current required. Blue LEDs take a higher voltage to turn on. The load is probably affecting the voltage output of a CR2032.

The emitter follower transistor configuration you chose, loses about 0.7 drive volts. Change the common collector to a common emitter configuration.

Okay, thank you all! There was a lot of concrete advice for me to Google and learn about.

I've looked up common emitter and swapped the circuit around. (I also fixed my diagram's battery orientations to be accurate.) Just with that change I don't notice any dimming going on.

circuit-4

I didn't even think about looking up Vin requirements or that they would be different than just the 3V out on a GPIO pin. I've looked it up and I think the recommendation for Lilypad USB Plus is a 3.7V battery or the 3V coin cell battery, and the accepted input range is 1.8V - 5.5V. They sell little sewable coin holders with an on/off switch so as long as that seems to work I think I'll stick with it.

I'll need to buy some more transistors to finish out the prototype fully, but then I think we might be ready to sew.

I appreciate all the help!

Ian

1 Like

Excellent! If you want to have some fun, connect to a PWM pin and then you can control dimming with analogWrite().

I spent a rough evening trying to remember how to solder and then it took about 10 hours of sewing, but I got the project done and my daughter is thrilled!

I just wanted to pop back by to say thank you again and show you the end results.

Video: Imgur: The magic of the Internet

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.