This is an old revision of the document!
Power sources tend to provide energy in a form that is not straightforwardly acceptable to IoT devices.
Wall sockets provide relatively high voltage alternating current (AC) that needs to be lowered and converted into DC, also stabilised as required by MCU, which is fragile for voltage variations. Common conversion flow for AC sources is present in figure 1. DC power sources (such as batteries) also require voltage conversion and stabilisation. The flow is present in figure 2.
Common voltage conversions are:
AC-to-AC
AC-to-AC conversion is used whenever a high-voltage source is available and is required to lower it, typically somewhere between 12V and 5V.
Historically, AC-to-AC conversion was implemented using a transformer (symbol in figure 3). This technique has serious drawbacks:
Modern converters use a switching-mode power supply (SMPS) without a transformer, just a small coil. Those converters used to be much more complex, but nowadays, most of the circuit is implemented in a single, integrated chip. Currently, the cost of the SMPS is much lower than the transformer-based one. SMPSes are:
AC-to-DC
In general, IoT devices use DC to power MCUs and peripherals. A classical AC-to-DC conversion involves a Graetz's bridge with 4 diodes, currently implemented commonly in a single enclosure as in figure 6.
SMPS is used to integrate all necessary functions (including voltage stabiliser) in a single device, e.g. in figure 7.
Filtering
Proper filtering of the current interferences is essential to ensure stable MCU operation. Even when using good quality power sources, nearby communication wires, power wires, and electromagnetic fields generated by actuators can cause serious interference voltage rise and drop. For this reason, the use of capacitors is essential. A rule of thumb is to add a large capacity (e.g. 1000uF) capacitor on the power bus and 100nF capacitors close to the IoT device's MCU and other sensitive components. It may be specific to the device, so unstable work may require analysis of the power bus interferences regarding their frequency and amount.
DC-to-DC
The DC-to-DC conversion is needed whenever the source voltage is unsuitable for an IoT device. It is also needed in the case of batteries as a second stage after AC-DC conversion. DC-DC converters involve voltage stabilisation.
Modern DC-to-DC converters are implemented with fixed output voltage or regulated to decrease (step-down) or increase (step-up) the voltage. There are even circuits that can implement both: step-up-down, depending on the regulator.
Former solutions include linear voltage stabilisers (only step-down), e.g. popular and still used 7805 chip (figure 8). Depending on their application and maximum current, linear stabilisers are available in various enclosures.
They have several drawbacks, however:
Their advantage is that they are much easier to embed into the circuit as use requires only a few passive components. The sample application circuit is quite simple and present in figure 9.
Modern DC-DC converters are of high efficiency, easily going over 90%. They are implemented as switching regulators rather than linear. The construction of the switching converters is quite complex. Sample device with fixed voltage regulation is present in figure 10 and the one with variable voltage, in figure 11. The output voltage can be set using a potentiometer.