Here I wanted to share Arduino-controlled synchronous buck DC-DC converter design that steps down a 12V input to a regulated lower output voltage (such as 5V) using a 50 kHz high-frequency PWM signal generated by the ATmega328P to drive an IR2104 high-and-low side MOSFET driver and a synchronous half-bridge power stage (IRLB8721, IRLB8721).
I had tested a buck converter designed with Arduino as PID controller in my previous blog post How to design Arduino buck converter with feedback. That buck converter had several short comings and so here is an improved version of the DIY Arduino Buck Converter.
Arduino-controlled synchronous buck DC-DC converter Circuit Diagram:
Features
- Microcontroller-Based Digital Control: Uses an Arduino Uno running a 1 kHz closed-loop PID control algorithm with input-voltage feedforward. It uses Fast PWM mode for PWM switching.
- Synchronous Rectification: Employs dual N-channel MOSFETs (IRLB8721, IRLB8721) and an IR2104 driver to improve efficiency compared to standard diode-freewheeling buck converters.
- Flexible Setpoint Control: Output voltage can be adjusted dynamically via a potentiometer (RV1) on analog input A0 or by entering a target voltage directly through the serial monitor.
- Protective Features: Includes software current limiting with foldback, under-voltage lockout, and auto-retry (hiccup) protection modes.
- High-Frequency PWM: Utilizes Timer1 configured for 50 kHz fast PWM on pin 9 (OC1A) with a 320-step resolution.
Advantages
- High Efficiency: Synchronous rectification drastically reduces conduction and switching losses during freewheeling periods.
- Precise Regulation: Feedback loop via voltage divider R3/R4 on A1 ensures steady output voltage under varying load conditions.
- Cost-Effective & Adaptable: Combines open-source hardware flexibility with robust power management components ideal for prototyping and educational use.
Program Code
Video Demonstration
Test Results
When POT is set to 25%, the output waveform:
When POT is set to 50%, the output waveform:
When POT was set to 75%, the output voltage waveform is shown below:
Related tutorials and downloa links:
- Motor Controller design with IR2104, IRF540N controlled by Arduino
- How Inverter H-bridge circuit works?
- MP1584 Spice Model | Download Free
- MP1584 Buck Converter Module Proteus Library | Download Free
- Simulation and Design of MP1584 IC Buck Converter IC
- Arduino PID Controller - Temperature PID Controller
1 min read


