Circuit for headlight LED works, but I don't know why
February 20, 2011 11:22 AM   Subscribe

It's been cold recently (-15C) and I burned out two bulbs in my dutch bike's headlamp in a short time. Since the bulbs are hard to find, I thought this was a good time to replace the bulb with a 1-Watt LED light. What I built works, but I don't quite know why.

The headlamp is dynamo powered, and from a bit of googling, it seems that the dynamo is 3W and produces 6V. That's too much to drive my 1 Watt (luxeon clone) LED directly, which has a max rating of 3.6V @ 350mA - so i built two super-basic "circuits" to drop down the voltage and current.

The first just uses a 7805 linear regulator, which limits the voltage to 5V. I thought this wouldn't limit the current and expected it to almost immediately blow the LED, but was able to ride around and the LED still works fine.

The second circuit uses an LM317 based on an article at Instructables. A 3.9 ohm resistor is connected between the adjustment and output, which limits the current to 320mA. (Apparently there is a 1.25V reference voltage running between the ADJ and OUT pins, so 1.25V/3.9 Ohm = 0.320A) I expected this circuit to also blow the LED since the current is limited, but not the voltage. But this setup also works fine.

Now, it's great that both of these setups work (unlike many other of my electronic projects) but I'm curious to know why and which design is better at providing the LED with power closer to the specifications (ie. is not overdriving it). And even more awesome would be tweaks to make either of these circuits less hard on the LED.

(One other detail might may be relevant: There appears to be a black (schottsky?) diode in the casing of the headlight. I don't know why it's there - but i added my circuits after it.)
posted by kamelhoecker to Technology (9 answers total) 4 users marked this as a favorite
 
Best answer: Three things come to mind:

1. Your dynamo is generating 1.5 Watts instead of 3W because it produces AC and you are not using a rectifier, therefore the LED is only using half the cycles.

2. This still means the LED is being overpowered, but only half as often, which gives it more chance to cool - it is heat and thermal runaway that are the prime destroyers of these LEDs, and a 50% duty cycle reduces these considerably.

3. When you are burning out an LED, it might take hundreds of hours before it burns out (depending on myriad factors), ie it might last only 1% of its rated life, but that's still thousands of hours. I've noticed that some cheap flashlights seem to do this intentionally - put vastly more power through an LED to get higher performance at lower cost, on the assumption that the LED will still last as long or longer than an incandescent bulb would.


Also, max rating of 3.6V @ 350mA in this case means that the LED has a voltage drop of 3.6V, and a max wattage of about 1 Watt. It means the LED won't start lighting up properly until about 3.6V, it doesn't mean that the LED will blow above 3.6V. Thus your limiting resistor works.

The limiting resistor is the traditional method of driving LEDs from higher voltages, so what you've done is the correct and proper way... for normal LEDs. But you're using a 1W led, which are supposed to be current limited to prevent thermal runaway. (What can happen is that as the LED gets hotter, its resistence drops, which means your limiting resistor is nolonger limiting enough, so more power is going into the LED, which heats it up more, which lowers its resistance, which draws more power, which creates a vicious cycle until the LED blows out. Smaller LEDs don't draw enough power to generate enough heat to suffer this, so limiting resistors is how you drive them. With 1W and larger LEDs, it can be a problem.

So the fact that it's really cold at the moment might be what is saving your LED. Or contributing.
If you can mount it on the metal of your bike frame, or other kind of heatsink, using thermal glue, that would also help keep it cool and reduce the likelyhood of thermal runaway. In conjunction with your 50% duty cycle, that might be all you need to do even when the weather warms up.

But OTOH, maybe a few months from now, the LED will burn out.
Or maybe it'll be good for years. Running LEDs overspec is a bit of gamble, but it seems to me to be a gamble that you usually win.
posted by -harlequin- at 11:52 AM on February 20, 2011 [1 favorite]


Best answer: I'm curious to know why and which design is better at providing the LED with power closer to the specifications

If you limit the current to 160mA, then even at 6V dynamo output, the LED is receiving less than 1W, so it should be ok. At that point, the LED might be noticeably dimmer at low speeds though, especially since its still on a 50% duty cycle. And since it's now limited to 1W, you could replace the dynamo diode with a bridge rectifier and harness all the cycles from the dynamo.
posted by -harlequin- at 12:04 PM on February 20, 2011


3W at 6V might be an optimistic spec with no load. Under load, the voltage may drop considerably. And this may also vary depending on speed. Have you been able to verify that the dynamo does, in fact, perform to spec? Is the output rectified or AC?

It's not clear what circuits utilize the 7805 and LM317. It's been a while since I used one of those, but ISTR there may be losses/voltage drops just going through one of those.

Does the 1W LED have any onboard driver circuitry of its own? Sometimes the specs indicate the minimum requirements to fully drive the LED rather the maximum. To further complicate things, these are sometimes sourced from Hong Kong vendors who don't really know the difference.

Regarding the Schottky diode, are you sure that's what it is by verifying the number? If the casing was designed with an incandescent bulb in mind, I'm not sure why it's there. Maybe as a simple low drop rectifier? Odd, if you were popping bulbs before.

I guess if it works, then the theory is only a minor concern.
posted by 2N2222 at 12:29 PM on February 20, 2011


Bicycle dynamos are indeed alternating current. The device in the headlamp is probably a pair back-to-back zener diodes that are used to clip the peaks of the AC voltage from the dynamo. Zener diodes are designed to conduct current only when their designed voltage is exceeded (called the breakdown voltage). This may be what is protecting the LED, not your voltage regulators which you probably don't even need.

The dynamo produces a voltage that is directly proportional to the speed at which it rotates. The faster you go the higher the voltage. But the dynamo also has internal inductance that is also proportional to rotation speed. This means that the impedance of the circuit increases to somewhat limit the current at higher speeds. However this alone is usually not enough to prevent burning out lights. Therefore they put in zener diodes to limit the voltage. You should notice that the diodes are connected across the terminals of the light in order to shunt the excess current. In addition, as others explained above, because it is alternating current, the LED is only on half of each cycle.
posted by JackFlash at 1:16 PM on February 20, 2011 [1 favorite]


Best answer: I don't know why the 7805 circuit works as well as it does. Maybe you are overdriving the LED and it'll grow dim faster than it should. Maybe one of the other things harlequin mentions is true and you're not actually overdriving the LED.

The current-limited source (such as an LM317) is the "right way" to drive an LED. (The simple current-limiting resistor is simply a very 'mushy' current source, which works great for lower power LEDs.)

Basically: the only way the LM317 can regulate the current is by adjusting the voltage on its output terminal so that the desired amount of current flows. So the diode isn't seeing 6V. It's seeing 3.6V, or whatever it needs to see in order to pass 320mA. The LM317 is eating the rest of the voltage.

More explanation:

Even though you notionally have two variables (current and voltage), the diode, like any device, has a current-voltage relationship it follows. (Resistors do too, and it's a simple straight line: this is Ohm's law. Diodes aren't ohmic, they don't exactly have a resistance.) So you really only have one axis of control: you get to choose where along that curve you operate the device. The 7805 tries to keep the voltage constant. The LM317 (when wired as a current source) tries to keep the current constant. In each case, the only way they can do that is to simultaneously affect the current or voltage respectively.

The diode's I-V curve is really steep near the region of interest (you want to operate an LED just to the right of the point where the curve turns sharply upward). So it's a lot easier to control by regulating the current than by regulating the voltage. Especially since the value of Vf (the point on the voltage-axis where the curve angles upwards) varies with temperature and the temperature of a bright LED varies a lot with use. This is the 'thermal runaway' problem harlequin mentions.
posted by hattifattener at 1:24 PM on February 20, 2011


Best answer: It is also worth noting that LEDs are rated for average current. So a 350 mA LED can handle 700 mA if on only half the time or 1400 mA if on only 25% of the time. With AC current your LED can conduct only for half the cycle and only on the portion of the half cycle that is above the turn on voltage of 3.6V. So it is possible that it is on only 25% of the time. You may be well below the maximum allowable power. You may want to try operating without your voltage limiting circuit to get more brightness if you are willing to sacrifice an LED in an experiment.
posted by JackFlash at 1:31 PM on February 20, 2011


The important things for driving an LED are the current (don't exceed maximum) and the junction temperature (ditto). The voltage spec of an LED is useful to decide about how tall your power supply has to be, but if you really want to get the most light & life out of an LED, you have to control the current and temperature.

One way to control the current is with a resistor: you choose the value based on your supply voltage and the diode drop so that even if the LED starts to overheat and the voltage drop decreases ("thermal runaway," as -harlequin- notes) the resistor will still keep the current below some worst-case maximum. However, the resistor always burns up some power, so you're wasting some energy, or not getting the most light out.

Another way to limit current is with an LM317 hooked up as a constant-current source (as I believe you've done). You don't need to use a voltage regulator too; the LM317 limiter alone will behave as whatever resistor is necessary to keep the current below your set point. However, keep in mind that the LM317 will dissipate any excess power as heat, so you'll want to keep it from getting too hot (it may be thermal-protected and will just shut down, but I'm not sure.)

You will need to have a diode (or a full rectifier) in there since your dynamo generates AC.

Finally, if you run the LED at its rated current, you will probably have to put it on a heat sink (the spec sheets will say how much heat you have to remove if you run the LED at its rated output.)
posted by spacewrench at 1:33 PM on February 20, 2011


Best answer: The LM317 works, as others have said, because once you've made a constant current source you don't have to worry about limiting voltage; it "rides along" to whatever it needs to be to make Ohm's Law happy.

The 7805 is a little weirder but my suspicion is that it's because the 7805 is saving you in a couple of different ways. Assuming the 6V quoted on the dynamo is RMS (because it's AC power), you've got a sine wave input with amplitude ~8.5V. In order to actually regulate to 5V a 7805 needs to see at least 7V on its input, so most of the time it's either shut down (Vin < 2V) or in some brownout state (Vin between 2V and 7V)*. Once you break 7V you may be saved by some combination of (a) low duty cycle and (b) the 7805 going into either thermal or current shutdown (LM7805's have protection circuits for both).

*It's also possible that you've grounded to the center of the sine wave, instead of the bottom, in which case half the time the 7805 is off entirely (Vin is negative), from 0-2V it's in low-voltage shutdown, and from 2V-4.25V it's in brownout never never land.)
posted by range at 8:02 PM on February 20, 2011


Response by poster: Wow, fantastic responses! I've read them over a few times and am still slowly updating my mental model of how this works.

To answer 2N2222's questions: The LED is just a bare LED that I had to solder onto a heatsink. So, it doesn't have any driver or current protection. The dynamo is an "AXA HR" and yes, as others have mentioned, it outputs AC. I found a page where someone built a test harness to measure output:

http://pilom.com/BicycleElectronics/Dynamo.htm

I love -harlequin-'s idea of adjusting the resistor on the LM317 to reduce the current to 170mA and then add some diodes to create a bridge rectifier and use 100% of the output from the dynamo.

JackFlash: You're right about those zener diodes. In that page about the dynamo they author mentions how they bypass "2 zener diodes in series" which "limit the output voltage". But I only saw a single diode in the lamp casing.

And big thanks for pointing out that Amps measure current over time and so I could actually increase the current if the LED duty cycle was less than 100%. Very cool.

hattifattener: Great explanation of current and voltage relationship and how the LM317 adjusts the voltage to keep the current stable. Really helped me to grok this whole situation.

spacewrench: I actually have a tiny heatsink on the LM317, but it's been do damn cold, I don't know if it's needed. I guess i'll find out in the spring.

Thanks again for the responses. I'm always amazed at how deep the rabbit hole goes when trying to understand a "simple" circuit.
posted by kamelhoecker at 9:47 AM on February 21, 2011


« Older travel-agent like website?   |   How do I replace both drives in a RAID 1... Newer »
This thread is closed to new comments.