About this Post
In this post, I would like to present various options for power supply. The focus here is less on the energy sources themselves—such as the electrical grid, batteries, power supplies, solar cells, etc.—and more on how you can use these energy sources to set specific voltages. Specifically, I will cover the following topics:
Supply voltage from or via boards
Anyone entering the world of microcontrollers via Arduino boards will, especially at the beginning, take advantage of their existing, convenient infrastructure. Power for the board is supplied via the USB interface. Conveniently, there are 3.3-volt and 5-volt outputs for powering additional components, such as sensors. The latter applies, at least, to AVR-based Arduino boards.
Thanks to the voltage converters integrated into the boards, operation with supply voltages between 7 and 12 volts is also possible. To do this, use the “VIN” pins or, as with the Arduino UNO, for example, the jack provided for this purpose.

So far, so good. But at the very latest when you
- want to run the bare microcontroller (as described in this post about the ATmega328P or in this one about ATtinys), or
- if you need more power than the board can supply (we’ll get to exactly how much in a moment),
you will need to give the power supply issue some more thought.
Supply voltage with linear voltage regulators
Linear voltage regulators (or “linear regulators” for short) are DC/DC converters that typically deliver voltages in the range of 3 to 24 volts. The linear regulator compares the output voltage to a setpoint. If the output voltage deviates, it is amplified accordingly. A distinction is made between fixed-voltage linear regulators, which output a fixed voltage value, and adjustable linear voltage regulators.
For most linear voltage regulators, the input voltage must be 2 to 3 volts higher than the desired output voltage.
Efficiency of linear voltage regulators
In a linear voltage regulator, the input current I is equal to the output current. Only the voltage U changes. This means that for the power P:
![]()
![]()
The following applies to the efficiency η:
![]()
In other words: the greater the voltage difference, the lower the efficiency. And since the power loss is converted into heat, it may be necessary to equip the voltage regulator with a heat sink.
With a transformer, it’s different. In that case, the current also changes, so that the product of U and I remains constant. At least, that’s true for an ideal transformer.
How much power can Arduino UNO, Nano and Pro Mini supply at the 5 V pin?
That question was still open. When powered via USB, the limit is approximately 500 mA, which is determined by the USB interface and not by the Arduino. When powered via VIN or the power jack, the power dissipation of the voltage converter on the board is the limiting factor. Power consumption should not exceed 1 watt. For example, with a 9-volt power supply:
![]()
![]()
Power supply with the L78xx series
The L78xx series is probably the best-known line of fixed-voltage regulators. You will sometimes find them listed as LM78xx, MC78xx, or similar. Here, “xx” stands for the output voltage, which is typically 5, 6, 8, 9, 12, 15, 18, or 24 volts. So an L7805 provides 5 volts, and an L7824 provides 24 volts.
The L78xx series devices typically deliver 1 to 1.5 amps. The L78Sxx series delivers currents up to 2 amps. In addition, there is also the L78Mxx series for currents up to 500 mA and the L78Lxx series for currents up to 100 mA.
L78xx voltage regulators are available in various packages, such as the TO-220 model shown here. Pin 1 is the input, Pin 2 is GND, and Pin 3 is the output. You can find a datasheet for the L78xx series here, for example.
Wiring the L78xx voltage regulators
Wiring the L78xx voltage regulators is simple. All you need are a few additional capacitors. Different sizes are recommended depending on the type of power source and load. The 330 nF / 100 nF combination is very common.

To make the circuit a little more resistant to fluctuations, you can add larger capacitors:

Symmetrical power supply with L78xx and L79xx
For some applications, such as certain operational amplifier circuits, you need a balanced power supply. The L79xx series is available for providing the negative voltage. For example, to generate +/-5 volts, you could use the following circuit (I’ve omitted the capacitors for clarity!):
Other fixed linear fixed voltage regulators
The L78xx series is certainly the most popular, but there are many other fixed-voltage regulators. The Arduino Nano shown above, for example, uses the AMS1117-5.0 (datasheet here), which—as the name suggests—delivers 5 volts. The combination of an AMS1117-5.0 and an AMS1117-3.3 can be found on these handy breadboard adapters:
If you find it problematic that, with most linear regulators, the input voltage must be about 2.5 volts higher than the output voltage, you can opt for low-dropout (LDO) voltage regulators. With these, the minimum voltage difference is one volt or less. Incidentally, the AMS1117 is also an LDO and is therefore well-suited if you need to supply individual components with 3.3 volts in a 5-volt project.
If the 2 amps of the L78Sxx series are not enough for you, you can opt for more powerful models such as the LT108x series. The LT1083, for example, can deliver up to 7.5 amps.
However, the more specific your requirements, the faster the price goes up. While the L7805 is still available for 20 to 30 cents, you’ll have to shell out a whopping 10 to 20 euros for an LT1083CP.
Power supply with the LM317
The LM317 is the classic choice among adjustable linear voltage regulators. It allows you to generate voltages between 1.25 and 37 volts. The input voltage must be at least three volts higher than the output voltage. The maximum current is rated at at least 1.5 amps (see datasheet).
The LM317 has the three pins Adjust (1), Output (2) and Input (3).
The TO-220 design is shown here, but the LM317 is also available as an SMD.
Wiring the LM317
You can adjust the output voltage of the LM317 using two resistors. Here, for example, is a circuit that supplies 5 volts:

The LM317 sets a voltage of 1.25 volts between OUT and ADJ, which drops across R1. Resistors R1 and R2 form a voltage divider across which the output voltage UA drops. Therefore:
![]()
![]()
A resistance value of 240 ohms is recommended for R1.
If you use an adjustable resistor as R2, then you are flexible in terms of output voltage. However, make sure that you do not damage anything just because the resistance may have just been unfavorable. I recommend measuring the output voltage before connecting anything.
The values selected for the capacitors in the schematic follow the recommendations in the datasheet.
The LM317 as current limiter
I don’t want to make this post too long. So I will just mention here—without further explanation—that you can also use the LM317 as a current limiter. If you follow this link, you will find a concise description, including an online calculator.
Quiescent current of linear voltage regulators
Unfortunately, voltage regulators continue to draw current even when no current is being drawn from the output. For the L7805, I measured a current draw of 3 mA at an input voltage of 9 volts; for the LM317, it was as high as 5 mA. For continuously operating, battery-powered projects, this could be a deal-breaker.
Power supply with switching regulators
The major drawback of linear voltage regulators is their potentially high power dissipation. This, among other factors, has led to the development of switching regulators, which operate much more efficiently by comparison, especially when there are large differences between the input and output voltages.
Switching regulation technology allows not only for lowering but also for increasing the input voltage. Modules that lower the input voltage are called step-down converters. So it is no surprise that the modules that increase the input voltage are called step-up converters.
Step-down converter
Principle
II’ll try to briefly describe in my own words how a step-down converter works in principle. Here is a circuit diagram to start with:

The MOSFET is the control component in this circuit. It turns on and off at a high frequency. The control parameter here is the pulse width. When the MOSFET is on, the diode turns off, and current flows into the coil. This induces a magnetic field that opposes the flow of current. As a result, the current and voltage rise more slowly. When the MOSFET turns off, the magnetic field in the coil decays, inducing a current (you can find a nice animation of this here). The current wants to continue flowing, so to speak. To do this, the coil “pulls” the current, and in this direction, the diode is conducting, forming a circuit through the diode, the coil, and the load at the output. The interaction between the coil and the capacitor smooths out the current and voltage.
The coil acts as a kind of energy storage device that is charged only to the extent required on the output side. It is also important that the MOSFET switches at a high frequency. If it switched slowly, the output would produce a triangular waveform that would repeatedly drop to zero. Thanks to the high frequency and a controlled pulse width, the voltage is maintained at an adjustable level. Nevertheless, the triangular voltage (ripple) is still visible on the oscilloscope. You will see this in an example soon.
If you would like to have this explained again in different words without being bombarded with formulas right away, I recommend this YouTube video.
What about P = U x I?
Unlike linear voltage regulators, the output current here is greater than the input current, since the current continues to flow even when the MOSFET is turned off.
The voltage U decreases, but the current I increases, so the power P remains constant. Of course, there are losses here as well, but they are significantly lower than in linear regulators.
Example: the LM2596
Pictured below is an LM2596 step-down module with a potentiometer for adjusting the output voltage. If you do not want to deal with calculating the component values (inductor, capacitor), a module like this is a viable solution.
The actual LM2596 is the IC with the 5 pins. It is available in fixed-voltage versions for 3.3, 5, or 12 volts (LM2596xx), or—as shown here—in an adjustable version (LM2596-ADJ).
According to the supplier, this model can provide 4 to 34 volts and operate at up to 1 ampere without a heat sink. The input voltage should be at least 2 volts higher than the output voltage for the LM2596 to operate effectively. According to the supplier, the loss is a maximum of 8%.
In the circuit diagram shown above, the LM2596 IC itself would correspond to the MOSFET and its associated driver. It monitors the output voltage via a “feedback” pin and adjusts the PWM signal accordingly. The LM2596’s clock frequency is 150 kHz, which corresponds to a period of 6.66 µs.
A few measurements on the LM2596 module
I set the LM2596 to an output voltage of 5 volts and used it to power a small load (a few LEDs). I then used an oscilloscope to examine the voltage signal. The characteristic fluctuation (“ripple”) was a good 60 mV. To my surprise, however, the period (from peak to peak) was just under 20 µs instead of the expected 6.6 µs, corresponding to a frequency of 50 kHz. Was an original LM2596 really used here?
At higher loads, it is very easy to see how the duty cycle of the PWM signal—that is, the ratio of the on-time to the period—increases. The ripple also increases, reaching nearly 100 mV here. For most purposes, however, this will not be a problem.
Step-down converter for high currents
If you need a really high current—for example, 5 to 10 amps—even the relatively low losses in step-down converters can result in significant heat generation. In these cases, you can use “monsters” like the ones shown below. By the way, you can find all of these on Amazon if you search for “step-down converter.”
By the way, the regulator in the upper right corner is also interesting because it allows you to adjust not only the output voltage but also the output current. This makes it possible, for example, to power high-power LEDs.
More compact switching regulators
You do not necessarily have to buy switching regulators as modules. They are also available in very compact form for various voltages and currents.

However, these components are not exactly cheap. Up to 500 mA, they are still available for under 5 euros, but for 1.5 or 2 amps, you will have to pay 10 to 20 euros. Conrad has a well-organized selection in this regard. Search for “DC-DC converter.”
Quiescent current consumption of the step-down converters
Like linear voltage regulators, step-down converters also have a non-negligible power consumption. For the LM2596 module, I measured a quiescent current of 7 mA at an input voltage of 9 volts and an output voltage of 5 volts.
The bare LM2596 IC has an On/Off pin. When it is off, power consumption is in the microampere range. Unfortunately, the On/Off pin is not exposed on the module.
Step-up converter
A step-up converter consists of the same components as a step-down converter; the only difference is the configuration. And it might be a little harder to understand. Here is a circuit diagram to start with:

When the MOSFET is on, UE drops completely across the coil. Due to the magnetic field that builds up and opposes the current, the coil charges up as a kind of energy storage device. When the MOSFET is off, the coil releases its energy. The current now flows through the diode and to the load on the output side. Of course, the coil also charges when the MOSFET is off. The “trick” here is that the coil can store more energy when the MOSFET is on than when it is off, since in the latter case only a portion of UE is dropped across the coil.
Examples
I tested two step-up converter modules. One is based on an “E50D” IC. The other is based on the MT3608 IC. I was only able to find a datasheet for the MT3608 IC (here’s the link).

The E50D-based module provides a fixed voltage of 5 volts. It is well suited, for example, for supplying a voltage of 5 volts using a lithium battery (3.7 volts).
The MT3608 module provides adjustable output voltages up to 28 volts with input voltages ranging from 2 to 24 volts. The maximum current is specified as 2 amps. I have not tried it myself, but I doubt that this module can actually boost a 2-volt power source to 28 volts while simultaneously drawing 2 amps. You would definitely have to test it to see how far you can actually go. According to the supplier, the efficiency is 93%.
Using the oscilloscope, I was once again able to observe the voltage waveform with ripple typical of switching regulators (here on the E50D module):

Application: Operate a microcontroller with a steam engine
Are you still with me? There’s a little more to come. But to lighten the mood, here is a not-quite-serious application. I borrowed my son’s steam engine and used it to power an ATtiny85, which in turn made two LEDs flash.
The generator connected to the steam engine produces a DC voltage that fluctuates quite significantly and also depends on the rotational speed. Under full load, I was able to reach around 4 volts. I smoothed out the voltage using capacitors and then boosted it to 5 volts with a step-up converter. Here is a video showing how it works:
The Power of Esbit! Older folks will remember that fishy-smelling dry fuel. By the way: did you know what “Esbit” stands for? Erich Schumm’s fuel in tablet form (Erich Schumm’s Brennstoff in Tablettenform)—that would make a great question for Who wants to be a Millionaire. But now I’ve given it away…
Power supply with switching power supply units
Finally, a few words about switching power supplies. These convert 230-volt alternating current into low-voltage direct current. Thanks to the switching technology, there is no need for large transformers here, since the required current is converted in small increments, so to speak. Here is a schematic representation:

I found a really good explanation of switching power supplies here. The short version is:
- The rectifier converts the alternating voltage into a “sawtooth-shaped” direct voltage
- The coil and the capacitor smooth out the voltage
- The switch (e.g., a MOSFET) chops the DC voltage into a pulsed voltage
- The transformer handles the voltage conversion of the pulses
- The coil and capacitor smooth out the pulse voltage
You can buy switching power supplies that you connect directly to the mains voltage. Personally, I do not like working with 230 volts, and I would strongly advise against it to anyone who doesn’t know exactly what they’re doing! I tried it anyway:

If you want to draw power from the electrical outlet and need 5 volts, I would recommend using a power supply with a USB output. With a small adapter board costing < 1 euro, you can then easily use that voltage on your breadboard.

Would you like to support me?
Did you enjoy this post? And did you notice that it’s ad-free? If you’d like to help keep it that way, you can support me. Follow this link.
Acknowledgement
I found the featured image on Pixabay. I would like to thank the photographer, Jonas Manske.











