ATTiny84 Based 3A Step-Down LED Driver

by hanlin_y in Circuits > LEDs

3334 Views, 36 Favorites, 0 Comments

ATTiny84 Based 3A Step-Down LED Driver

20170416_183517.jpg
20170416_183531.jpg
20170416_183541.jpg
20170416_183556.jpg
20170416_183606.jpg
20170416_205853.jpg
20170416_220348.jpg

If you want to power 10W LEDs, you can use this 3A LED driver. With 3 Cree XPL LEDs, you can achieve 3000 lumens!

PCB

Screenshot 2017-04-16 21.53.57.png

I upgraded the circuit with:

  • An IRF9540N transistor
  • Two SS36 diodes in parallel for a higher current rating

Please feel free to make changes to the circuit!

Completed Circuit Board

20170415_214827.jpg
20170415_214816.jpg
20170415_214847.jpg
20170415_214737.jpg
20170415_220611.jpg

Microcontroller Code

Screenshot 2017-04-16 21.38.05.png

In the program, I've set the maximum drive current to 2.5A. You can experiment with higher values, such as 2.9A. It seemed to trigger the battery monitor at 3A. Using an inductor with a higher current rating should solve the problem.

If you're adjusting the feedback voltage, make sure that your calculations are correct for the current sense resistor value.

I set the battery monitor's trip voltage for 12V SLA batteries.

For a higher switching frequency, I used a 20 MHz crystal oscillator.

Possible Use for the Replaced LED Driver

ATtiny84 Based 700mA Step-Down Driver Powering Red LEDs
20170416_182315.jpg
20170416_182349.jpg
20170416_182359.jpg
20170416_182407.jpg
20170416_182416.jpg
20170416_221135.jpg
20170416_221143.jpg
20170416_221150.jpg
20170416_221157.jpg
20170416_221204.jpg

I used the previous LED driver for driving 4 - 700mA red LEDs powered by a 12V 1.3Ah SLA battery. I reduced its drive current to 650mA.

Here are the pictures of the new unit with the lower current driver.

Other Possible Uses for the New Driver

20170416_220650.jpg
20170416_220733.jpg
20170416_220744.jpg
20170416_220749.jpg
20170416_220755.jpg
20170416_220759.jpg
  • LED lamps
  • Flashlights
  • Bike Lights
  • Headlamps
  • Grow lights
  • Constant current source
  • Driving 10W, 20W, 50W, 100W LED chips from eBay

Code Updated on (April 17, 2017)

This code was updated to have a soft start when turning on or adjusting its drive current. This can reduce its inrush current and reduce the risk of brown-outs although you can turn on brown-out detection..

Code Updated on (April 18, 2017)

This code was updated with:

  • Gradual decrease in drive current when shutting down or when the brightness counter overflows to avoid inrush current.
  • 5% increase in the battery cut-off voltage to account for the components' tolerance. It's better for the battery when you avoid overdischarging
  • Low battery warning removed to prevent crashing.

It was updated because the microcontroller crashed when the low battery warning was triggered.