Arduino-based High Powered Switching LED Drivers




Introduction: Arduino-based High Powered Switching LED Drivers

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

I wrote this Instructable because I really wanted an LED driver that is efficient and simple to construct. This LED driver can be used for high powered LEDs such as 0.5W, 1W, 3W, 5W, and 10W LEDs. It can drive up to six LED strings and includes open and short circuit protections and brightness adjust buttons. For extra power, you can use ATX power supplies or car batteries. Each channel allows 24 W boost mode when using 12 V.


  • Topology options: Boost, buck
  • Operating frequency: 62.5 kHz (adjustable)
  • Feedback voltage range: 0 to 1095 mV
  • Input voltage range: 5 to 40V
  • Maximum string voltage: 50V
  • Efficiency: 80 to 90%

Step 1: Materials

Buck LED driver (per channel)

  • Rsense resistor (see table)
  • 1 - 10 ohm resistor
  • 1 - 150 ohm resistor
  • 3 - 1k resistor
  • 2 - 10M resistors
  • 1 - 220 uF capacitor
  • 1 - 470 uF capacitor
  • 1 - tactile switch
  • 1 - 100 uH 2A inductor
  • NPN transistor
  • PNP transistor
  • 2N7000 MOSFET
  • IRFZ44N power MOSFET

*For Vin larger than 20V, refer to the circuit diagram

Boost LED driver (per channel)

  • Rsense resistor (see table)
  • 1 - 4.7k resistor
  • 1 - 10 ohm resistor
  • 1 - 150 ohm resistor
  • 3 - 1k resistor
  • 2 - 10M resistors
  • 1 - 1 nF capacitor
  • 1 - 220 uF capacitor
  • 1 - 470 uF capacitor
  • 1 - tactile switch
  • 1 - 1N4001 diode
  • 1 - schottky diode
  • 1 - 100 uH 2A inductor
  • NPN transistor
  • PNP transistor
  • 2N7000 MOSFET
  • IRFZ44N power MOSFET

LED driver (other components)

  • 1 - Arduino
  • 5 to 40V Power supply
  • 1 - 48 V zener diode
  • 1 - NPN transistor

When designing the circuits, please wear goggles! Capacitors can explode when overcharged or installed incorrectly.

Step 2: Buck LED Driver

The buck LED driver is used if the supply voltage is higher than the LEDs' combined forward voltages. For example, you may want to use a 12V source to power a single LED which requires 3.5V. This circuit is similar to that of the constant voltage source's except that this is constant current.

On the right side of the diagram, the voltage divider formed by R3 and R4 is used to prevent the power MOSFETs' Vgs from exceeding -20V which is usually the absolute maximum rating. If the supply voltage is 20 or less, omit R4 and use 4.7k for R3.

For supply voltages greater than 20V, use the following formula to calculate R3:

  • R3<20*R4/(Vcc-20)

Step 3: Boost LED Driver

The boost LED driver is used when the power supply's voltage is lower than that of the LEDs' combined forward voltages. For example, you want to use a 12V power supply to power a string of 6 LEDs which require around 20V. I have improved the efficiency by including an amplifier before the power MOSFET instead of using the Arduino's 5V. When the MOSFET's gate voltage is higher, less power is wasted when it is on and it runs. The drawback is that the PWM signal needs to be inverted but that's easily solved by modifying the code.

This circuit has an over-voltage detection. Disconnected LEDs or too many LEDs in a string causes overvoltage which can destroy the LED driver channel. When the voltage on any of the outputs exceed the zener voltage, Q5 turns on and pulls pin 0 low. This dims all of the LEDs until the condition is resolved.

Step 4: Sketches

The Arduino is used to monitor the LED current, maintain the LED current for each channel, read the momentary switches for brightness control, and detect overvoltage. When the LED current flows through Rsense, there is a voltage drop. The Arduino maintains it between 0 and 1095 mV depending on the feedback voltage setting. The LED current is equal to Vfeedback/Rsense. There is one brightness control switch for each channel. The channels have 10 levels of brightness and each press increments the brightness by 10% of the maximum current you have set it to. When one of the boost channels have overvoltage, Q5 turns on and the D0 input is pulled low. This sets the channels' duty cycles to the lowest.

In the sketches, you can modify the maximum duty cycle, operating frequencies, and feedback voltages, and select boost or buck mode. The higher the duty cycle, the higher the current. The operating frequency is the frequency of the Arduino's PWM output. It has nothing do with PWM dimming. If it's higher, you can use smaller inductors. If it's lower, you have have a smaller duty cycle because resolution increases. The LED current is equal to the feedback voltage divided by the Rsense value. Refer to the table for the feedback voltages and the sketch for more instructions. If boost mode is selected for a given output, the waveform will be inverted.

There are two sketches for the LED driver:

  • Six output sketch - use when more than four channels are required
  • Four output sketch - use when you need more than two channels with smaller inductors

Step 5: Applications

I can think of many applications for this LED driver. For example:

  • Arduino projects
  • Bike lights
  • Automotive lighting
  • High powered flashlights
  • Grow lights
  • Aquariums
  • LED lamps



    • Metalworking Contest

      Metalworking Contest
    • Water Contest

      Water Contest
    • Tiny Home Contest

      Tiny Home Contest

    16 Discussions

    Hwo can I calculate the values in the table? (like power dissipation and Rsense value)

    Would it be possible to use this with a DMX library to control the LEDs over DMX?

    which sketch do i have To use if i just want To drive one 15w led?

    2 replies

    Hey buddy I appreciate your information very much, I am going to build this into some things. I am new to arduino (this will be my first thing). I was wondering if I can control this with PWM or somehow integrate a potentiometer in order to dim (even if a 555 dimming circuit is necessary but that can only dim to 5%). Perhaps another arduino so I can control red blue green and white independently (as you have but with a higher degree of control from the potentiometer); then control the overall brightness of them all with a single controller (allowing me to tune a particular shade of white with pwm, then increase or lower the brightness if I do not exceed any single channel's maximum limits). I also really like the combination of fine control and easy control that happens with a dimming knob.

    2 replies

    You can use a potentiometer to dim it. You would need an to use an ADC pin to read the potentiometer's voltage and store it in the variable desiredAnalogReading[i]. You would need a voltage divider to limit the range of the potentiometer to between 0 and 1.1V because internal analog reference was used.

    If you want to try PWM dimming, you could use a code like this:




    else if(input==LOW){



    You would have to experiment with the 555 timer's frequency. Flickering might be noticeable.

    I'll experiment with this as soon as I can :) thanks for the reply, it
    will be some time but I will respond back when I need more help (likely)
    or when I have finally finished. I will not use a 555 for dimming, this is the old method I used to use but it has many limitations.

    hi how are you? i need drive a 100w led forward voltage is 32-36vdc and 3amps, with your boost circuit is possible and power supply of 12v? sorry my bad english im from venezuela. thanks for your reply

    1 reply

    Realy good design, like to try this but are newbe. Can you explain a bit more about that Rsense resistor. can't place it in the design. is it R8?



    2 replies

    Thanks John! The Rsense resistor is needed for the Arduino to measure the current through the LEDs. Since it's in series with the LEDs, its voltage reading is proportional to the LEDs' current. It's R6 for the buck converter and R8 for the boost converter.

    Thanks for the answer, is what i thought, going to built it on breadbord. want to use it as powersupply for my DIY diving lamp? thanks for sharing this :-)

    Wow, this is very creative! I really love your solution for High Powered LEDs. I want to use them more, the higher their output the more I want to use them. But I always have trouble adding them to a circuit because their requirements are so different. I'm going to take a closer look at this, and then I'm going to try to use this in the Aquaponic Instructable I recently posted. What do you think about that? Do you think that putting High Power LEDs underwater as grow lights would work? I am concerned both about safety and efficiency. Do you think I should take the time to do some small tests first?

    1 reply

    Thanks JR Tyner. I really like your idea for air purification. I think the water will be too hot when the LEDs are submerged. How many are you using? Are you using the LEDs for decorative purposes? I would recommend testing it first.