You can increase the switching frequency of microcontroller based LED drivers by using a faster crystal oscillator. A 20 MHz oscillator was used to increase it to from 31.25 kHz to 78.125 kHz.
With a higher switching frequency, you can:
- increase the LED string's drive current
- increase the LED string's forward voltage
- decrease the input voltage
- decrease the input and output capacitor's value
- decrease the inductor's value
You can use this circuit for LED lamps, testing LEDs, testing other components, and other projects that require a constant current source.
Step 1: Component Selection
To calculate the component values, enter the parameters for the boost LED driver.
It will calculate the values for the:
- Inductor rating
- Switch rating
- Diode rating
- Output capacitor
- Current sense resistor
Make sure that their absolute maximum ratings aren't exceeded.
Note that with a higher switching frequency, the ripple current decrease, allowing a higher average inductor and current.
Step 2: Driver Board
The circuit's very similar to my previous microcontroller based boost converters. The main difference is that a 20 MHz oscillator was used. A 24V zener diode was selected in case of open voltage or too high of an LED string voltage. If the output exceeds 24.7V, the NPN transistor turns on, causing the microcontroller to reset which protects the MOSFET, output capacitor, and Schottky diode from overvoltage.
Note that the drive current was selected for a 0.82 ohm current sense resistor.
Step 3: Program for the ATtiny85
In this program, you can set the:
- drive current
- PWM frequency
- maximum duty cycle
You can modify the code to add other features such as strobe light, timer, turning off the LED, and sleep mode.
Step 4: LED Driver Measured With an Oscilloscope
The LED driver was tested with:
- 6 white LEDs
- 12V power supply
Modes 0 through 4 were used. The drive currents were up to 700 mA.