Home > Projects > Motor Projects > DC-DC Buck Converter Circuit – How to Step Down DC Voltage

DC-DC Buck Converter Circuit – How to Step Down DC Voltage

Summary of DC-DC Buck Converter Circuit – How to Step Down DC Voltage


This project builds a 0–10 V, up to 6 A buck converter using an Arduino as a high-frequency PWM source and an N-channel MOSFET (IRF540N). A potentiometer adjusts the PWM duty cycle to vary the output voltage; an inductor, Schottky diode, and capacitor smooth the switched waveform. The Arduino runs PWM at ~65 kHz (timer register tweak) and reads the potentiometer on A1 to map values for PWM output on pin 6. The converter is demonstrated by dimming an LED and controlling a DC motor.

Parts used in the Buck Converter Circuit using Arduino and N-Channel MOSFET:

  • Arduino Uno
  • IRF540N (N-channel MOSFET)
  • Inductor (100 µH)
  • Capacitor (100 µF)
  • Schottky Diode
  • Potentiometer
  • 10k resistor
  • 100 ohm resistor
  • LED
  • Load (e.g., DC motor)
  • 12 V battery

In this project we are going to make a Buck Converter Circuit using Arduino and N-Channel MOSFET with a maximum current capacity of 6 amps. We are going to step down 12v DC to any value between 0 and 10v DC. We can control the output voltage value by rotating the potentiometer.

A buck converter is a DC to DC converter, which steps down DC voltage. It is just like a transformer with one difference; whereas transformer steps down AC voltage buck converter steps down DC voltage. Efficiency of buck converter is lower than a transformer.

DC-DC Buck Converter Circuit - How to Step Down DC Voltage

Key components of buck converter are mosfet; either n-channel or p-channel and high frequency Square Pulse Generator (either a timer IC or microcontroller). Arduino is used here as Pulse Generator, a 555 Timer IC can also be used for this purpose. Here we have demonstrated this Buck converter by controlling DC-Motor speed with Potentiometer, also tested the voltage using Multimeter. Check the Video at the end of this article.

Required Components:

  1. Arduino Uno
  2. IRF540N
  3. Inductor(100Uh)
  4. Capacitor (100uf)
  5. Schottky Diode
  6. Potentiometer
  7. 10k, 100ohm Resistor
  8. Load
  9. 12v Battery

Circuit Diagram and Connections:

Make connections as shown in circuit diagram above for DC-DC Buck Converter.

  1. Connect one terminal of inductor to source of mosfet, and another to LED in series with 1k resistor. Load is connected in parallel to this arrangement.
  2. Connect 10k resistor between gate and source.
  3. Connect capacitor in parallel to load.
  4. Connect positive terminal of battery to drain and negative to capacitor’s negative terminal.
  5. Connect p terminal of diode to negative of battery and n terminal directly to source.
  6. PWM pin of Arduino goes to gate of mosfet
  7. GND pin of Arduino goes to source of mosfet. Do connect it there or circuit will not work.
  8. Connect potentiometer’s extreme terminals to 5v pin and GND pin of Arduino respectively. Whereas wiper terminal to analog pin A1.

Function of Arduino:

As already explained, Arduino sends clock pulses to base of MOSFET. Frequency of these clock pulses is approx. 65 Khz. This causes very fast switching of mosfet and we obtain an average voltage value. You should learn about ADC and PWM in Arduino, which will clear you how high frequency pulses are generated by Arduino:

DC-DC Buck Converter Circuit - How to Step Down DC Voltage schematic

Function of MOSFET:

Mosfet is used for two purposes:

  1. For high speed switching of the output voltage.
  2. To provide high current with less dissipation of heat.

Function of inductor:
Inductor is used to control voltage spikes which can damage mosfet. Inductor stores energy when mosfet is on and releases this stored energy when mosfet is off. Since frequency is very high, value of inductance required for this purpose is very low (around 100uH).

Function of Schottky Diode:
Schottky diode completes the loop of current when mosfet is switched off and thus ensuring smooth supply of current to load. Apart from this, schottky diode dissipates very low heat and work fine at higher frequency than regular diodes.

Function of LED:
Brightness of LED indicates the step down voltage across load. As we rotate the Potentiometer, brightness of LED varies.

Function of potentiometer:

When wiper terminal of potentiometer is thrown off to different position, voltage between it and ground changes which in turn changes the analog value received by pin A1 of arduino. This new value is then mapped between 0 and 255 and then given to pin 6 of Arduino for PWM.

** Capacitor smooths out voltage given to load.

Why resistor between gate and source?

Even slightest noise at gate of MOSFET can turn it on, hence to prevent this from happening it is always advised to connect high value resistor between gate and source.

Code Explanation:

Complete Arduino code, for generating high frequency pulses, is given in the code section below.

Code is simple and self-explanatory, so here we have explained only few parts of code.

Variable x is assigned the analog value that is received from analog pin A0 of Arduino

x= analogRead(A1) ;

Variable w is assigned the mapped value which is between 0 and 255. Here the ADC values of Arduino are mapped to 2 to 255 using map function in Arduino.

w= map(x,0,1023,0,255) ;

Normal frequency of PWM for pin 6 is approx.1khz. This frequency is not suitable for purposes like buck converter. Hence this frequency must be increased to a very high level. This can be achieved using a one line code in void setup:

TCCR0B = TCCR0B & B11111000 | B00000001;// change frequency of pwm to 65 KHZ approx.

Working of DC-DC Buck Converter:

When circuit is switched on, mosfet switches on and off with a frequency of 65 khz. This causes inductor to store energy when mosfet is on and then give this stored energy to load when mosfet switches off. Since this happens at very high frequency, we get an average value of pulsed output voltage depending on the position of wiper terminal of potentiometer with respect to 5v terminal. And as this voltage between wiper terminal and ground increases so does the mapped value on pwm pin no. 6 of Arduino.

Read more: DC-DC Buck Converter Circuit – How to Step Down DC Voltage

Quick Solutions to Questions related to Buck Converter Circuit using Arduino and N-Channel MOSFET:

  • What is the input and output voltage range of this buck converter?
    Input is 12 V DC and output can be adjusted between 0 and 10 V DC using the potentiometer.
  • Which component generates the high frequency switching signal?
    Arduino is used as the high frequency square pulse generator for PWM switching.
  • What is the switching frequency used for the PWM?
    The Arduino PWM frequency is changed to approximately 65 kHz using a timer register tweak.
  • Why is an inductor used in this buck converter?
    The inductor stores energy when the MOSFET is on and releases it when the MOSFET is off, controlling voltage spikes and smoothing current.
  • What role does the Schottky diode play?
    The Schottky diode completes the current loop when the MOSFET switches off and dissipates very low heat, working well at high frequency.
  • How does the potentiometer affect output voltage?
    The potentiometer provides an analog voltage to Arduino A1 which is mapped and used to set PWM duty cycle, changing the average output voltage.
  • Where should the Arduino ground be connected?
    Arduino GND must be connected to the MOSFET source; otherwise the circuit will not work.
  • Why is a resistor placed between gate and source of the MOSFET?
    A gate-to-source resistor prevents slight noise from turning the MOSFET on unintentionally.
  • What is the purpose of the capacitor in the circuit?
    The capacitor smooths out the voltage supplied to the load by filtering the pulsed waveform.
  • Can this setup be used to control a DC motor?
    Yes; the article demonstrates controlling DC motor speed using the potentiometer-adjusted buck converter.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top