Today we will be working with Linear Power Supplies. We’ll learn how they work and which applications they are best suited for.
We will then put our knowledge to work and construct a linear power supply that would be an excellent addition to your workbench.
Every electrical or electronic device needs a source of power. There are, of course, many means of obtaining that power, ranging from batteries to generators to solar cells.
For our experiments with microcontrollers and electronics, we usually require a source of Direct Current, or DC power, quite often at a specific voltage such as 3.3 or 5 volts. While batteries could be used to supply these low voltages, they have several disadvantages, including cost and incorrect voltages.
Instead, we use a DC power supply, a device that takes AC current (mains or line current, depending upon where in the world you are) and converts it into safe low-voltage DC at the desired voltage level.
An excellent example of this is the USB “wall wart”, those ugly little boxes that hang onto wall outlets and provide 5-volt power via a USB cable (newer USBC supplies can provide other voltages as well).
Power supplies are used for equipment like televisions, audio receivers, computers, and about a million other devices. Knowing how they work and how to use them is a fundamental electronic skill, one that you can apply to solve a number of design problems.
And we have already built a few power supplies here in the DroneBot Workshop. A few years ago we converted an old computer ATX power supply into a useful bench supply, and we also built a simple variable DC power supply as well. Both of those designs used premade switching supplies.
Let’s begin by looking at the two different types of DC power supplies, Linear and Switching supplies.
Linear vs. Switching Power Supplies
Once upon a time, about 50 years ago, most DC power supplies worked the same way. High voltage AC was passed through a transformer, which reduced it to a much lower voltage. This low-voltage AC was then sent to a rectifier, a device that creates DC from AC. The DC produced was noisy and fluctuated at the same rate as the AC line frequency, so a large capacitor was used to smooth it out.
And you now have DC power, created from AC!
The system I just described is a linear power supply. To be precise, it is an unregulated linear power supply. Its output voltage will vary based upon the load drawn, and it will also be affected by fluctuations in the input AC line voltage.
A voltage regulator is an additional electronic circuit that is connected to the output of an unregulated power supply. Its purpose is to provide a fixed voltage that stays the same under different loads and different AC input voltages.
Early voltage regulators used discrete parts, and many high-performance designs still do. But for most applications, we can take advantage of voltage regulator integrated circuits, many of which only have three connections. We will be working with some of these soon
Switching Power Supplies
Linear supplies were the “king of the hill” until the late 1970s, so they were used on a number of earlier computers. If you recall the very first personal computers, such as the Altair, IMSAI, or Southwest Technical Products boxes, you may remember that they were huge. Most of that size, and almost all their tremendous weight, was because they employed linear power supplies.
To make a linear supply with a high current output, like a box full of first-generation microprocessor and TTL chips needed, you had to use a physically large transformer. And as these were made of iron and copper, they weighed a lot.
Switching supplies started to gain popularity at the end of the 70s, as they had several advantages over linear supplies. Since they worked at higher frequencies, their transformers could be much smaller and lighter, resulting in a more compact power supply that was also more efficient than a linear one.
Today most power supplies you use are switching supplies, although if you have any high-end audio equipment chances are it employs a linear supply.
Comparing Linear and Switching Power Supplies
Linear and switching paper supplies both perform the same task, converting high-voltage AC into low-voltage DC. However, the method they accomplish this is quite different.
The diagram below illustrates the sections of both linear and switching power supplies.
Linear Power Supply Operation
As described earlier, a linear power supply uses a power transformer to convert high-voltage (120 – 240 VAC) alternating current into a lower voltage alternating current.
This is then passed through a rectifier, which usually consists of one or more diodes, but may also use MOSFETs. The purpose of the rectifier is to turn the AC into DC.
The DC produced by the rectifier is very choppy, so a filter capacitor is used to smooth it out. The capacitor also provided some power reserve in case of a sudden demand for a lot of power.
The output is then fed into a voltage regulator, which provides a constant level of DC voltage. In some cases a regulated supply is not required, so the output is taken directly from the filter.
Switching Power Supply Operation
In a switching supply, the high voltage (120 – 240 VAC) alternating current is sent directly to a rectifier, which outputs a very high DC voltage.
This voltage is used to drive an oscillator, which typically runs at a frequency of 20 kHz to 2 MHz. The output of this oscillator is sent to a high-frequency transformer, which steps it down to a much lower voltage.
Transformers that operate at 20 kHz to 2 MHz can be made much smaller than ones that need to work with 50 or 60 Hz, and they can be made more efficient as well. Thai gives the switching supply several advantages over its linear counterpart.
The output of the high-frequency transformer is rectified to turn it into DC. It is then sent to a filter consisting of capacitors and coils to filter out the high-frequency noise inherent to switching supplies.
The output voltage is sent back to control the high-frequency oscillator, this is how a switching supply regulates voltages. This is more efficient than a linear voltage regulator, which just dissipates excess voltage as heat.
The above chart illustrates the advantages and disadvantages of each type of power supply.
Power Supply Components
We have broken linear power supplies down into four sections, as follows:
- Voltage Regulator
Let’s examine each of these sections to see what kind of components we’ll be shopping for when designing a linear power supply.
A transformer is an electrical device that consists of two or more coils of wire wound around a common core. Alternating Current (AC) applied to one of the coils, usually called the Primary coil, will produce an alternating current in the other coil (which is often referred to as the Secondary coil) via electromagnetic induction.
Transformers are used to step down, step up or isolate AC circuits.
When building linear power supplies, we will be looking for a transformer that can step down the line or mains voltage of 120 – 240 VAC into something a lot smaller, for example, 12 – 24 volts AC.
Most power transformers used in such applications are built on a frame that can be bolted to a chassis, however, you can also get toroidal transformers that have the advantage of not emitting as much electrical noise that can interfere with nearby sensitive electronic circuitry.
It is also common for transformers to have multiple coils or tapped coils. This can allow for multiple input and output voltage combinations. You should check the datasheet for your transformer to see how to wire it up correctly.
The function of a rectifier is to turn into DC. This is normally accomplished with one or more diodes.
You can use common diodes like the 1N4007 to build a rectifier, or you can buy a “bridge rectifier” assembled into one package. As the voltage drop of the diode(s) creates a power loss, you can look for a diode with a lower voltage drop rating.
The filter section is simply a large value electrolytic capacitor, usually in the neighborhood of 1000 – 5000 microfarads. Multiple capacitors wired in parallel can be used instead of a single large value one.
A voltage regulator accepts an input voltage and outputs a lower, regulated voltage.
While it is certainly possible to build a voltage regulator from scratch, it is much easier to use a pre-made regulator. If your current requirements are not huge then the common “3-pin regulators” can work well, we will be looking at these in a moment.
As I’ve already mentioned, a rectifier is really just one or more diodes, arranged so that an AC input results in a DC output.
Diodes can accomplish this because they only allow current to flow in one direction. So they can divert just the positive half of the AC waveform to the output, creating a “choppy” positive voltage.
There are a couple of very common rectifier diode configurations, half-wave, and full-wave.
A half-wave rectifier is the simplest configuration of all, consisting of just one diode.
As the above diagram illustrates, the AC current is applied to a transformer, which then has a diode on its output before being connected to a DC load. The waveform at the load is a series of positive DC pulses, at the same frequency as the power line frequency.
A full-wave rectifier allows both sides of the AC waveform to be converted to a positive (or negative) DC output.
There are a couple of ways of hooking up a full-wave rectifier.
In this first arrangement, we have four diodes wired in what is called a “bridge rectifier” configuration. This is a very popular rectifier configuration.
Note that the output of the circuit is again a series of positive pulses, only this time without the “gaps” shown for the half-wave rectifier. As there are two pulses per AC waveform cycle, the resulting noise frequency will be double the line frequency.
Another method of wiring a full-wave rectifier is shown here. In this arrangement, a center-tapped transformer is used with two diodes. The resulting output has the same waveform as the bridge rectifier, but you should note that it also only has half the output voltage.
Using 3-Pin Regulators
A very common method of building a low-current regulated DC power supply is to use 3-pin voltage regulators. They are actually integrated circuits and are available in a variety of packages, both conventional and surface mount.
The standard 3-pin regulators are bipolar devices, but modern MOSFET-based devices exist, most of which are compatible with the “classic” regulators.
We will be using three of those classic regulators today, a positive one, a negative one, and a variable (positive) one.
Positive – 78xx Series
The 78xx series are probably the most common voltage regulator chips around, they are used in virtually everything. If you power up an Arduino Uno using a 9-volt battery, then a 7805 regulator is used to provide the 5 volts the Arduino actually requires.
The “xx” in the part number refers to the output voltage, so a 7805 will output 5 volts while a 7809 will output 9 volts. They are available in a variety of common voltages, and some newer LDO chips can be had with outputs as low as 2.2 volts.
In the popular T0220 power transistor package, these chips have the following pinout and specifications:
Using three-pin regulators is pretty easy, as most devices have the following pins:
- Power In
- Power Out
Aside from a few filter capacitors, a large one on the input and a smaller one on the output, these are self-contained voltage regulator modules.
Here is how a 7812, or any 78xx series device, would be used in a circuit:
Note that with the TO220 package, the center lead is connected to the metal tab. With the 78xx series voltage regulator, this is the ground pin, so you can bolt the regulator to the chassis to use as a heatsink.
Negative – 79xx Series
The 79xx series of voltage regulators are negative equivalents of the 78xx series.
As with their positive counterparts, the output voltage level is specified by the part number, so a 7905 would produce a regulated -5 volts while a 7912 would regulate at -12 volts.
One very important thing to make note of is that the arrangements of the three pins on the 79xx series regulators are different from that of the 78xx. The negative voltage input is connected to the center lead, and on the TO220 package this lead is connected to the tab. So you can’t directly bolt this regulator to a grounded chassis, you’ll need to use an insulator to prevent a short circuit.
Otherwise, the hookup of the 79xx series is identical to the 78xx series, with the exception that the positive side is grounded in this case.
Variable – LM317
You may have a requirement for a voltage regulator with a non-standard output, or you may wish to build a variable-output power supply.
The LM317 will fit the bill if you want a positive variable power supply. If you require a variable negative supply, an LM337 is the negative equivalent.
Unlike the previous three-pin regulators, the pin definitions on a variable regulator are slightly different:
- Power In
- Control Voltage
- Power Out
The Control Voltage determines the regulators’ output voltage, it is generally supplied by a voltage-divider with a fixed and variable resistor.
Here is the pinout of the LM317:
The hookup of the LM317 is quite similar to that of the 78xx series regulators, the difference being that instead of a ground reference, you create a voltage divider and feed its output to the control pin. Changing the value of the 5k pot will change the output voltage level.
As with the 78xx and 79xx series, there are newer, improved versions of the LM317. We will be looking at one when we build our own linear power supply, which is what we will do next!
Building a Linear Power Supply
Now that we know the basics of linear power supply construction, it’s time to actually build one!
The power supply that we will be building would be great for a workbench. It’s a positive supply capable of 2 to 20 volts DC at up to 2.5 amperes. The model I created has one output, and you can select between three fixed voltages plus a variable one.
You can build an identical supply, or just use this article as a reference for building a custom design of your own.
I’ll need some parts for my power supply, and I wanted to choose components that are easily available. So pretty well everything came from either DigiKey, Mouser, or Amazon.
Here are some links to the parts I used for my power supply. Please note that the Amazon links are affiliate links and I will earn a commission on any of them you happen to click upon. This in no way increases the cost to you.
Transformer – Triad FP16-3000 – Mouser
Bridge Rectifier – Rectron RS603M-C – Mouser
Voltage Regulator – STM LD1085V – Mouser
Heatsink – Wakefield 262-75ABE-01 – Mouser
2200uf 63v Capacitor – Panasonic ECA-1JM222 – Mouser
10uf 50v Tantalum Capacitor – Kyocera AVX – Mouser
4-pole Rotary Switch – C7K A10405RNZQ – DigiKey
10-Turn 10K Potentiometer – Bourns 10K 0.25% – Amazon
10-Turn 10K Trimpots – XCHC Electron – 10K – Amazon
AC Power Module -BIQU IEC320 C14 – Amazon
Volt & Ammeter – Eiechip DIGI-100V-10A-1 – Amazon
Binding Posts – Amazon
Here is how I selected my components:
You can build your power supply into any enclosure that will fit the components.
You may already have a suitable enclosure, or perhaps you want to build a power supply into an existing piece of equipment. If not, then you’ll need to go shopping for enclosures.
I would recommend a metal chassis as opposed to a plastic one, as severely components will be dissipating heat. In addition, your chassis will need to support a reasonably heavy transformer. So this is one case where a 3D printed design may not be the best choice.
Another reason to use a metal chassis is that the chassis itself can be grounded for safety and to reduce electrical noise.
I picked up a couple of different enclosures on Amazon, it’s a good source – just search for “project boxes”. I decided to go with a low-profile enclosure so that I could put a meter and a voltage selector switch on the front panel yet still have a relatively compact unit.
Power Entry Module
When constructing any power supply that is intended for use with line (or mains) voltage, safety is the number one consideration. Line-level voltage can be lethal, and it is important to design your supply to prevent any possibility of the user coming into contact with high voltage.
One excellent way to safely handle AC input voltage, as well as providing a fuse and a power switch, is to use a power entry module. They are inexpensive and well worth the money.
I picked up a popular one at Amazon, it has a socket for a standard 3-conductor power cord, a 5×20 mm fuse holder, and an illuminated power switch. It is well insulated and provided the hot, neutral, and ground outputs on the other side.
Although the conventional transformer may have been easier to work with, I eventually used the low-profile one so that I could use a chassis that had more front panel space.
I selected the transformers based on their output voltage and current rating. Both transformers were rated at 3 amps at 18 volts, they were both center-tapped, but I’m not using a tap in my design.
To get 2.5 amperes, I’ll need a variable regulator with more “horsepower” than the LM317. While it is possible to add an external power transistor to an LM317 to increase its output current capability, I decided instead to go for a more modern low dropout (LDO) voltage regulator.
The regulator I chose was the LD1085, a low-dropout pin-for-pin compatible version of the LM317.
Having a low-dropout regulator reduced the heatsink requirements for the voltage regulator, and I ended up just using a clip-on heatsink.
As you can see from the above diagram, the LD1085 has an identical pinout and similar specs to the LM317. While it does not have as wide a voltage range, it does provide over twice the output current, making it a great choice for my variable power supply.
You have many choices for a bridge rectifier:
- A chassis-mount design
- A PCB-mount design
- Use four discrete diodes
Any of those would be a fine choice, as I used the transformer that was board-mounted I decided to go with a PCB-mount bridge rectifier module.
Whatever you choose make sure to “over-spec’ it, get one rated at 100 volts even though it will never see more than 30 volts, and choose one rated at least for 5 amps.
There are two polarized capacitors in the design, a 2200uf electrolytic and a 2.2 to 22uf tantalum.
The larger capacitor is used to filter the raw DC from the rectifier. If you wish, you could use two 1000uf capacitors in parallel. I used a 63-volt capacitor, and I advise you to use at least a 50-volt one.
For the output capacitor, any value from 2.2uf up to 22uf will be great here. I used a 10uf tantalum capacitor for improved performance, but if you can’t find one, an electrolytic capacitor will also work.
You’ll also need a smaller capacitor, to filter the noise from the control voltage line. I used a 22nf capacitor, pretty well any value around there would suffice.
Remember to observe the polarity of the larger capacitors!
Volt Meter and Ammeter
There are many choices when it comes to adding a voltmeter and current meter to the supply.
One choice is to simply not use them! If all you need is a variable output supply, and you plan on using an external meter to set the output voltage, then you can just build the supply without them.
If you do choose to use one, select it by voltage and current ratings. As our project is a 2-20 volt power supply with a maximum of 2.5 amperes, I select a meter rated at 0-100 volts and 10 amps maximum.
I picked up my meter on Amazon, they had a pretty extensive selection of them and many of them seemed to be the same meter with a different manufacturer’s label. You’ll want to consult the spec sheet for the meter you purchase to verify the exact connections, as it may differ from the one I used.
Potentiometer and Trimpots
The potentiometer is being used to select the output voltage, and its quality will factor into the overall quality of the power supply. A standard, low-tolerance potentiometer can drift by up to 10%, meaning the regulated output voltage will drift by a similar amount.
A better choice is a precision multi-turn potentiometer. It will let you fine-tune the voltage selection.
The same goes for trimpots. In my design I used three of them to select some fixed voltages, I chose 3.3, 5, and 12 volts but any three fixed voltages can be selected. As those trimpots have the same function as the multi-turn potentiometer, I used 10-turn precision trimpots.
As the LD1085 is pin-for-pin compatible with the LM317, our hookup diagram is just about the same as the one for the LM317 test.
There are several things to note about this schematic, starting with the power entry module. This module contains a power cord socket, a switch, and a fuse holder. If you don’t use one (and I strongly suggest you should, for safety reasons) then you will have to safely provide a switch and fuse holder.
The fuse is critical, (I’m using 250V 400ma “slo-blo” fuses to handle the current but also resist power surges). Do not consider building a power supply without one!
Next is the transformer. This is a transformer with an 18 volt AC output and current capability of 3 amperes. The one I used had multiple windings and I had to strap it correctly for my line voltage, 120 VAC. Check the wiring diagram for your transformer before using it.
My power transformer is meant to mount on a circuit board, so I wired the supply up on a perfboard. If you are using a chassis-mount transformer, you might want to use a chassis-mount bridge rectifier as well, putting the remaining components onto a small circuit board.
The 22nf capacitor is just to reduce noise on the voltage control line, any small capacitor should work. Try and keep it physically close to the voltage regulator.
Note that the common (negative) side of the circuit is NOT ground, unless you don’t plan on using the output meter.
The 560-ohm resistor was determined by experimentation, in my final design I actually used a 1k 10-turn precision trimpot instead. The value here determines the range of the variable voltage control, which itself is a 10-turn potentiometer.
Note connection points A, B, and C – they are for wiring the external voltage selector switch and the output meter. Both are optional.
Voltage Selector Wiring
I used a 4-pole rotary switch to be able to select between the following voltage output levels:
- Adjustable – use the 10-turn pot to set the voltage.
- 3.3 volts.
- 5 volts
- 12 volts
You could, of course, choose any three fixed voltages within the regulator’s range, the ones I selected were what I thought would be most useful to me.
As the wiring diagram shows, the rotary switch is used to select between the 10-turn precision pot and three 10-turn precision trimpots. It connects to point “A” (the voltage divider) and point “B” (the negative common line).
Power Meter Wiring
The meter I selected uses a resistive load on its NEGATIVE side to measure current. This is the reason you can’t ground the common negative line, it needs to pass through the meter’s load before it can be connected to the ground.
The wiring is a bit confusing, as the meter’s negative output is a red wire! That’s just the way it was designed.
It also has a second, thinner red wire that is used for powering the device. Note that it is powered from the unregulated side of the power supply, which should be about 24 volts DC.
The thin yellow wire is the voltage sensor, otherwise, the positive voltage just goes straight through to the output.
Note that if you are using a different meter, you should check its wiring diagram, as not all meters are wired the same way.
Putting the Power Supply Together
A few notes on putting the project together, some of this may be helpful if you have never worked on something like this before.
Cutting the Chassis
The power meter and power entry module will both require cutouts in the chassis. There are many ways of doing this, your skill level and access to tools will determine which one works for you.
On the top end, we have CNC machines and laser cutters. If you have access to such devices, perhaps at a local maker center, then you can produce a professional cut chassis.
On the other end of the scale, you can use a drill and hacksaw to cut out the openings. This is pretty crude, fortunately, each attachment has a bezel that can cover any not-so-perfect cutouts (within reason)!
A really simple method of cutting out the openings, and the one that I used, is to use a Nibbing Tool. This handy gadget just “chews” its way through light sheet metal, and has a particular appetite for aluminum chassis material!
To use the tool, you just place the blade at the edge of the metal you want to cut and squeeze the handles. I would advise weathering gloves whenever working with a nibbing tool, both to prevent blisters and to prevent cutting yourself on the chassis edge.
You’ll also need to drill holes for mounting the circuit board, controls, and perhaps the transformer and bridge rectifier. I used my drill press, but a hand electric drill would be just as good. I found that a stepping bit worked well for the front panel holes. Be sure to deburr all of your holes, to prevent leaving sharp flakes of metal.
Working with Perfboard
A perfboard is a circuit board with a grid of component mounting holes spaced 0.1 of an inch apart, which is the standard component spacing for conventional integrated circuits. You can use it to mount and wire parts instead of a printed circuit board.
As this is a power supply and could be expected to supply up to almost 3 amps of current, I suggest using a heavier gauge wire for most connections. The exception is the switching arrangement for the resistors, I used 30 gauge wirewrap wire for these connections as it is easier to work with.
Go slow and check your soldering, a multimeter is your friend in finding shorts and open connections.
I used a clip-on heatsink for the LD1085 regulator, as the tab of the regulator is connected to the output you need to be careful not to ground the heatsink.
Front Panel Labelling
There are a few ways to make labels for your front panel.
The simplest, of course, is a label maker. You can get clear label stock for most of these, allowing you to make transparent labels that can look reasonably good.
Another method is rub-on transfers. That used to be the most popular method, but the transfers are getting harder to find as their original use in the drafting profession has been replaced by computers.
If you can still find transfers, you can just rub the lettering onto the chassis. A coat of clear coat paint afterward will serve to protect it.
The method I used for my chassis labeling was to use Laser Waterslide Transfers. This is a special type of paper that you can use in a laser printer, there is also equivalent paper for inkjet printers as well.
With the waterslide transfers, you print your panel able right onto the paper, this allows you to create pretty well anything including graphics. After printing the image, you immerse it in water, then place it onto your chassis and slowly remove the backing.
With some luck and a lot of practice, you’ll have a label that, when dry, is permanent.
It should go without saying, nonetheless I’ll say it – you are working with line-level voltages, always practice appropriate safety measures and observe safe wiring practices!
- Use heavier gauge wire for AC wiring.
- Insulate all high voltage connections.
- Keep the high voltage side of your power supply separated from the rest of the wiring.
- Prevent any possibility of an AC wire touching the chassis.
- Never work on the power supply with the AC line connected!
If you have any doubts or reservations about working with high voltages, then this probably isn’t the project for you. There are thousands of other things you can build that don’t require any AC voltage wiring.
Testing the Power Supply
After wiring up the power supply, double-check aloof your connections with a multimeter.
Once you are SURE that everything is correctly hooked up, connect an AC cord to the supply and power it on.
You should see the meter light up, assuming of course that you used one. And you should have an output voltage, one that you can control with either the 10-turn pot or one of the trimpots.
You’ll want to set the trimpots for the correct output voltage. You’ll also want to apply a small load to the power supply and observe the front panel meter – mine wasn’t particularly accurate, but it still is a handy indicator!
After putting the supply to the test, you’ll find that it’s a pretty capable little box, and it should serve you well for years to come.
And you built it yourself!
Linear power supplies have one advantage over switching ones – they are easier to build!
So when you need a custom power supply or when you design a super-sensitive instrument or top-quality audio device, think of using a linear power supply. And then design and build it yourself.
Then stand back and admire your work – it’s a powerful feeling!
Transformer Calculator – Calculate the transformer requirements for your power supply project.
AC to DC Calculator – Another online tool for calculating DC voltages.
Mouser Electronics – Electronic parts distributor that ships worldwide.
DigiKey Electronics – Another parts distributor with worldwide shipping.