Introduction: ATTiny84 Based 3A Step-Down LED Driver

About: Autistic person who's interests include utility cycling, recreational cycling, cycling safety, electronics, gardening, Arduino, and LEDs.

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

Step 1: PCB

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!

Step 2: Completed Circuit Board

Step 3: Microcontroller Code

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.

Step 4: Possible Use for the Replaced LED Driver

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.

Step 5: Other Possible Uses for the New Driver

  • LED lamps
  • Flashlights
  • Bike Lights
  • Headlamps
  • Grow lights
  • Constant current source
  • Driving 10W, 20W, 50W, 100W LED chips from eBay

Step 6: 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..

Step 7: 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.

Microcontroller Contest 2017

Participated in the
Microcontroller Contest 2017

Lights Contest 2017

Participated in the
Lights Contest 2017