====== Powering of the IoT Devices ======
{{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_m.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\
IoT requires a constant and reliable power source to operate devices, sensors, and communication effectively. The choice of power source for IoT devices is from traditional batteries to cutting-edge energy harvesting technologies.
The factors influencing the choice are:
* device size,
* working environment,
* intended operation,
* lifetime of the device,
* operation reliability and availability.
The majority of IoT devices use a DC power source. AC is usually converted into the DC, eventually used for powering high-power actuators. Most IoT devices rely on batteries as their energy source, which is common in edge devices. Fog devices are powered with a mixture of the sources: battery (DC) or socket/grid (AC). Green energy sources are introduced in both classes; the choice of technology depends on the IoT application domain and scenario.
Batteries (non-rechargeable or rechargeable) provide DC. A plain battery's voltage (e.g. 1.5V or 3.7V) is unsuitable for directly powering the devices. The raw battery changes its voltage over time as the discharge process occurs. For those reasons, converters and stabilisers are used. In the case of modern rechargeable batteries, a charging and discharging module (battery management) is also necessary to prevent overcharging and overdraining. \\
Using green energy sources requires conversion and energy storage as its nature is non-consistent in the time domain. Using green energy as a power source requires a different approach towards IoT device control algorithms because of the unpredictable nature of the green energy sources. It is common for devices to put themselves into the low power consumption mode on demand because of the sudden lack of energy.\\
The majority of IoT devices require one or two voltage standards to power microcontrollers and sensors:
* 5V - common of older microcontrollers (such as AVR) and for most peripherals,
* 3.3V - for recent microcontrollers, more and more peripherals are 3.3V powered.
Integration of the 3.3V and 5V components in one IoT device is not always straightforward: while controlling a 5V powered device with a 3.3V signal is usually non-problematic (GPIO-IN), the opposite requires signal conversion because most devices do not accept overvoltage on their inputs! Driving a 3.3V GPIO with 5V can damage a device!
A special note on powering IoT devices with inductive actuators: a separate DC powering rail should be used. Actuators using electromagnetic components, such as relays, motors and servos, should not share a powering bus with MCU. They introduce profound inference into the power rail (both rising and falling the nominal voltage), thus frequently causing instability or rebooting of the MCU due to the over / under voltages or even leading to permanent damage. Eventually, capacitor-based filtering can be introduced to reduce power rail inference if separation is impossible.
When dealing with high current, high voltage or high inference devices, it is expected to use physical separation of the signals with means of e.g. optocouplers.
During their operation, IoT devices commonly control their power sources regarding their condition (e.g., remaining energy, ageing symptoms). In the simplest case, the battery terminal can be connected to the A/D GPIO (usually via a voltage divider). It is also expected to measure battery drain, constantly monitoring both current and voltage, thus calculating energy consumed. Battery Management Systems can be a stand-alone module or can be a part of the IoT device. In the first case, using some communication protocol to monitor power source status is required (e.g. Serial or I2C). IoT devices can then inform the IoT ecosystem about, e.g., approaching running out of power. They can also limit their energy consumption by switching to sleep mode.
The following chapters discuss more on the powering of the IoT devices:
* [[en:iot-open:hardware2:powering:IoT energy sources]],
* [[en:iot-open:hardware2:powering:batteries]],
* [[en:iot-open:hardware2:powering:converters]],
* [[en:iot-open:hardware2:powering:greenenergy]].