It’s possible to design your own switching LED drivers using a microcontroller as its PWM source.
Some of my LED lamps and bike lights use microcontroller based LED drivers. The microcontroller used include ATtiny85 and ATtiny84.
With a lower supply voltage, you might find your energy savings significant when using a switching LED driver. If you need to power a 3.2V white LED with LiFePO4 cells which are 3.2V each, you likely need two cells for stability. With a step-down driver, the efficiency is around 85%. With a current limiting resistor, the efficiency falls to 50% with more waste heat!
With a microcontroller, there’s more flexibility. You can adjust the driver’s feedback voltage and drive current, and add more features.
With an adjustable feedback voltage, you can decrease the drop-out voltage of the driver and you don’t have to change resistors to adjust the drive current.
With an adjustable drive current, you can increase the lumens per watt rating of your LEDs when dimming. At a lower drive current, a high end LED can have 200 LPW. Near its maximum current, it can fall to 100 LPW even with PWM dimming. If you installed a lower current rating LED, you can update the code to lower the current.
The features that you might add to the driver include button control, brightness adjustment, potentiometer control, battery monitor, maximum duty cycle, memory of settings, and sleep mode.
When designing a boost driver, it’s important to have fuses and overvoltage protection in case of errors in your program or your output disconnects. I’ve often burned my components when designing boost drivers.
It’s recommended that the transistor has a high Vds and power rating. TO-220 packages usually are preferable to TO-92 or SOT23 packages because they can handle more power.
I find that oscilloscopes make troubleshooting easier. I tend to keep the circuits simple and my circuit boards custom made so that troubleshooting is easier.
I might experiment with even higher voltages because it can drive more LEDs with fewer drivers. If you’re using a 12V power supply, you can use a single driver to power 20 red or yellow LEDs, or 15 white LEDs! You might be able to drive even more depending on your components’ ratings. With a step-down driver, you can power only four red or yellow LEDs or three LEDs from a single driver.
Possible project ideas include bike lights, flashlights, desk lamps, work lights, and grow lights.
If you’re not comfortable with designing boost LED drivers, you can try buck drivers. There’s no need to worry about overvoltage and there’s less risk of overcurrent. To prevent damaging your LEDs while testing, you can connect them to a current limiting resistor. You can still use fewer drivers and have more power by selecting higher current LEDs, or connecting more cells in series.
On Instructables, there are microcontroller based LED driver projects.