DC to DC buck-boost converter

DC to DC buck-boost converter

The buck–boost converter is a type of DC-to-DC converter that has an output voltage magnitude that is either greater than or less than the input voltage magnitude. It is equivalent to a flyback converter using a single inductor instead of a transformer.

In this tutorial we will learn how to build and how a DC to DC buck-boost converter works. The circuit is very basic using just one diode, an inductor and a capacitor. The switch will be a MOSFET transistor and to create the PWM signal we will use a 555 timer in the PWM configuration, boost adjustable controller or one Arduino NANO. But first let’s study a little bit of theory. We have the buck-boost converter circuit in the next figure where we can see the switch, inductor and capacitor and of course we add a load to the output.

Buck-Boost converter theory

Like the buck and boost converters, the operation of the buck-boost is best understood in terms of the inductor’s “reluctance” to allow rapid change in current. From the initial state in which nothing is charged and the switch is open, the current through the inductor is zero. When the switch is first closed, the blocking diode prevents current from flowing into the right hand side of the circuit, so it must all flow through the inductor. However, since the inductor doesn’t like rapid current change, it will initially keep the current low by dropping most of the voltage provided by the source. Over time, the inductor will allow the current to slowly increase by decreasing its voltage drop. Also during this time, the inductor will store energy in the form of a magnetic field. We have the switch closed so in this case we obtain the current through the inductor using the next formulas.

When the switch is opened, current will be reduced as the impedance is higher. The magnetic field previously created will be destroyed to maintain the current towards the load.
In this case the voltage across the inductor is the output voltage. So once again using the next figure formulas we obtain the current of the OFF part depending on the duty cycle.

Ok, now if we want to obtain the output depending on the input and the duty cycle of the PWM all we have to do is to make the sum of the On and Off current equal to 0. That means that the On current is equal to the Off current. So that will give us:

So we’ve obtain that the output is depending of the duty cycle disproportionate and also proportional. The duty cycle of the PWM can have values between 0 and 1. In this way we could achive both higher and lower voltages than the onput. That’s why this configuration is called step down-up converter.

Buck-Boost converter circuit 555 timer

This 555 configuration will create a PWM signal and apply that signal to the MOSFET gate. The circuit works ok but it has a big problem. The output will change if we change the output load because the circuit has no feedback. Ok so we will use the next schematic for our buck-boost converter example. To create the PWM signal we will use the 555 timer with the PWM configuration. With the P1 potentiometer we can change the duty cycle of the PWM signal, and at the same time the output value. For the MOSFET you could use the PMOS IRF4905. You could always try different inductance values for the inductor and see the results.

The input could be up yo 15 volts. Don’t apply higher voltage or you could burn the 555 timer. Connect the PWM (pin 3 of the 555 timer) to the MOSFET (switch) gate. Add an output load and test the circuit. You could obtain output values higher than the input.

Buck-Boost converter Arduino NANO

Sincerely, this circuit has no sense but to learn. The Arduino NANO already has a 5V linear voltage regulator that will lower the efficiency of the circuit. So the main goal is to learn how the circuit, the feedback and the PWM signal work in order to achive the desired output.

As you can see we have a potentiometer connected to the analog input A0. With this potentiometer we will choose the output value between 1 and 50 volts aprox (your output values may vary). At the output of the circuit we have a voltage divider that will lower the voltage from maximum 50V to under 5 volts because that’s the maximum input voltage of the Arduino ADCs. In the code we compare this two voltages and increase or decrease the PWM width in order to keep the output constant. Just copy and upload the next code to the Arduino for this example.

//https://www.youtube.com/c/ELECTRONOOBS
//SUBSCRIBE, Thank you!
int potentiometer = A0;
int feedback = A1;
int PWM = 3;
int pwm = 0;

void setup() {
  pinMode(potentiometer, INPUT);
  pinMode(feedback, INPUT);
  pinMode(PWM, OUTPUT);  
}

void loop() {  
  float voltage = analogRead(potentiometer);
  float output  = analogRead(feedback);

  if (voltage > output)
   {
    pwm = pwm+1;
    pwm = constrain(pwm, 0, 255);
   }

  if (voltage < output)
   {
    pwm = pwm-1;
    pwm = constrain(pwm, 0, 255);
   }

   analogWrite(PWM,pwm);
}

DC to DC buck converter

DC to DC buck converter

A buck converter (step-down converter) is a DC-to-DC power converter which steps down voltage (while stepping up current) from its input (supply) to its output (load). It is a class of switched-mode power supply (SMPS) typically containing at least two semiconductors (a diode and a transistor, although modern buck converters frequently replace the diode with a second transistor used for synchronous rectification) and at least one energy storage element, a capacitor, inductor, or the two in combination. To reduce voltage ripple, filters made of capacitors (sometimes in combination with inductors) are normally added to such a converter’s output (load-side filter) and input (supply-side filter).

In this tutorial we will learn how to build and how a DC to DC buck converter works. The circuit is very basic using just one diode, an inductor and a capacitor. The switch will be a MOSFET transistor and to create the PWM signal we will use a 555 timer in the PWM configuration, boost adjustable controller or one Arduino NANO. But first let’s study a little bit of theory. We have the Buck converter circuit in the next figure where we can see the switch, inductor and capacitor and of course we add a load to the output.

2.0 Buck converter theory

Ok, so we have the next circuit. In order to study how it works, we will divide it in two stages. The ON and OFF stages. In the ON part, the switch is closed as we can see in the next figure where the diode is open becasue the cathode voltage is higher than the anode. When the switch is first closed (on-state), the current will begin to increase, and the inductor will produce an opposing voltage across its terminals in response to the changing current. This voltage drop counteracts the voltage of the source and therefore reduces the net voltage across the load. Over time, the rate of change of current decreases, and the voltage across the inductor also then decreases, increasing the voltage at the load. During this time, the inductor stores energy in the form of a magnetic field. If the switch is opened while the current is still changing, then there will always be a voltage drop across the inductor, so the net voltage at the load will always be less than the input voltage source. When the switch is ON the inductor will charge up and the voltage on the inductor will be the difference between the output and the input. But we also know that the inductor voltage is the inductance L multiplied by the inductor current derivate. As we can see in the next figure we obtain the ON current through the inductor.

When the switch is opened again (off-state), the voltage source will be removed from the circuit, and the current will decrease. The decreasing current will produce a voltage drop across the inductor (opposite to the drop at on-state), and now the inductor becomes a Current Source. The stored energy in the inductor’s magnetic field supports the current flow through the load. This current, flowing while the input voltage source is disconnected, when concatenated with the current flowing during on-state, totals to current greater than the average input current (being zero during off-state). The “increase” in average current makes up for the reduction in voltage, and ideally preserves the power provided to the load. During the off-state, the inductor is discharging its stored energy into the rest of the circuit. If the switch is closed again before the inductor fully discharges (on-state), the voltage at the load will always be greater than zero.

In this case the voltage across the inductor is the output voltage. So once again using the next figure formulas we obtain the current of the OFF part.

Ok, now if we want to obtain the output depending on the input and the duty cycle of the PWM all we have to do is to make the sum of the On and Off current equal to 0. That means that the On current is equal to the Off current. So the will give us:

So we’ve obtain that the output is the input multiplied by the duty cycle. The duty cycle of the PWM can have values between 0 and 1. So te only posible output will be equal or lower than the input. That’s why this configuration is called step down converter.

3.0 Buck converter Arduino NANO

Sincerely, this circuit has no other sense but to learn. The Arduino NANO already has a 5V linear voltage regulator that will lower the efficiency of the circuit. So the main goal is to learn how the circuit, the feedback and the PWM signal work in order to achive the desired output.
See the full part list here: 

3.1 NO FeedBack

As you can see in the schematic above we have a potentiometer connected to the analog input A0. With this potentiometer we will choose the output value between 1 and 12 volts since the maximum input voltage in this case is 12V. With the Arduino’s ADC we will read a value between 0 and 1024, next, in the code we map that value from 1 to 244 which are the values used with the analogWrite function of the arduino. With this we will apply a PWM signal on pin D3 where 1 is the lowest duty cycle and 244 the maximum. Since the arduino digital value is 5V we add a small BJT driver using one S8050 NPN and two resitors of 10k and 1k. The output of this driver is connected to the gate of the IRF4905 P-MOSFET.

Connect everything as in the schematic above and upload the next code to your Arduino and start moving the potentiometer. Observe the otput on the oscilloscope.
Download the NO FEEDBACK code here: 

Ok so ,this circuit could increase and decrease the voltage and keep that value steady for the same LOAD, in this case a 100 ohm resistor, as we can see in the picture below. But if we change the output load the discharge time of the output will change as well since for lower loads there will be a higher amount of current passing. So if the discharging time is faster or slower the duty cycle should change as well. For that we should add a feedback system to our circuit that would sense the output voltage and correct the PWM duty in order to keep the same desired value.

3.2 FeedBack

Let’s add the feedback to our circuit. As you can see in the schematic below we have a potentiometer connected to the analog input A0 as before. With this potentiometer we will choose the desired output value between 1 and 12 volts since the maximum input voltage in this case is 12V. At the output of the circuit we have nowa voltage divider that will lower the voltage from 12V to under 5 volts because that’s the maximum input voltage of the Arduino ADCs. Check the formula below to understand how the voltage divider works. If you apply a higher voltage to the input than 12V you should change the values of R1 and R2 in order to always have a voltage below 5V for the ADC.


In the code we compare this two voltages and increase or decrease the PWM width in order to keep the output constant. Just copy and upload the next code to the Arduino for this example.
Connect everything as in the schematic above and upload the next code to your Arduino and start moving the potentiometer. Observe the otput on the oscilloscope.

int potentiometer = A0;
int feedback = A1;
int PWM = 3;
int pwm = 0;

void setup() {
  pinMode(potentiometer, INPUT);
  pinMode(feedback, INPUT);
  pinMode(PWM, OUTPUT);  
  TCCR2B = TCCR2B & B11111000 | B00000001;    // pin 3 and 11 PWM frequency of 31372.55 Hz
}

void loop() {  
  float voltage = analogRead(potentiometer);
  float output  = analogRead(feedback);

  if (voltage > output)
   {
    pwm = pwm-1;
    pwm = constrain(pwm, 1, 254);
   }

  if (voltage < output)
   {
    pwm = pwm+1;
    pwm = constrain(pwm, 1, 254);
   }

   analogWrite(PWM,pwm);
}

Buck converter LM2576T-ADJ circuit

With this component we have feedback and the output will stay the same using different loads. Just make the connections, add the input capacitor to have a steady input and you’re done.

The input could be in range of 5 to 55 volts. Don’t apply higher voltage or you could burn LM2576T-ADJ component. In this case we need no external switch since the LM2576T-ADJ already has it inside it. With the feedback pin connected to the output voltage divider, the LM2576T-ADJ will change the width of the pulse depending of the output in order to keep it constant. In this case use a Schottky Barrier Rectifier diode because it has a low forward voltage. This diode will live the current flow when the switch is open.

3.0 Buck converter circuit 555 timer

This 555 configuration will create a PWM signatl and apply that signal to the MOSFET gate. The circuit works ok but it has a big problem. The output will change if we change the output load because the circuit has no feedback. Ok so we will use the next schematic for our buck converter. To create the PWM signal we will use the 555 timer with the PWM configuration. With the P1 potentiometer we can change the duty cycle of the PWM signal, and at the same time the output value. For the MOSFET you could use the IRF4905 P channel mosfet. You could always try different inductance values for the inductor and see the results.

The input could be in range of 5 to 15 volts. Don’t apply higher voltage or you could burn the 555 timer. Connect the PWM (pin 3 of the 555 timer) to the MOSFET (switch) gate. Add an output load and test the circuit. You could obtain output valuew between 1V and 15V.

DC to DC boost converter

DC to DC boost converter

A boost converter (step-up converter) is a DC-to-DC power converter that steps up voltage (while stepping down current) from its input (supply) to its output (load). It is a class of switched-mode power supply (SMPS) containing at least two semiconductors (a diode and a transistor) and at least one energy storage element: a capacitor, inductor, or the two in combination. To reduce voltage ripple, filters made of capacitors (sometimes in combination with inductors) are normally added to such a converter’s output (load-side filter) and input (supply-side filter).

In this tutorial we will learn how to build and how a DC to DC boost converter works. The circuit is very basic using just one diode, an inductor and a capacitor. The switch will be a MOSFET transistor and to create the PWM signal we will use a 555 timer in the PWM configuration, boost adjustable controller or one Arduino NANO. But first let’s study a little bit of theory. We have the Boost converter circuit in the next figure where we can see the switch, inductor and capacitor and of course we add a load to the output.

1.0 Boost converter theory

Ok, so we have the next circuit. In order to study how it works, we will divide it in two stages. The ON and OFF stages. In the ON part, the switch is closed as we can see in the next figure where the diode is open becasue the cathode voltage is higher than the anode. The key principle that drives the boost converter is the tendency of an inductor to resist changes in current by creating and destroying a magnetic field. In a boost converter, the output voltage is always higher than the input voltage. When the switch is closed, current flows through the inductor in clockwise direction and the inductor stores some energy by generating a magnetic field. Polarity of the left side of the inductor is positive. So in this case we obtain the current through the inductor using the next formulas.

When the switch is opened, current will be reduced as the impedance is higher. The magnetic field previously created will be destroyed to maintain the current towards the load. Thus the polarity will be reversed (means left side of inductor will be negative now). As a result, two sources will be in series causing a higher voltage to charge the capacitor through the diode D.

In this case the voltage across the inductor is the diffrence between the output voltage and the input. So once again using the next figure formulas we obtain the current of the OFF part depending on the duty cycle.

Ok, now if we want to obtain the output depending on the input and the duty cycle of the PWM all we have to do is to make the sum of the On and Off current equal to 0. That means that the On current is equal to the Off current. So that will give us:

So we’ve obtain that the output is depending of the duty cycle disproportionate. So the bigger the Duty cycle gets, the higher will be the output. The duty cycle of the PWM can have values between 0 and 1. So the only posible output will be equal or higher than the input. That’s why this configuration is called step up converter.

2.0 Boost converter circuit 555 timer

This 555 configuration will create a PWM signatl and apply that signal to the MOSFET gate. The circuit works ok but it has a big problem. The output will change if we change the output load because the circuit has no feedback. Ok so we will use the next schematic for our boost converter example. To create the PWM signal we will use the 555 timer with the PWM configuration. With the P1 potentiometer we can change the duty cycle of the PWM signal, and at the same time the output value. For the MOSFET you could use both IRFL3205 or the IRF44N. You could always try different inductance values for the inductor and see the results.

The input could be up yo 15 volts. Don’t apply higher voltage or you could burn the 555 timer. Connect the PWM (pin 3 of the 555 timer) to the MOSFET (switch) gate. Add an output load and test the circuit. You could obtain output values higher than the input.

3.0 Boost converter LM2577-ADJ circuit

With this component we have feedback and the output will stay the same using different loads. Just make the connections, add the input capacitor to have a steady input and you’re done.

The input could up to 12 volts. Don’t apply higher voltage or you could burn LM2577-ADJ component. In this case we need no external switch since the LM2577-ADJ already has it inside it. With the feedback pin connected to the output voltage divider, the LM2577-ADJ will change the width of the pulse depending of the output in order to keep it constant. In this case use a Schottky Barrier Rectifier diode because it has a low forward voltage. This diode will live the current flow when the switch is open.

4.0 Boost converter Arduino NANO

Sincerely, this circuit has no sense but to learn. The Arduino NANO already has a 5V linear voltage regulator that will lower the efficiency of the circuit. So the main goal is to learn how the circuit, the feedback and the PWM signal work in order to achive the desired output.

Part list here 


As you can see we have a potentiometer connected to the analog input A0. With this potentiometer we will choose the output value between 1 and 50 volts aprox (your output values may vary). At the output of the circuit we have a voltage divider that will lower the voltage from maximum 50V to under 5 volts because that’s the maximum input voltage of the Arduino ADCs. In the code we compare this two voltages and increase or decrease the PWM width in order to keep the output constant. Just copy and upload the next code to the Arduino for this example.

int potentiometer = A0; //The input from the potentiometer is A0
int feedback = A1;      //The feedback input is A1
int PWM = 3;            //Digital pin D3 por PWM signal
int pwm = 0;            //Initial value of PWM width

void setup() {
  pinMode(potentiometer, INPUT);
  pinMode(feedback, INPUT);
  pinMode(PWM, OUTPUT);  
  TCCR2B = TCCR2B & B11111000 | B00000001;    // pin 3 and 11 PWM frequency of 31372.55 Hz
}

void loop() {  
  float voltage = analogRead(potentiometer);    //We read the value of the potentiometer, which is the desired value
  float output  = analogRead(feedback);         //We read the feedback, which is the real value

  //If the desired value is HIGHER than the real value, we increase PWM width
  if (voltage > output)
   {
    pwm = pwm+1;
    pwm = constrain(pwm, 1, 254);
   }
   
  //If the desired value is LOWER than the real value, we decreaase PWM width
  if (voltage < output)
   {
    pwm = pwm-1;
    pwm = constrain(pwm, 1, 254);
   }

   analogWrite(PWM,pwm);  //Finally, we create the PWM signal
}