DC-DC buck converter converts DC voltage from higher voltages to lower voltages according to the duty cycle of PWM applied to the MOSFET gate. When MOSFET is fired the inductor and capacitor gets charged so when MOSFET turns off the inductor and capacitor works as current and voltage source and continue to supply steady voltage and current till the MOSFET is fired again. For the inductor and capacitor to continuously supply the power to load without any ripples the inductance and capacitance of inductor must be high enough so that the change in their voltage and current is not significant.
Buck converter circuit
|
output voltage
the output voltage of the converter depends on the duty cycle of the PWM applied to the MOSFET gate.
output voltage = Duty cycle * Vin
Duty cycle = Ton/(Ton+Toff)
with the change in load and change in input voltage the output voltage may vary, if load increases the output voltage will decrease as the capacitor cannot charge to required voltage due to large current drawn by the load during on cycle so in order to maintain constant voltage in case of increase in load the duty cycle must increase giving the capacitor more charging time where as if the load decreases than capacitor will start charging faster and will charge to the higher voltage than required so duty cycle must decrease.
in case of input voltage drop the capacitor takes larger time to get to the required voltage so duty cycle must decrease. similarly for increase in input voltage the duty cycle must decrease.
To make the output voltage constant irrespective of change in input voltage and output load following program can be implemented in Arduino along with circuit above to achieve the constant output voltage.
the output voltage cannot go higher than the input voltage.
int pwm;
int required_voltage = 12;
int output_voltage ;
void setup() {
// put your setup code here, to run once:
pinMode(A0,INPUT)
pinMode(9,OUTPUT);
}
int required_voltage = 12;
int output_voltage ;
void setup() {
// put your setup code here, to run once:
pinMode(A0,INPUT)
pinMode(9,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int output_voltage = map(analogRead(A0,0,1023,0,50);
if (output_voltage >> required_voltage)
{pwm = pwm - 1;}
// put your main code here, to run repeatedly:
int output_voltage = map(analogRead(A0,0,1023,0,50);
if (output_voltage >> required_voltage)
{pwm = pwm - 1;}
if (output_voltage << required_voltage)
{pwm = pwm + 1;}
{pwm = pwm + 1;}
analogWrite(9,pwmm);
delay(10);
}
delay(10);
}