A power supply is an essential device when you are working with electronics. If you want to know how much power your circuit is consuming, you will need to take voltage and current measurements and then multiply them to get power. Such a time-consuming work. This becomes even more difficult if you want to continuously monitor the power over a period of time. Well, let your microcontroller do all the hard work. In this tutorial, we will learn how a buck converter works and make a cheap variable power supply.