Controlling about 50 LEDs, discretely from a Propeller
Ken Gracey
Posts: 7,392
Hey all!
Got a friend who teaches art at a local private school. We've been slowly getting her involved in more and more electronics, from really neat mixed-media projects with movement and lights to where we are today: sewable electronics. Our first project was a huge California wall map that had various components and LEDs for each region or county (I forgot) - it's still running about eight years later. The latest request is to control about 50 to 100 LEDs that will be sewn into fabric. I'm hoping that some of you are also seamstresses so you can give me some tips. . .
Question #1: the physical setup
The physical wiring of these projects is more consuming than the programming. I'm not sure if I should use conductive thread or if we should just use wires and LEDs with built-in resistors. Considering they're all individually controlled, a bunch of home-runs could become quite rigid - and this is a stocking. Any tips?
Question #2: the electronic circuits
Next, how about a preferred circuit? Any favored shift registers or I/O expanders you'd recommend? Of course I want to use a Propeller. But I also need some really small hardware boards upon which I can build. There will be an SD card and a pushbutton somewhere.
And the bigger picture. . .several ladies in the office are now building electronic jewelry, EL clothing, and really cool stuff. I'll certainly draw from their experiences this week, but we need to make some helpful hardware for their projects at some point. Feel free to share any ideas you might have about a Propeller-based e-textile controller.
And go ahead - send me to Google if you need to. I got some thick skin and realize I can be a bit lazy. I'm also short on time [all the time] and know that these forums are loaded with the right mixture of experience.
Thanks,
Ken Gracey
Got a friend who teaches art at a local private school. We've been slowly getting her involved in more and more electronics, from really neat mixed-media projects with movement and lights to where we are today: sewable electronics. Our first project was a huge California wall map that had various components and LEDs for each region or county (I forgot) - it's still running about eight years later. The latest request is to control about 50 to 100 LEDs that will be sewn into fabric. I'm hoping that some of you are also seamstresses so you can give me some tips. . .
Question #1: the physical setup
The physical wiring of these projects is more consuming than the programming. I'm not sure if I should use conductive thread or if we should just use wires and LEDs with built-in resistors. Considering they're all individually controlled, a bunch of home-runs could become quite rigid - and this is a stocking. Any tips?
Question #2: the electronic circuits
Next, how about a preferred circuit? Any favored shift registers or I/O expanders you'd recommend? Of course I want to use a Propeller. But I also need some really small hardware boards upon which I can build. There will be an SD card and a pushbutton somewhere.
And the bigger picture. . .several ladies in the office are now building electronic jewelry, EL clothing, and really cool stuff. I'll certainly draw from their experiences this week, but we need to make some helpful hardware for their projects at some point. Feel free to share any ideas you might have about a Propeller-based e-textile controller.
And go ahead - send me to Google if you need to. I got some thick skin and realize I can be a bit lazy. I'm also short on time [all the time] and know that these forums are loaded with the right mixture of experience.
Thanks,
Ken Gracey
Comments
What will control the LED pattern?
Will they need to change rapidly?
Why does this need to be on cloth?
How flexible does it need to be?
Does it need to be weather or water proof?
What is the power source?
Duane J
could do 12 Rows sourced by Prop directly with 7 Prop pins controlling a ULN2003V12DR for columns sink (=15% duty)
I think the proper way would be to use Constant Current LED drivers.
http://www.mouser.com/ProductDetail/Texas-Instruments/TLC5926IDWR/?qs=sGAEpiMZZMsE420DPIasPjS%2fGpARRo9f7ANH7FDsp04%3d
The "Witches Halloween wand" that I made last year for my daughter used 25 LEDs wired individually... I used 38 gauge copper wire. With most of the really small gauge copper wire, the enamel is burned off during the soldering process, so there is no need to strip the wire beforehand.
http://www.youtube.com/watch?v=AXnGtZcEjgs
http://www.youtube.com/watch?v=NepGWSOuf8s
BTW) the LEDs are from a 25-string of white LED Christmas lights (re-wired) ... The wires that you do see in the video are going to the speaker... those are thicker than all 25 of the other wires going to the lights. .... and YES, there is a Propeller in there! :-)
On question #2, do the LEDs need to vary in brightness, or just ON or OFF?
I recently discovered the PCF8574A chips. These are 8bit I2C I/O Expanders that are both easy to use and will accept 3v. I'll bet they would work well in this project. There's a nice object in OBEX ready to go for these.
Jeff
http://forums.parallax.com/showthread.php?136152-LED-Marquee-Module-for-Gadget-Gangster-Platform-(w-video)
While I did this in the form of a marquee, you could disperse the LEDs around too. To simplify the wiring the alternate row Charlieplexing could be eliminated and still control over 90 LED's. I had pins left over so some day I plan to revisit this project for a much larger array.
Or, the MCP23017 with 16 GPIO pins. I have used this chip in several of my projects to drive LEDs, programming is simple with "jm_i2c" from the OBEX.
Eldon - WA0UWH
Jeff
Robert
You mean as in a pair that go onto legs ?
What area is the map and how long do they expect to wear this, and how bright do the LEDs need to be ?
Is this indoor night time performance, or outdoor daylight ?
You are looking for 'any or all' illumination, right ?
How many are to be made ?
Flexible PCB allows a smooth surface on one side, and even distributed parts, but it has more tooling... is that too much ?
Here is a way to control 100 LEDs with a chip we already have.
There are two modes of operation for this circuit:
Edit: To avoid 3.3V <-->5V complications, just run Vcc1 and Vcc2 at 3.3V on the L293D.
I just tested it and it seems to be fine at 3.3V. ... The schematic shows 5V.. ignore that and make it 3.3V
If P0 to P24 are INPUTs , then none of the LEDs will light in in either mode.
Mode 1: Normal operation
P25 is HIGH ... this is an enable to the L293D
If P26 is HIGH and P27 is LOW ; If P0 is LOW then the bottom left LED will be ON
If P26 is HIGH and P27 is LOW ; If P0 is HIGH then the upper left LED will be ON
If P26 is LOW and P27 is HIGH ; If P0 is LOW then the upper right LED will be ON
If P26 is LOW and P27 is HIGH ; If P0 is HIGH then the bottom right LED will be ON
Mode 2: Normal operation
P25 is HIGH ... this is an enable to the L293D
If P26 is HIGH and P27 is HIGH ; If P0 is HIGH then the upper left AND lower right LED will be ON
If P26 is LOW and P27 is LOW ; If P0 is LOW then the upper right AND lower left LED will be ON
and 8 LEDs using half of the 16 pins on a MCP23S17 SPI I/O expander
and multiple LEDs and tact switches using a MCP23016 I2C I/O expander
Related thread: http://forums.parallax.com/showthread.php?141495-WS2801-Driver
Doesn't that push the voltage budget ? The L293D has Darlington level saturation specs, of 1.4V typical, when you add in a LED drop of ~2.1v, and you have run out of margin ?
It does seem to have a TTL threshold, of 2.3V max, so split supply should be ok.
A overall linear regulator on the LED VCC would allow brightness control, straight from the battery.
On the L293D that I have, I measured about a .7V drop with a load ( ~30 Ohms) to ground when powered from a 3.3V source on both Vcc1 and Vcc2 .... So that leaves about 2.6V overhead. Typical LEDs are about 1.7V drop
Also, the L293D is used in half duplex for this, so the return path is through the Propeller I/O, which under load only has about .3V drop, making the 2.6V overhead become 2.3V. (Realistically about 2.4V since the Propeller has an internal resistance of about 40 Ohms)
As long as you manage the Duty cycle on the I/O's and choose the resistors properly, you can drive multiple LEDs' at an average current that will not exceed the I/O specifications of the Propeller.
The drawback with his object is everything will be too easy.
I tested a strip and in less than 5 minutes you are set. The object is as usual first quality, easy and powerful. Great fun.
Massimo
Lawson
I soldered this grid some years ago following a technique discussed here on the forums:
http://forums.parallax.com/showthread.php?99843-A-fist-full-of-LEDs-for-Christmas&p=696682#post696682
It works without additional hardware, not even resistors.
Cheers, Clemens
It's a mux solution with current limited by inductances, so a type of switch mode driver. The switches are representing the propeller pins. Let's just look to one leg: S1 and S4 are closed. There is voltage across L1 and D1, current will start to flow, the led will light up. S4 is opend, S3 is closed. Current will continue to flow until the inductance energy is used. Now S3 can be savely opended. (if opened before, the current will continue to find his way over D6, the pin protection diode (internal))
As an option a second LED of different color could be paralled inversely and activated by inverting the polarity of the output pattern of the prop pins.
The PropRGB board might show another way, where you can control 8x8x3 LEDs...
Hey Duane, got a few more specifics from the artist.
What will control the LED pattern? => the DAT section of my program with a bunch of 0's and 1's
Will they need to change rapidly? => only at a visually appealing rate
Why does this need to be on cloth? => it's a stocking. Jessica has some conductive thread.
How flexible does it need to be? => seems to be okay with the conductive thread. Stockings get loaded with candy, treats, coal, and oranges.
Does it need to be weather or water proof? => no sir
What is the power source? => sized for a few hours of operation. Probably something that can be easily replaced.
You know, a Christmas stocking - the kind that hangs over the fireplace and gets filled with treats, lottery tickets, fruit and other consumable stuff. These things are decorative and not usually worn on somebody's foot since they're just for decorations.
We only need to make one (1) of these since it's for her mother, an 85-year-old woman who's gotten interested in my quadcopters among other stuff.
Flexible PCBs are out of the question due to the lack of time. I'll have to use our boards, as is, with the right LED driver circuitry.
Thanks for the input. I'm going with JonnyMac's suggestion, and will follow up with OBC's idea in case I fail. Most of these suggestions I understand well enough to implement on my own without much help. I tend to stand on the shoulders of neighborhood giants when it comes to my projects, making quick high-level gains from their expertise!
I'll be sure to follow up with a photo and video of the result.
Thanks gang!
Ken Gracey
Ahh.. Ok that use is more tolerant of weight, and stiffness.
There, you could use winding wire as conductive thread, as needed, and standard PCBs and Batteries could fit near the opening, where it tolerates more stiffness.
Some form of overall brightness control via SMPS trim would give the longest battery life.
out of serendipity I tested WS2801 leds with a 3.3V supply, and it works. When setting all of them to white the 25 leds string tends to have a reddish hue, but it works nonetheless.
Massimo
Honored to be chosen as second,
Jeff