Archive for the ‘LEDs’ Category

Guest Post: LEDs and Ping-Pong Balls to Replace 10W Sign Bulbs

Friday, March 25th, 2011

My friend Cort Buffington doesn’t have an active blog of his own but is doing interesting things with 110VAC light bulbs and is looking for ways to migrate to LEDs.

Star Seq'r and disco ball

What follows is a write-up of his tests with LEDs and ping-pong-ball diffusers.

Cort’s Quest for 10W Sign Bulb Replacements

For some time I’ve been trying to figure out how to make an LED equivalent to a 10W colored sign bulb. Whether it be the G style intermediate base or the S style medium base. The big problem has been a diffuser. Sign bulbs are meant to be looked at, not to illuminate other things, so this is of paramount importance. I very quickly came across a LOT of information online with folks using ping pong balls, and Keith was just as eager as I to try this out. The initial tests with ping pong balls worked…. sort of. Ping pong (or beer pong if you’re in college) balls do work, but there are a couple of immediate problems:

(more…)

Transistor-Based Variable Current Drive for LED Calculator

Monday, September 6th, 2010

I’ve put off working on my LED calculator project for far too long, at first trying to find the right handheld case to put it in and then later hoping to be able to manufacture a case myself. I’m not having any luck with that right now and if I keep waiting I’ll wait forever; so I’m resurrecting the project with the intention of selling it as a kit sans case.

The idea is to expand on a simple LED tester by allowing the user to plug in an LED, dial in the LED brightness, and then read information on an LCD showing the LED voltage drop, the current current, and the value of current-limiting resistor to use in a target circuit.

A microcontroller determines this information by measuring the voltage drop across a series current-sense resistor to calculate the current and measuring the voltage drop across the LED to calculate how much voltage will drop across the current-limiting resistor in the target circuit and what that resistor value should be.

Variable Resistor Drive

LED calculator drive circuit

Until now, all of my prototyping has used a variable resistor in series with the LED to set the current. After subtracting the LED’s forward voltage drop from the supply voltage, the variable resistor dominates the resistance of the remaining series chain (which includes the current-sense resistor), thereby setting the series current.

LED calculator prototype with direct potentiometer drive

This does give control over the LED current and brightness, but the problems with this method are:

  • A small-valued potentiometer doesn’t provide enough resistance to dial down to low enough LED currents. For example, a 1K pot with the circuit running on 9V won’t deliver less than 6mA, depending on the LED color (and voltage drop); and modern, high-efficiency LEDs are surprisingly bright at 6mA.
  • A large-valued potentiometer has an extremely non-linear current response, with all the “action” at the very end of its rotation.

Here’s the response of two different LEDs with a 10K potentiometer:

Position Green LED Current Blue LED Current
0 1mA 1mA
1 1mA 1mA
2 1mA 1mA
3 1mA 1mA
4 1mA 1mA
5 2mA 2mA
6 3mA 2mA
7 4mA 3mA
8 5mA 6mA
9 34mA 21mA
10 100mA 89mA

Very slow response until near the end of the potentiometer’s rotation, at which point the response is so rapid that it’s very difficult to control
And of course this makes sense, as it’s the hyperbolic curve of I = V/R.

Transistor Drive

Last week I started looking at improving the range and linearity of the LED current. I’m not looking for a perfectly flat response curve nor for a true constant-current drive; I just want a somewhat better response. What came to mind was this simple PNP transistor circuit — actually an even simpler version without R1 and R3, but I’ll explain their purposes in a bit.

Transistor LED current control circuit

The theory is that R2 (or R1 + R2 + R3) acts as a voltage divider across the power supply, linearly setting a drive voltage. R4 (nearly) linearly turns this voltage into a current sink across the PNP transistor’s emitter-base junction; and because R4 >> R2, R2 presents a “stiff” voltage source to R4, meaning we can largely ignore R4′s effects on the voltage division.

Thus R2 provides (nearly) linear control of the emitter-base current. In the common-emitter configuration, the PNP transistor amplifies the current by the transistor’s β (about 150-200 for a small, general-purpose PNP like the 3906) for a correspondingly higher emitter-collector current

IEC = β IEB

which goes through the LED and the sense resistor, providing (nearly) linear control of the LED brightness by turning R2.

Well, that’s the theory, anyway. This weekend I dug out the prototype and built up the transistor control to test it in practice.

LED calculator prototype with transistor current drive

(70s decor courtesy Radio Shack.)

The first thing I noticed was a section at the CCW end of R2′s travel in which nothing happened, because R2 wasn’t providing more than the transistor’s cut-in voltage — that is, although VB was less than VE, it wasn’t enough less to overcome to emitter-base forward voltage drop and bias the transistor down into the active region.

I tried installing a small-signal diode “above” the potentiometer so that VB would always be at least .6V below VE and eliminate R2′s dead region, but the diode’s forward voltage drop was a little too high (it did too good a job) and the resulting minimum LED current was a little higher than I liked. I settled on adding R3 in that position, selecting 68Ω as a value that worked well with both traditional and high-power / high-efficiency LEDs and with both 9V and 7.2V supplies.

With a 9V supply and R3 = 68Ω, I tried three different values of the base resistor R4.

R2 Position R4 = 10kΩ R4 = 22kΩ R4 = 47kΩ
Green Blue Green Blue Green Blue
7:00 0mA 0mA 0mA 0mA 0mA 0mA
8:00 0mA 0mA 0mA 0mA 0mA 0mA
9:00 8mA 7mA 3mA 2mA 1mA 1mA
10:00 30mA 30mA 15mA 13mA 7mA 6mA
11:00 46mA 42mA 24mA 22mA 13mA 11mA
12:00 56mA 47mA 34mA 32mA 17mA 17mA
1:00 60mA 48mA 42mA 40mA 24mA 22mA
2:00 62mA 49mA 49mA 44mA 29mA 26mA
3:00 62mA 49mA 53mA 46mA 32mA 30mA
4:00 63mA 49mA 55mA 47mA 34mA 31mA
5:00 63mA 49mA 55mA 47mA 34mA 32mA

The table shows a similar effect at the other end of R2′s travel in which the LED current was pretty well maxed out and not increasing any further. I think I was hitting the knee between the transistor’s linear region and saturation, meaning increasing IEB was no longer increasing IEC. Experimentation gave me R1 of 200Ω keeps the transistor pretty well out of saturation and gives a satisfyingly more-linear response than what I measured here.

The 0mA readings at the beginning of the table, by the way, are a bit deceptive — some of my test LEDs are actually lit in that region. I’ve updated the Arduino code to show tenths of a milliamp when the reading is below 10mA, and I can see LEDs glowing with as little as .1mA. Probably not a value of interest for most people, but it could be effective for making flickering gas lamps for model railroads.

Choosing Values

R4 = 22kΩ looks like a pretty good compromise between providing a near-linear response and covering the range of LED currents I expect most people would be interested in testing, so I’ve tentatively settled on it.

I’m still fiddling with values to give good performance at both 9V (alkaline battery) and 7.2V (NiMH), because I use rechargeables almost exclusively and want to make this work well on rechargeables to encourage other people to do the same. The problem is,

Vsupply = 7.2V
VEC ≈ .8V
Vblue LED ≈ 3.5V

VR5 = Vsupply – VEC – VLED = 7.2V – .8V – 3.5V = 2.9V

ILED = IR5 = VR5 / R5 = 2.9V / 100Ω = 29mA

In other words, running on a 7.2V battery, with the transistor saturated, a blue LED with a 3.5V forward drop maxes out at 29mA; and it gets worse with a battery that’s not straight out of the charger and some white LEDs with a higher forward voltage drop. I’d like to enable people to test up to 50mA, to cover high-brightness LEDs, so I’d like to push this maximum current a little higher.

R5 = 68Ω gives ILED up to about 42mA, which isn’t as high as I like; but the tradeoff is that a smaller R5 gives me a smaller voltage range to sample in the A/D converter, hence lower resolution for the display. 68Ω seems like a good compromise. And I’m already thinking about a DPDT switch to change the resistor and alert the microcontroller about battery chemistry.

EasyBright on Stage

Tuesday, May 25th, 2010

Music stand wand light with lens flare

Saturday night the EasyBright already got its public debut! I played a pair of classic rock concerts Friday and Saturday nights, and Friday had trouble seeing my music (occasionally folded out to four pages) with the clip-on stand light I was using. Saturday after assembling the EasyBright, I built an LED “wand” music stand light that worked marvelously.

End of LED wand music stand light

I didn’t have a lot of time for construction, so I cut a 1/2″ dowel to 3′ length and drilled eighteen 1/8″ holes through it (axially, not longitudinally) every 2″. Paint wouldn’t dry before the show, so I sanded the dowel and then colored it with a permanent marker. I then installed bright flat-top LEDs with a good viewing angle into the holes and bent the leads out in opposite directions.

Wiring on LED wand music stand light

I lap-soldered teflon-insulated (heat-resistant) wire from LED to LED with heat-shrink tubing preinstalled — but didn’t shrink the tubing until after I had tested the LEDs, in case I needed to repair any solder joints. I skipped LEDs to make an A-B-C-A-B-C pattern so if a chain failed, I’d lose light evenly along the whole wand instead of all in one section.

Connectors at end of LED wand music stand light

I crimped connectors onto the wires, connected everything to the EasyBright, put an appropriate connector on a 24VDC wall wart, and fired it up perfectly on the first try. (Such luck!) I disconnected the wand, reseated and shrank the heat-shrink, zip-tied the wires in place, and then powered up the wand to burn in for an hour before leaving home for the concert.

LED wand music stand light

On stage, it delivered a very even wash of illumination across my music, giving me a great view all through the show.

EasyBright circuit board driving LED wand music stand light

The circuit board is so lightweight, it was comfortably suspended in mid-air between the keyboard rack and my music stand by the power and LED wires. For the long term, I’m trying to decide whether how it should be mounted to the wand — perhaps attached near the end inside a sleeve of giant heat-shrink.

Assembling the first EasyBright

Tuesday, May 25th, 2010

EasyBright components

Last week while watching Mannequin (a very young and fresh Kim Cattrall, a goofy plot, and music by Starship — what could be better? okay, if it had John Cusack and were set in Shermer, Illinois, yes, that would be better) I split all the EasyBright components into a parts bin for easy access and portability.

Saturday afternoon I put together the first sample.

EasyBright-3L constant-current LED string driver PCB with solder paste

This is waaaaaay too much solder paste for 0603 parts and 1/40″ IC pin spacing. I had to remove several solder bridges from the IC, and the passives had solder mounds instead of fillets. I took the picture specifically to record how much paste I used so I could adjust on the second attempt.

EasyBright-3L constant-current LED string driver, front

Here’s the cleaned-up board, front side.

EasyBright-3L constant-current LED string driver, back

Back side, with hand-written labels for the current rating and the serial number (S00). The “permanent” marker comes off easily with rubbing alcohol — I need to get some clear nail polish to seal it in.

Changes

Even before assembly, I had made notes about (and started implementing) things to fix whenever I print the next boards:

  • Change the IC’s ground connection from a via outside the IC footprint to a trace going straight in to the heatsink pad. I had routed that connection before I confirmed with Maxim that the pad is okay to connect to ground — it’s just not okay to be the only ground — and then forgot to go back and change it. Removing that via gives me a little more room to route the bottom-side LED power traces cleanly, and also:
  • Increase the pad size on the optional through-hole current-sense resistors. This, believe it or not, is EAGLE’s default pad size, and I think it’d be challenging to solder without a good, narrow-tipped iron.
  • Increase the trace isolation on the solder-side ground pour. There’s no reason to have it that close to the pads.
  • More subtle, I spaced the 2-pin connector pads an extra .02″ apart to see whether I could get the connectors to friction-fit for ease while soldering. They don’t quite. Either change the library footprint to space the pads a little further apart or just get used to pinching the leads together before stuffing the parts and soldering, which works better than I had expected.

I’m still delighted!