AVR Tiny Buck Converter

Recently, I was involved in a underwater ROV project. I was assigned to handle voltage conversion from up to 54V to 12V 12A, a pretty challenging task for someone who are not used to design power conversion circuit. The converter must be non-isolated to make sure that the communication line ground level is connected to the surface console.

I searched for dedicated buck converter IC that could handle 54V at the local component store, but it seems no manufacturer produce that IC. So, I built my own buck converter.

The theory behind the operation of [my] buck converter is as simple as this: switch on the transistor if the output voltage fall under target voltage, and switch off the transistor if the output voltage rise above target voltage. Analog comparator is used here to compare feedback voltage and a known reference voltage. No complicated calculation for PID, determining duty cycle, switching speed, etc.

So, here is the circuit:

Buck Converter

I used ATtiny 13 for the main buck controller. The MCU is powered by a simple zener regulator and resistor because it only need 6mA at 5V supply. The value of the resistor is calculated from sum of MCU current consumption and zener regulation current. For example, if the zener requires 3mA to regulate the voltage and the MCU requires 6mA to operate, the total current passing through the R5 resistor is 9mA. You could then calculate the required resistance if you know the expected range of input voltage. In this schematic, 2.2k will provide total current of 19mA  @48V for zener regulation and MCU supply. The power dissipated at the resistor well be quite high (P=VI=817mW) so make sure to choose high wattage resistor to avoid problems.

The MCU in configured to use its internal analog comparator and its internal 1.1V voltage reference. The output voltage is compared to the internal voltage reference to determine switching state of small power MOSFET Q5. I used voltage divider to provide voltage feedback from the output line to the MCU. Since the current leak of the MCU is low, you can choose high resistance value and low wattage resistors for the voltage divider.

Inrush current is an issue for every circuit with big capacitor. When the converter is switched on, the capacitor is fully discharged. The input line will try to fill this capacitor and this results in surge current, damaging the switching transistor. An NTC¬†(R7) is placed at the input line to suppress surge current and prolong the MOSFET’s life.

And here comes the important parts: inductors, capacitors, diode, and switching transistor. I chose MOSFET over BJT as the switching element to prevent any current fluctuation flowing through the MCU. The high-side MOSFET (the one connected to input line) must be a high-current P-channel MOSFET with low ON resistance and high blocking voltage. You can choose your MOSFET according to your needs and market availability. For the low side, choose an N-channel MOSFET. Current rating is not important here because of the high resistance of the P-channel gate drive mechanism. Just remember that the resulting output voltage of the voltage divider does not exceed the VGS rating of the high side MOSFET.

The inductor must be chosen accordingly to fulfill your regulator need. The wire gauge size of the inductor determine the current of the converter can supply. I put an inductor that was  scavenged from an old computer power supply. For the capacitor, just buy one with the biggest capacitance you can find at the local component store :D. And for diode, buy a good fast-switching diode (schottky) with the same current rating as the maximum current output of the regulator.

And here is the source code (only 10 lines in GCC):

#include <avr/io.h>
int main (void) {
 DDRB=0b00000100;
 PORTB=0b00000100;
 DIDR0=0x3F;
 ACSR=_BV(ACBG);
 for(;;){
  if(ACSR&(_BV(ACO)))PORTB=_BV(PORTB2);
  else PORTB=0;}
 return(0);}

2 thoughts on “AVR Tiny Buck Converter

  1. Pingback: 20-70V input to 13.8V output, switching step down..?

Leave a Reply

Your email address will not be published. Required fields are marked *