Navigate:
I needed to finish up the light tubes today for the demonstration in the afternoon. I wired all the pigtails from the end of the tube into a DB-25 connector. Since I had not labelled the wires, I had to test each LED so I could wire them on the connector in order. Not such a big deal. I got the whole setup mounted on the bike. For the demonstration (since I didn't have the computer finished) I just wired up a couple DB-25's to light up all the blue LED's that face backward. It looked pretty cool, especially at night.
I wired up the second light tube and had a case of deja-vu when I tried snaking it through the tubing: it was really tight and I kept breaking the wires I was pulling on. I used some silicone spray to try and get it going but it kept getting stuck. I eventually gave up, started on it the next day when I had some rest. I got it wired up and installed. I also found that I had a dead green LED in the original string so I replaced that. All I have to do now is to wire up the connectors ... oh, and build the whole computer system.
I've been thinking about what would happen if the main battery went dead — the whole vehicle would go dark and silent. I had been thinking about adding separate markers on the steering tubes of the back wheels, but it would quite a bit of extra work. It dawned on me that I can set up emergency lighting with a relay and a couple batteries: as long as the power was on, the relay would stay on; if it shut off, the battery would connect to several of the lights on the string: i.e. far front, far rear, and the eyes ... 6 lights at 20mA would be 120mA and would drain a 2200mAH battery in 18 hours, but if I got it down to say 10mA total, then it would last for 200 hours. If I went with green then it would be most visible. I dug up a very small relay with a 12-volt coil and it draws 15mA itself, but I found I could get it down to 7mA if I wired it in series with a capacitor (to let it latch) and a resistor (to keep it latched.)
I changed my mind and decided to make a pulse-width modulator with a low-power 555 timer and just hold the reset pin low via the control computer — if it failed, the 555 would start pulsing and drive the LED's.
I assembled all the LED blocks assembly-line style. I got a system down and it didn't take too long to get 10 pairs assembled (a total of 20 clusters with 2 LED's in each cluster capable of emitting 3 colors.) The three resistor leads were about the same length so I used a penny as a conductor and tested all the clusters, fixing the few that are dead.
On the 31st, I made a couple passes on how to get the LED's to light up the eyes. Each eye has a pipe angle welded on the back that extends to a hole in the front; I have pupils with a short length of tubing that is glued into a short length of pipe that threads into the angle. The other end of the angle is open and is just the right size to accomodate the 1/2" polyethylene tubing with a very snug fit. I eventually figured out that the LED clusters are small enough to snake through the interior of the pipe angle so I just put them on long pigtails and I'll shove them into the pupil tubing to light it up.
By spacing the clusters evenly, I end up with 5 pairs facing in opposite directions, and the middle pair is right at the apex of the curve of the frame. Perfect. I started wiring them up like I did with the spiral bike tubing, except with address lines too. I needed to address 11 common cathodes (the 10 lights in the tube plus the one for the eye) along with 3 anodes (red, green, and blue) so I decided to run two ribbon cables: 8-conductors and 6-conductors. The 8-conductor would run the whole way with the three anodes and the eye cathode on the middle 4 conductors and then I'd use the two outside pairs to address the next two clusters. Likewise, the 6-conductor wire would address the remaining 6 cathodes.
I soldered the wires onto each cluster and taped each to a short length of 1/4" polyethylene tubing with clear tape — I did this on the spiral bike because it tended to shove the ribbon cable to the edge of the larger tube so it wouldn't block the light. Once I got done, I had a length of flopsy segments of 1/4" tubing with LED's in between each segment, a lot of tape, and ribbon cables. However, once I tried to snake it through the tube, it was just a little too big. I couldn't get the thing through. I tried pushing it, pulling it with a wire snake, adding silicone lubricant, sucking it with the vacuum cleaner, sucking it with the vacuum pump I have (using a pig made from larger tubing), and finally pulling it really hard with a soldered loop using the wire snake. I got about halfway and couldn't get any further. I took it back apart and found that I had ripped out some of the wires and it would never have worked anyway. I got a little annoyed for a bit, but realized that I could use ribbon cable for the common red, green, and blue anodes and then use wire-wrapping wire for the cathodes as they'll only carry a maximum of 60mA — the farthest lights might get a little dim, but it'll fit in the tube.
I got the wire-wrap solution knocked off in less time than I thought (including the repairs to the broken LED's — I still didn't manage to permanently break any of them.) The new setup looked better and using a similar technique with the wire snake, it slid in place with a modest amount of effort. One of the clusters didn't light so I had to take it apart and fix a bad solder joint, but other than that, the whole thing is addressable.
I was unable to kick the welding-geek habit and I accidentally made a frame for a spiral bike out of one piece of pipe. I'll be bringing it to Burning Man, and I used the light tubes as a proof-of-concept for my lighting idea. It's somewhat different in that the lights are all wired together (I can't address each cluster) but I do have the ability to change the colors using a control box behind the seat. It also has little headlights and a tail light, so it's safe to ride on the road (har har.) The digital camera on the camcorder was pretty bad so they don't enlarge (there's no point ... the resolution wasn't there — I need my film camera, but I don't want to pay for the developing for just a couple shots.)
|
|
I worked on doing some tests of the lighting circuits. I am working on a bike for Burning Man and I'm going to use the same lighting technique, so I got a chance to try out what I want to do. I started with the red/blue 3mm LED's and the green 3mm LED's from LSDiodes.com. I decided to wire them in opposing pairs so I wouldn't have to space them as close (I figure the glow from an LED travels about 1 foot down the polyethylene tubing, so I can get away with spacing them out every 2 feet if I make a pair that shine away from one another.) It really wasn't too bad at all ... here's the photo essay:
|
The next step was getting the ribbon cable inside the 3/8" inside-diameter tubing. Initially I tried just stuffing it in but it ended up being all floppy inside the tube. I bought some 1/4" outside-diameter tubing, taped the ribbon cable to it, and then stuffed it through. It works a lot better for two reasons: first, the ribbon cable lays flat, and second, the light assemblies are hard to push down the tube — I was using a piece of stiff wire, but with the additional small tubing, I can just guide it through without a push-rod.
Not only did I get too few 150-ohm resistors (I bought 30 of each, and I'll need 60 of the 150-ohm's.) I also decided to go with the bit-modulation anyway. The circuit I have in mind is essentially 3 banks of up to 30 LED's, so I can just multiplex between the red, green, and blue. I ordered several MIC5822 8-Bit Serial-Input Latched Drivers — they contain a cascadable shift register with an 8-bit latch and the outputs can sink up to 150 mA to ground.
Originally, I anticipated making a capacitor matrix that would keep the LED's from depleting and multiplexing the analog outputs on the PIC controller to charge the capacitors. It might have worked, but this bit-modulation system is way better — even if it flickers a little.
I originally bought resistors to use with the RGB LSDiodes.com but I realized the voltages and currents might be different. Indeed, the 3mm red/blue and 3mm green LED's require different values. I calculated the results with either a 4-volt or 5-volt supply (which I'll probably use.)
Color |
Voltage |
Current |
Volts |
Desired Resistor |
|---|---|---|---|---|
red |
2.2 V |
20 mA |
2.8 V |
140 ohms |
green |
3.3 V |
20 mA |
1.7 V |
85 ohms |
blue |
3.2 V |
20 mA |
1.8 V |
90 ohms |
Anyway, I tested using 150 ohm resistors for blue and green and a 180 ohm resistor on red. This balanced things so each LED was driven at about 30mA with a 7.5V source. The 150 ohm resistors dissipated 0.14 watts and the 180 ohm dissipated 0.17 watts, but with 20 mA, the figures are 0.06W and 0.08W respectively, allowing me to use 1/8W resistors. I also noted that I can use two layers of Scotch tape to diffuse the light nicely. I checked the circuit with 5 volts — green was 18mA, blue was 20mA, and red was 22mA — very close to ideal and easy to fix in software, so I went ahead and bought packs of 150-ohm and 180-ohm resistors.
I met a guy named Dave who referred me to an idea for driving LED's with a microcontroller using a shift-register and latch with a technique called "bit modulation." It's a derivative of pulse-width modulation except it's much better suited to driving multiple outputs concurrently.
In traditional pulse-width modulation (I'll assume it's all for LED's although it can apply to any averaged output) the LED is driven at full-brightness for some percentage of the time at a relatively high frequency (enough that the human eye's persistence of vision can't detect the blinking.) So, for instance, to create the illusion of 10% brightness, the LED is turned on for 1 unit of time and then off for 9 units of time. Usually the frequency of the wave remains the same and only the duty-cycle changes.
In bit-modulation, the desired modulation is assumed to be a binary value. The least significant bit (2^0) is read and the LED is turned on or off depending on its value for 1 unit (2^0 units) of time. The same is done for bit 1 (2^1) only for 2 units of time (2^1.) This continues for successive bits. The resulting brightness output averages to the value over 2^(n+1) clock cycles — the illusion works as long as the LED is on for [duty-cycle]% of the time and off for 100%-[duty-cycle]% regardless of how many times the LED is turned on or off during a cycle.
The huge advantage here is that a shift-register with a latch can be used to set the values for any number of LED's in a very short amount of time. That is, if you have X LED's, the same bit from each of the X LED's desired duty-cycles can be shifted in to the register, the latch can be triggered, and then the CPU will wait for (2^bit) time units until the next bit is loaded.
Unfortunately, I'm using a system where the red, green, and blue anodes are on three wires and the common-cathode of each LED cluster is brought back on one wire — so for X LED's I need 3+X wires. I dismissed the idea — although really cool — because it just wasn't practical for what I wanted to do.
I assembled the pupils of the eyes with tubing, the pipe nipples I bought, the washer/nut assemblies that make the pupils themselves, and a couple clamps. Basically, I fit the end of the bolt that's welded to the washers that make up the pupil into the end of a short piece of polyethylene tubing. I used the pipe clamp to tighten it down and then glued it into the pipe nipple on the frame. I gave it a quick test with my LED light and it seemed that it might just work.
I bought some milky-clear polyethylene tubing with a 1/2" outside diameter and a 3/8" inside diameter. It's easily large enough for lights and wires, and I decided on terminating it with 3/8" steel pipe which has an inside diameter that snugly holds the polyethylene tubing. I went with fender washers, 3/8" bolts, and pipe clamps to make the pupils of the eyes.
To connect the light tubes to the electronics, I went with DB-25 connectors with hoods. I should be able to crimp the tubing into the hoods and make a reasonably weather-tight fit.
I got on the LSDiodes.com website and found the full-spectrum LED's were out of stock; it turns out they won't be available for around a month. I decided to get 3mm red/blue LED's and 3mm green LED's instead — the voltages are a little different, but overall they are much brighter (almost 3x) than the full-spectrum LED's.
I noted that the full-spectrum LED's I'm looking at from LSDiodes.com have the following voltages: 2.05 volts for red, 3.2 volts for green, and 3.6 volts for blue; all at 35 mA. Thus, to be driven at full brightness from 5 volts, I'll need an 84 ohm resistor (the closest standard value is 82 ohms) a 51 ohm resistor, and a 40 ohm resistor (closest being 39 ohms.) The 84 ohm resistor will drop the most amount of power at 0.1 watts, so pretty much any size is safe. While I'm at it, driving one of these LED's with all elements on at full brightness is 310 mW, so if I'm to limit the lighting to 6 watts or so, I can only use about 20 LED's at a time ... of course, I can just program it so it's not trying to turn on all the LED's white at once.
I put in an order at Mouser.com for the resistors (I had to swap the 82-ohm resistors for 75-ohm since they were out of stock) a bunch of 10 µF capacitors (I already have 48 so I bought 50 more, expecting to wire in no more than 32 LED's) and a bunch of 2N3906 PNP general purpose transistors that I'll use with 74LS138 3-8 multiplexer chips to drive the cathodes of the LED's.
I decided to do the "LED experiment:" how fast can I charge a capacitor with a silicon 2N4123 transistor current follower — something like 10 µF — and how long will it for its charge to dissipate through the LED? In other words, how many LED's can I continuously refresh using this technique? My 20 mA LED that drops 2.2 volts will need about a 340 ohm resistor. It takes about 240 µs to charge a 5 µF capacitor to nearly full voltage — about 500 µs to squeeze in the last few millivolts. Dissipation takes only 650 µs to fall a full volt.
After a few iterations, I settled on a Darlington follower which drops the charge-time to 20 µs. Given a 1 µF capacitor, the rise time is below 10 µs and the decay runs for about 215 µs. If I move up to a 5 µF capacitor, the rise time stays below 10 µs but the decay jumps to 650 µs. If I then move up to a 10µs capacitor, the decay of 1 volt loss jumps to 1.4 ms.
Comparing to the prior pulse-width modulated test, I found the duty cycle needs to be about the same for the same brightness: 28 µs of the 2.1 ms cycle time or 1.3%, so I can theoretically drive 75 LED's in a perfect world.
I played with a pulse-width modulated LED. The circuit wasn't pretty, but it worked ... essentially a transistor amplifier that drives one differential input on an operational amplifier and the other is through a variable resistor set somewhere between the rails. The op-amp output drove an NPN transistor's base and the emitter was tied to ground. The collector went through a 1-ohm resistor through the LED to a 5-volt source — essentially, when the transistor was on, current followed a path through the LED, resistor, and the collector-emitter junction.
The peak-to-peak voltage on the 1 ohm resistor was 190mV, so in theory, I could have driven the LED to 200 mA average. The pulse-width modulator had a period of about 2.05 ms. The LED was barely on with a duty cycle of 14 µs which correlates to an average of 0.14 mA. It was "dim" around 50 µs or 4.9 mA. I considered it "fully on" at 134 µs which correlates to 13mA and "overdriven" by about 335 µs or 33mA. It appears the circuit works perfectly (and it doesn't appear to blow out the LED's.)
I also picked up some gray ribbon cable which I'll use inside the tubing to wire all the LED's.
|
I tried out my idea of illuminating the polyethylene tubing and want to make sure a 12-inch spacing will look good enough. I quickly threw a test rig together and found the red clear LED's drop 2.2 volts, so the red LED needs a 340 ohm resistor for 20 mA with a 9-volt source. The red was adequate at a 12-inch spacing, throwing light about 3 inches down the tube — testing with brighter LED's should yield more perceived distance. |
|
All content copyright ©2005 Jason Olshefsky.