This is something I've been stuck on for quite awhile, so I wonder if I'm overlooking something.

This is what I have:

I have built a simple DC-DC buck converter that should be operated with an Arduino Uno.


simulate this circuit – Schematic created using CircuitLab

My goal is to control the duty cycle to steer Vout to a reference voltage in an optimal manner. Note that the PWM frequency is at 62.5kHz. Now, Arduinos are not the fastest devices, and the controller I am using is not the fastest either. As such, the sampling rate of the controller is 250Hz. Therefore, to ensure some dynamics are still present in such a small bandwidth, I chose these large inductor and capacitor values. The problem is during any voltage change, the current drawn in the circuit is much larger than the Arduino can supply. Simulations showed that a step input draws upto 3A, while the Arduino saturates at 40mA.

This saturation will yield significant non-linear behaviour. While the controller is perfectly capable of resolving that, it makes validating the control procedure rather hard. As such, my question:

How can I limit the controller, while still maintaining a relatively low resonance frequency of the resulting circuit?

I already tried the following:

  • A low valued resistor in series with the inductor, but this limits the maximum voltage and removes the resonance peak in the circuit.
  • A low valued resistor in series with the capacitor, but this practically removed all dynamics.

Any tips, or maybe some components I should swap?

  • \$\begingroup\$ @Andyaka I couldnt agree more, it completely is. However, it is not about the purpose of the Buck Converter, it is to show a new control algorithm also works with real-life applications. And currently, the available equipment is simply limited to what I have in my home, thus the arduino. \$\endgroup\$
    – Petrus1904
    Commented Sep 22, 2021 at 18:14

2 Answers 2


This is going to be very tricky to do with such a low current capacity on the source. And whereas it is easy to dismiss this as useless, I can actually see how it is attractive as a way to experiment and get an in-depth understanding of how buck regulators work.

So based on that, you have two choices, use the arduino pin to control a MOSFET and provide the power separately, although at that point you are just building a discrete buck converter.

If you want to go the "poor-man's" way and keep the source of power to be the microcontroller output, you will have to reverse the way you look at this and start by taking the maximum current capacity as a given, calculating the component values after that. I think going into this is beyond the scope of a Q&A here, but here are a few hints.

  • With a max of 5V output and 220 Ohm load, you have a current of about 23mA, already over the limit of the source, forgetting peaks. You need to get this very low, probably at the micro-amp level, so I would use a much higher load resistance (R1)
  • C1 & L1 are too big - you need to use smaller values, properly matched to limit in-rush current. Simulation is your friend, but doing the circuit math is even better. If you want to go at it blind, reduce C1 to a much smaller value, probably in the nF range, and adjust L1 to minimize ripple accordingly.
  • Instead of the older diode, look for the smallest voltage drop Schottky diode you can find, to help with losses when the microcontroller pin is off.

At the end, you are kind of limited here but there is a good chance you can make a good demo circuit out of this.


You could do this instead of relying on the current carrying capability of a GPIO pin:


simulate this circuit – Schematic created using CircuitLab

That gets you more current, though slightly less voltage going to the junction of L1/D1.

You connect the collector of Q1 to the 5V output of the Arduino, or to a separate 5V power supply (remembering to connect the grounds.)

That will relieve you of the need to limit the current drawn by the buck converter.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.