How to make a 12-24V dc-dc boost convertor with arduino

Please let us in the comment zone any suggestions that you think will improve the article!

If you like the article click the follow button  to stay in touch with us!


Because sometimes for my applications i need a specified voltage i decide to explain in this post how to create a dc-dc boost convertor without any formulas and with old parts  and an arduino uno .

I have used a 12V input voltage and 24V output voltage at different current values.

Firs of all let’s see a basic circuit diagram of this convertor:


From an arduino an N-channel MOSFET receive a PWM signal, which controls the current on the inductor. This inductor is an energy storage element, energy released on the load at a specified voltage which depends the duty cycle of the pwm signal.

Because on the arduino we have some analog pins we will read the voltage on the output and we will increase and decrease the duty cycles depending on the reading values.

In the image below is the complete schematic of the convertor:


As you can see we have two voltage dividers one to read the input voltage and make some alarm if the voltage drop under a  specified value and one on the output to control the voltage throught the duty cycle of the pwm.



Because the mosfet need a minimum 10 volts on the gate to conduct at a low Rds and the arduino pwm signal is at 5 volts we have use a TC4422 driver which copy the pwm on  the arduino and reproduce it at 12 volts in our case and because the mosfet is used in pwm mode at 62500Hz this driver support around 10A current from the switching.

This driver is easy to connect with other components(arduino and mosfet) and i recommend the 10.000pF capacitor to get an output signal with low noise.

Also on the output i use a 600 ohms resistor to be sure that the convertor never remain with no load(i use 2 x 3W 300 ohms resistor in series ), which are mounted on the board.

Of course when you are coupling some external loads the voltage will drop but the arduino will read a smaller value than 24V and it will increase the duty cycle until the voltage reach 24V.

Because the arduino use analogRead function the reading and the modification of the duty cycle is slow in(2-3 seconds reach 24Volts) but this method gives you an advantage if you have a variable load.

Another parts from the ones on the schematic we have a switch on the “+” side and a 2200uF capacitor on the input, mounted later.

As i mentioned above some of the components are from old PC power supply like the inductor:


I choose an inductor with an thicker wire to resist at a higher current.

The mosfet is an IRF1010e, the schottky diode an SBL3045pt also from an pc power supply. The capacitor on the output has 3300uF to have a stable voltage.

The switch:


For protection i used a fuse(in the picture is one at 3A and 5x20mm but in the videos is one of 10A):

The entire board is:



On the left side is the input on the right the output, 3 wires-one for reading input voltage, one for reading output voltage, one for the input pwm in the driver and one LED to see if we have an input voltage.

The maximum load i have was 4×8.2 ohm 10W resistors two by two in series and the series montage in parallel with an equivalent resitance at 8.2 ohm so , that means for a 24V on the output an almost 3A.

The program for this converter is:

int i=0;
int x=0;
int OK=0;
int R1= 9840;
int R2= 987;
int value1=0;
float vout1=0;
float vin1=0;
int value2=0;
float vout2=0;
float vin2=0;
int D=0;

void setup() {

pinMode(5, OUTPUT);

cli();// stop interrupts
TCCR0A=0;//reset the value
TCCR0B=0;//reset the value
TCNT0=0;//reset the value
//0b allow me to write bits in binary
TCCR0A=0b10100011;//fast pwm mode 62500Hz frequency
TCCR0B=0b00000001; //no prescaler


TCCR1A=0;//reset the value
TCCR1B=0;//reset the value
TCNT1=0;//reset the value
OCR1A=127;// compare match value at 62500Hz
TCCR1B=0b00001001; //WGM12 bit is 1 and no prescaler

TIMSK1 |=(1 << OCIE1A);// enable interrupts

sei();//stop interrupts
ISR(TIMER1_COMPA_vect){// interrupt when timer 1 match with OCR1A value
if (vin1<11.4){ //protection if the input voltage drop below 11.4Volts
D=0;// duty cycle 0 that means the output voltage is around 11.4V
// also you can put any alarm here
//You can enable the function below
//if (vin2>26){//protection for overvoltage or if the voltage divider circuit is interrerupt
//D=0;// duty cycle 0 that means the output voltage is around 12V
//}// also you can put any alarm here
void loop() {
inputvoltage();// function for reading input voltage
outputvoltage();// function for reading output function
if(vin2>24.4 && D>10){// controling the output voltage
D=D-1;// decrease the duty cycle
if(vin2<24 && D<180 && vin1>10){//controlling the output voltage
//in the range of 10 to 180 duty cycles
D=D+1;// increase the duty cycle

void inputvoltage(){//calculating voltage on the input of the converter
value1 = analogRead(A1);
vout1=value1*(5.0/1023.0);//voltage from the input voltage divider
vin1=(R1+R2)*vout1/R2;//input voltage
void outputvoltage(){//calculating voltage on the output of the converter
value2 = analogRead(A0);
vout2=value2*(5.0/1023.0);//voltage from the output voltage divider
vin2=(R1+R2)*vout2/R2;//output voltage

Here are some videos:

-The convertor with an 8.2 ohms load:

-The convertor when i removed the external load and the arduino adapt the duty cycle for the permanent load:






Related posts

One thought on “How to make a 12-24V dc-dc boost convertor with arduino

  1. obed

    i am really interested in this project can you please post the schematic

Leave a Comment

Show Buttons
Hide Buttons