In many cases, it may be necessary to convert AC to DC. The power grid uses AC, but many devices operate on DC, which means a rectification should happen in their circuit. Charging batteries, powering LED lighting and operating microcontrollers, computers and their components all require direct current.
By rectifying a sinusoidal signal with a single diode, the diode blocks the current in the negative half-periods and doesn't affect the positive half-periods, except for a loss of about 0.7 [V], meaning the diode "stole" some voltage from the load. This is a rectifier, because the current no longer changes direction.
Rectification can be done more effectively with the right configuration of 4 diodes. The current is diverted to the load from both directions so that the positive and negative half-periods flow in the same direction. Two diodes are used at a time. In most cases the AC signal is not immediately rectified, but first transformed down, since 5V, 12V, 24V or other lower voltages are usually required instead of 230V.
Prior to the availability of low-cost semiconductor diodes, center-tapped transformers were used to convert AC to DC, since only two diodes are required for the rectifier. Today this method is less relevant.
The output signal will be useful if it has as little fluctuation as possible. A capacitor connected in parallel with the load will charge up every period and discharge when the voltage starts to drop. During this, current flows through the load, making its voltage function more similar to the desired horizontal line
In a linear power supply, the input AC signal is first reduced to the desired voltage by a transformer, and then converted to a stable DC signal by a rectifier and capacitor. The dependence on load and input is reduced by a voltage regulator. A fuse and an on-off switch are also placed in the circuit. The problem with such a simple design is that a very large transformer is required, which increases the size, weight and losses.
Unlike conventional linear power supplies, SMPS (Switching Mode Power Supply) converts electricity by switching on and off at high frequencies. The rectification occurs immediately after the AC input, followed by the capacitor responsible for smoothing the signal. This high voltage is switched on and off, then a transformer is used to lower the signal. Since the power is transferred through the transformer at very high frequency, the size of it can be a fraction of that of a linear power supply. The output has additional capacitors which perform the usual filtering function.
Because of their small size, high power and efficiency, almost every gadget in the world uses an SMPS, which also makes them dangerous to take apart without expertise. The high voltage of the capacitor after the rectifier can cause serious injury, such components can retain their charge for years. In more sophisticated solutions, bleed resistors are added parallel to the capacitors to discharge them when the device is off.