Arduino Buck-Boost Converter

45,474

78

52

Introduction: Arduino Buck-Boost Converter

About: I,m an Electronics Engineer. Love to make things work. Believe in Learn by Making it.

Today i,m gonna tell you how to make a buck-boost converter with all the modern features by yourself. There are many power supplies are available in market but making one by yourself is something awesome. with your custom made supply you can make conditions to charge your battery packs, or get desired voltages for your projects and much more. So lets do it...

with the help of this project i also developed a smps solar charger with 400 Watt power rating and more than 90% efficiency.. have a look in video....

Step 1: Getting Into

Buck and Boost converters are a type of power conversion topology. Buck converters are used to step down the high voltage dc to low voltage dc. and Boost converters do just opposite i.e.changing low voltage to high voltage. same thing is done by transformers but they can't convert DC voltage and they are not much efficient.

Both type of converters first convert DC voltage to High frequency AC and then again rectifies it to pulsed DC or continuous DC based upon mode of operation. There are following items needed to build the boost and buck converters.

  • Arduino (Nano or Uno) x 1
  • N-channel MOSFET (IRF Z44n) x 1
  • P- channel MOSFET (IRF9Z24n) x 1
  • 100uH inductor (or calculate for your need) x1
  • 220uF/35V Capacitor x 2
  • 100uF/25v Capacitor x 1
  • 100 Ohm/2W resistor x 1
  • ACS 712 current sensor (5A or 30A) x 1
  • 4.7k resistor x 4
  • 1k resistor x 2
  • Schottky diode (SR5A0 or any other) x 2
  • Screw terminals x2

Step 2: Buck - Boost Converter Circuit

As you can see in circuit there are two switches are used Tr1 and Tr2. Tr1 switch is being used in buck mode and Tr2 is for boost mode. diode D1 is for buck and D2 for boost. Capacitor C2 is output capacitor for storing power and delivering it to the load. Inductor L is the key part of any DC-DC converter. R load is the load resistor to discharge the output capacitor. there are two voltage dividers are used to measure the input and output voltages. and ACS712 is used to measure the output current.

Step 3: Building the Converter

Make this circuit on a zero PCB. First we solder the mosfets, inductor, capacitors etc. then make links between them. also solder female burge pin header for arduino nano and current sensor. make voltage divider and connect them to input, output and arduino. give power to arduino by connecting vin on arduino to Vin on Ckt. also don't forget to make all the grounds common. I have here used to output capacitors to reduce the ERS. connect load resistor to output terminals. Connect the Arduino pins as Following.

A0 to output of ACS712, A1 to Vin_sense, A2 to Vout_sense. D5 to Boost_pwm of Tr2 and D6 to Buck_pwm of Tr1.

I,m giving input by Serial port. you can connect buttons to enter the voltage and currents.

Step 4: Programming Arduino

Arduino is the Heart and Brain of this project. it produces the high frequency PWM for Mosfet switching and also controls the voltage and current.

Generally the PWM frequency of arduino pins are two low. it,s around less than 1Khz. which is not suitable for DC-DC converter operation. Meanwhile Atmega328 is able to provide 62.5KHz PWM on pin 5 & 6 , 32KHz on other pins with the 16MHz clock. To achieve this we have to hack into Arduino PWM. I have modified the Timer 0 config to get the 62KHz PWM. but it costs millis() and delay() functions. as they will work 64 times faster then normal.

Get the Buck_Boost_Converter.ino File for firmware.

Step 5: Testing

As your Circuit is ready it,s the time to test it. plugin a 9v battery to input and enter the voltage you want at output and watch it working. adjust the sensor offset values to get the precise voltage sensing.

Arduino Contest 2016

Participated in the
Arduino Contest 2016

Be the First to Share

    Recommendations

    • Toys & Games Contest

      Toys & Games Contest
    • Big vs Small Challenge

      Big vs Small Challenge
    • Fix It Challenge

      Fix It Challenge

    52 Comments

    0
    parikshitdixit04
    parikshitdixit04

    Question 4 weeks ago

    I am making a battery powered product and I need different voltage levels in the circuit so I am using buck-boost converter. Following what you have done, I wanted to ask how do I power arduino from the battery? As my battery is 4S LIPO.

    Hello dear friend
    Your project is excellent
    In wich part of the circuit should the current sensor be connected?

    0
    abhiV4
    abhiV4

    Reply 7 weeks ago

    It should be at output. You can connect on +ve or -ve outputs. But it’ll be better to connect at -ve.

    0
    mohammadrezafarzizadehardabili
    mohammadrezafarzizadehardabili

    Reply 7 weeks ago

    Thank you very much engineer for guidance
    What should we do to change the output voltage?

    0
    Iqbal Samin
    Iqbal Samin

    Tip 2 years ago

    It will work much better with logic level MOSFETs such as:


    N-channel MOSFET: IRLZ44n

    P-channel MOSFET: IRLZ24n

    0
    abhiV4
    abhiV4

    Reply 1 year ago

    not really. it's good to have logic level mosfets but with low gate voltage causes higher Rds on resistance which results in power losses. but for low currents yes they are good, because of no need of gate driving circuit.

    0
    Iqbal Samin
    Iqbal Samin

    Reply 10 months ago

    imho that doesn't make any sense. Because you are using a non logic level MOSFET at logic level. It will have higher Rds than a logic level MOSFET would have which is specifically designed to work at a logic level.

    0
    abhiV4
    abhiV4

    Reply 10 months ago

    Irfz44n is a logical mosfet. So it will not face high Rds on issue that much. On the other side P channel mosfet needs -ve voltage at it's gate. Which is -12 to -20v in above ckt. Depends upon input voltage. Thus it's not switched on at ttl level
    But if anybody wants to use low input voltage application then proper mosfets should be chosen as u mentioned in ur previous comment.
    When going above 20v then also they will need proper gate driver ckt or dedicated gate driving ic.
    I hope it makes sense now...🙂

    0
    Iqbal Samin
    Iqbal Samin

    Reply 10 months ago

    IRFZ44N is not logic level. IRLZ44N is. IRFZ44N barely turns on at all at 5V from my previous experience. Maybe you're mistaking between IRLZ44N and IRFZ44N

    0
    abhiV4
    abhiV4

    Reply 10 months ago

    Could be... but as i studied the datasheet of irfz44n , it states gate threshold voltage from 2-4v only. And it switches on at 4v as well with high Rds. While other mosfet needs 10v. As they have min 10v threshold.
    Anyways as i told before chossing mosfet depends upon working voltage. Irfz44n was serving my need. I tried irf540 before and that have Rds problems at lower voltage then 10v.

    Screenshot_20200701-214910_Office.jpg
    0
    stevench118
    stevench118

    Question 1 year ago on Step 5

    Can this buck boost use for upto 30A ?
    i need to use as Powersupply to control my system

    0
    SaiS164
    SaiS164

    1 year ago

    can you share the schematic diagram clearly??

    0
    EvrimK1
    EvrimK1

    1 year ago

    Hi how can I apply this on a 3.7V Lithium Battery?

    2
    sk492029
    sk492029

    Question 1 year ago on Step 5

    Serial was not declare in this scope

    15715089687384994088901798685249.jpg
    0
    BambangP4
    BambangP4

    Question 1 year ago

    hello sir,
    i've made buck-boost converter with ur guide and calculate repeatly.
    but everything i've done, the buck converter (mode buck) it doesn't work, it's like step down output voltage just like 1-2 volt.
    can u tell me what's wrong with my project?
    please help me

    0
    hamzasab
    hamzasab

    1 year ago

    did anyone had the proper code? because the code used is different from the one provided to download.

    0
    mrhojati
    mrhojati

    3 years ago

    Hi. I can not run my buck-boost.I made the circuit as your guidance but it doesn`t work. please help me. What should I do?

    Thanks

    0
    abhiV4
    abhiV4

    Reply 3 years ago

    what is the problem you are facing?

    0
    hamzasab
    hamzasab

    Reply 1 year ago

    it always shows in monitor the charging complete and the battery is not even charged, there is no current flowing to the battery. help me please asap