## Never Ever Connect an LED Without a Resistor, Mostly

< Nick's Home -- Nick Parlante 8/2012

When hooking up an LED, you are always supposed to use a current-limiting resistor to protect the LED from the full voltage. If you hook the LED up directly to the 5 volts without a resistor, the LED will be over-driven, it will be very bright for a while, and then it will burn out. That's what they say.

### Today's experiment: LED's Without Resistors

But suppose we hook up the LED directly to the 5 volts -- exactly like you are not supposed to do -- but then switch the voltage on and off very fast, e.g. on for 1 millisecond, then off for 9 milliseconds (on about 10% of the time). This is called Pulse Width Modulation, PWM. With PWM, the LED has a reasonable looking brightness, but the question remains: are the brief periods of the direct 5 volt connection destroying the LED, or is it fine? Hence today's experiment. The top LED is driven the usual way with a current-limit resistor, so that's the control. Below that there are 4 LEDs in a row. The LEDs are driven via PWM with various percentages to see how their brightness holds up over time.

• The rightmost, least bright LED is driven by PWM to be on 0.4% of the the time (1 out of 256)
• The second from the right LED is driven by PWM to be on 6.3% of the time (16 out of 256). When the experiment began, this LED seemed to be about the same brightness as the control. To actually use this technique in a project, I'm guessing this is about the right level to use.
• The third from the right LED is driven by PWM to be on 50% of the time (128 out of 256)
• The last "throbber" LED varies continuously between 0% and 50% PWM, just for fun.

I started it running on 8/3/2012, so we'll see how they hold up (the experiment is currently visible at my Gates office). At the start of the experiment, the PWM LEDs show three brightness levels as you would expect. My suspicion is that the 50% LED really is getting overloaded, and in the end with dim or burn out or something. We'll see. This experiment was constructed with an open source Arduino board which is a nice little \$25 computer for art/hobby projects like this.

### But Why Would You Do That?

I was motivated to look in to this because the world's most geeky geocache, The Dragon Puzzle, is burning too much power running LEDs. It turns out, that if you drive your LEDs through PWM, they use about 50% less power than if you do it the old resistor way. It's also a little bit motivating out of just laziness. Why bother with wiring up a resistor if you can just use PWM instead. Most modern chips have lots of PWM capacity. The resistor is sort of a crude solution -- getting in the way of all those poor electrons. With PWM, we're sort of solving it in software, the hip way. Well, hip unless it burns out the LED.