10 cent LED driver challenges and updates

A project log for Lys Bright

A solar powered bright light

Ole Andreas Utstumo 09/09/2016 at 12:020 Comments

It works!

Kinda. The 10 cent LED driver as described in this post works out okay. Using a PID regulator, it can drive the LED at rough current intervals up to its max rating, 350mA, and even further if I wanted to. Here's a gif of the Lys Bright casting its light upon our garbage bins, using all the 6 LEDs at 250mA, which is 70% of its potential output:

The Challenge

Well. The drawback using this design is that the current has to be constantly regulated in some way or another. Why? If the current through one LED is set to 350mA using a given duty cycle of the PWM and sensed by the current sense resistor, what happens if there is a drop of voltage on the +BATT rail? With a MOSFET transistor, we're essentially adjusting the voltage across the transistors drain and source, meaning with a voltage drop across the entire rail, less voltage will be present across the LED, and if we recall the i-v characteristics of a diode, this will have a substantial impact on the current in the circuit. Remember that a diode is driven using a "constant current" source. So that means while it is easy to set the current with a stable supply voltage with this MOSFET driver, things start to get tougher when you take into account that the battery voltage will drop as it is discharged, and large current loads of neighbouring LEDs will cause voltage sag from the copper traces, wires and within the battery cell itself.

Yes, a PID regulator or smart programming can to some extent compensate for this, but there are way easier ways of regulating the current efficiently.

The solution

Just remember this: You can view the MOSFET as a voltage controlled voltage amplifier, and the BJT transistor as a current controlled current amplifier.

There we have it. A BJT will try to amplify the current no matter what the voltage at the rail is, providing constant current through the LED as the voltage varies. It should have been obvious from the start! So let's update the design:

Here I chose a random NPN BJT transistor I had lying around and wired it up on my breadboard:

Sure enough, adjusting the voltage of the rail up and down hardly affects the current at all. Excellent! The LEDs on the board will be rock steady, unaffected by any battery voltage and voltage sag. As an added bonus, there is no need for constant regulation, meaning that adjusting the output of each LED should be as fast as the RC filter at the transistor allows it.