Power supplies: theory, diagnostics and fixing.
Many pieces of electronic equipment include a power supply unit (often abbreviated to PSU) to convert the incoming electrical power from the mains or a battery to the form needed. This can involve the control and conversion of a relatively large amount of power in a fairly small space and some of the power will be wasted as heat. Heat can lead to failures.
- Mains driven power supplies can be dangerous to work on unless you fully understand what you're doing. They often contain large capacitors which can store dangerous voltages even after you've disconnected the mains supply.
Why is a power supply needed?
A power supply performs some or all of the following purposes:
- Voltage conversion:
- Isolation: Even though the voltage might be reduced, if there remains a direct electrical path to the mains it can still be dangerous. Professional power tools, especially if used outdoors, are often powered through an isolation transformer in order to break that path.
- Regulation: If the input mains voltage varies, the rectified and smoothed output will vary in proportion. If the power is supplied by a battery its voltage will drop as it is exhausted. The output voltage may also fall as you take more and more current. And unless large and expensive smoothing components are used, there will remain a certain amount of "ripple" which can cause an annoying hum in audio equipment. Electronic equipment often needs a supply which is not only very smooth but a fairly precise voltage in order that the design may be optimised. Regulation provides this. There are two kinds of voltage regulator:
- In a linear regulator, excess input power is simply absorbed and turned into heat, just a little if the excess is small or more if it's greater. This is a bit like keeping your foot on the accelerator of your car and controlling your speed with the brake. It's wasteful but cheap, nevertheless it may be good enough for low power devices unless they need to squeeze the maximum life out of a battery.
- In a switching regulator the power is switched on and off up to a few million times per second, with the on-time continually adjusted to compensate for variations in the input or in the power drawn by the load. This is like a room thermostat which is on for a greater proportion of the time the colder it is outside, in order to maintain a roughly constant indoor temperature. Just as the thermal inertia of the room smooths out the temperature variations as the thermostat switches on and off, the output of a switching regulator needs to be smoothed. However, the smoothing components can be very much smaller than are required for smoothing rectified mains as they only need to store energy for typically a few millionths instead of a hundredth of a second. A small capacitor is used, and in some configurations, small coil also stores energy as magnetism.
A well designed switching regulator can be made very efficient, but is more complicated. This used to mean that switching mode power supplies were more expensive, but this is often no longer the case. The cost of the iron and copper in a mains transformer remains high but the cost of the extra electronics in a switching mode power supply has fallen dramatically in recent years.
With just a little experience it's generally easy to tell whether a mains power supply is linear or switching mode, without even opening it, just by weighing it in your hand. A linear power supply will contain a mains transformer with a fairly heavy iron core whereas a switching-mode one will feel much lighter.
A switching-mode power supply as used with a laptop or in a phone charger generally includes all of the above elements but not in the same order. The raw mains input is rectified and roughly smoothed, giving mains voltage DC. This is then fed into a switching regulator. The switching regulator includes a transformer to provide isolation as well as to reduce the voltage to a more manageable level. Since the transformer is operating at a very high switching speed it can be much smaller than a mains transformer handling the same power, since it's transforming the power in very much smaller bites. Without a bulky mains transformer containing a lot of iron and copper, a switching-mode power supply can be made much lighter and more compact.
Linear Power Supplies
The animation above shows the various levels of sophistication of a linear power supply. Linear power supplies designed to run off the mains contain an iron cored transformer to provide isolation and voltage reduction and further components as required.
- An AC power supply just contains the transformer, and maybe a fuse (shown on the input to the transformer). The transformer has 2 windings: the primary connected to the mains, and the secondary connected to the output and generally delivering a much lower voltage. You will rarely see a power supply as simple as this as most low voltage equipment needs DC, not AC.
- A DC power supply sees the addition of a rectifier, generally consisting of 4 diodes (possibly in a single package with 4 leads) forming a bridge rectifier. The output of this is far from constant, but at least it only goes in one direction, so is good enough for a very simple battery charger.
- A smoothed power supply adds a capacitor which stores electric charge during the peaks and delivers it in the gaps between the cycles, and hence is often referred to as a reservoir capacitor. This will always leave a ripple on the output but a big enough capacitor may make it acceptably small.
- A regulated power supply additionally contains a linear regulator. This not only removes the ripple, but also gives a fairly precise output voltage even if the mains voltage varies.
The photo shows a smoothed power supply which has been hacked with the addition of a linear regulator.
Sometimes you will find a power supply split into two parts, for example with a wall cube plugging into a mains socket and containing a smoothed power supply, and a linear regulator in the equipment itself.
Fault finding in a linear power supply is straightforward once you understand how it works. You could follow these logical steps:
- First perform a visual check. Are the mains plug and lead in good condition, with no signs of cracked or damaged insulation? Are there any visible signs of overheating or burning, in particular of the transformer? Check the reservoir capacitor for any signs of bulging or leakage. Was there any burning or overheating smell when it stopped working?
- Test the fuse, and check for continuity from each of the live and neutral pins on the mains plug through to the transformer.
- Test each of the 4 diodes with a test meter on the diode range. In the case of a diode bridge in a single package, test between each of the AC inputs and each of the positive and negative outputs.
- If you can, test the reservoir capacitor. You may be able to test it in-circuit with a capacitor tester but you will get a more reliable result if you can unsolder it. (Some test meters have a capacitance range.)
- Plug the power supply in, first making sure there is no danger of anyone touching exposed mains on the mains side of the transformer. Perform the following tests:
- With a test meter on an AC voltage range, check the voltage on the secondary of the transformer (or the input to the bridge rectifier). It should be greater than (up to twice) the rated output voltage of the power supply. If not, the transformer may be faulty or have a broken connection.
- With a test meter on a DC voltage range, check the voltage on the output of the bridge rectifier, or across the reservoir capacitor. This should be about 1.4 times the AC voltage on the secondary of the transformer. If not, the bridge rectifier may be faulty.
- With a test meter on a DC voltage range, check the output of the linear voltage regulator. This should be the rated output voltage of the power supply. If not, the linear regulator is probably faulty.
Switching Mode Power Supplies
In a switching mode power supply the raw AC mains is rectified with a bridge rectifier and then smoothed with a reservoir capacitor, delivering a DC voltage of around 300V (the peak voltage of the AC mains supply). This is used to drive an oscillator which turns the current back into AC or very often simply switches it on and off, typically with a frequency of 50kHz - 1MHz. This then feeds the primary winding of a transformer, serving the dual purpose of reducing the voltage and providing isolation from the mains. Where the transformer is driven with on-and-off DC rather than AC it delivers a mainly unidirectional on/off output on its secondary winding. In this case a bridge rectifier is not required and instead a single diode can be used as a rectifier, mainly just to prevent the current flowing back through the transformer from the reservoir capacitor during the off half-cycles.
An error amplifier compares the output voltage with a reference voltage and feeds a voltage proportional to the difference back to the oscillator via an opto-isolator. So if the output voltage is too high, this causes the oscillator to produce shorter pulses, or pulses at a lower frequency, or maybe even momentarily shuts the oscillator down, and conversely if the output voltage is too low. The opto-isolator consists of a LED and a photo-sensitive transistor in a single package, electrically insulated from one another. Together with the transformer, this enables the output to be completely isolated electrically from the mains supply.
In practice you will often see minor variations on the theme. The error amplifier may not exist as such; often the circuit uses the fact that a LED (as in the opto-isolator) doesn't work at all until you apply a certain minimum voltage, and so this voltage is effectively used as the voltage reference.
The oscillator is usually an integrated circuit but this very often drives a separate power transistor to actually switch the current to the transformer on and off.
There is often a filter comprising a capacitor and/or an inductor between the mains input and the bridge rectifier. This prevents any high frequencies from the oscillator leaking out onto the mains and causing interference in other equipment.
Laptops invariably come with a separate switching mode power supply and charger working as above and delivering 15 - 20V. Within the laptop itself this will drive several further switching mode power supplies to generate the several voltages required internally. These work in broadly the same way except that the bridge rectifier and reservoir capacitor are not needed since they are powered by DC from the charger. Also, there is no need for isolation as that function has already been served by the charger, and so a simple inductor is used instead of a transformer.
Low energy light bulbs often contain a switching mode power supply which again doesn't require the isolation and so may not contain a transformer.
Identification of components
The photos show the top and bottom of a switching mode power supply from a wall cube.
On the underneath you can clearly see the bridge rectifier, the oscillator integrated circuit, and the opto-isolator. The latter spans a very clear divide on the circuit board between the high and low voltage parts. Any switching mode power supply you come across without this divide (such as some cheap Far Eastern chargers) are potentially lethal and must be disposed of. (This power supply has a selectable output voltage, the yellow piece being the voltage selector.)
On the top you can clearly see the reservoir capacitor and the transformer, which like the opto-isolator, spans the high/low voltage divide. A switching transistor, driven by the oscillator, does the hard work of switching the current on and off. There is also a mains input filter.
Fault-finding a switching mode power supply may be limited to a visual inspection. Beyond that it's much harder than a linear one on account of the greater complexity. Also, the prevalence of surface mount components makes repair much more difficult.
Laptop and some other "wall-cube"-type or free-standing power supplies have sealed cases and are not generally designed to be opened. If you do crack the case open it's unlikely that you would be able to re-seal it to a standard which would pass an electrical safety test. Were it to come open in use, it's likely that highly dangerous live metal parts would be exposed.
Note that it would normally be very dangerous to try to fault find a switching mode regulator by checking voltages with it switched on since it's not usually possible to expose the low voltage side without also exposing the high voltage side, which is directly connected to the mains. In any case, faults are more likely in the high voltage circuits which are often more complicated.
Before doing any fault finding, disconnect from the mains. Note also that even so, the reservoir capacitor on the mains side may retain a dangerous charge for a long time, which could potentially give you a lethal electric shock.
First of all, taking great care not to touch any connections at all, locate the reservoir capacitor on the high voltage side and short out its terminals with an insulated screwdriver. Usually, its charge will have drained away but be prepared for quite a substantial spark which may startle you or anyone not expecting it. You wouldn't have wanted that through your fingers, would you?
Now you can safely perform a visual check, looking for any signs of overheating, or any leaking or bulging electrolytic capacitors.
Check continuity from the plug through to the bridge rectifier. This will involve the fuse in the plug, maybe another fuse on the circuit board, and often a mains input filter.
Check each of the 4 diodes comprising the bridge rectifier. If you can, test the reservoir capacitor.
Beyond this, testing becomes increasingly difficult. The oscillator is often a integrated circuit which would be hard to test, but sometimes it will comprise one or two transistors which you may be able to unsolder and test. Check the markings on any transistors and Google for them. Should these have failed there's a good chance yo can find replacements.