Power supply: Operate IoT smart home devices off-grid.
Depending on the kit, one of the following two development boards is a central component of our NEOE IOT kits:
- D1 Mini (with ESP8266 processor)
- LOLIN32 (with ESP32 processor)
Both development boards have a micro-USB connection and can therefore be easily operated with a conventional USB charger. This type of operation via a USB charger is usually the most frequently used option.
However, there are situations when there is no power outlet nearby and the NEOE-IOT kit should still work. One example is our soil moisture sensor for monitoring plants.
The following battery operation options are available for this:
Battery operation: options
In addition to operation with a power bank, operation with NiMH batteries is sometimes also useful. Let's consider the options in detail:
Operation with a power bank
This is the simplest, but also the most expensive variant.
In addition, a power bank also requires additional space.
This option is therefore less elegant for continuous use, possibly also in a housing produced by yourself using a 3D printer.
The advantage of a power bank, however, is the high energy density and easy handling.
This is a good option for a test run.
Operation with a LiPo battery
Separate LiPo batteries, such as those used in drones, for example, are also characterized by a high energy density. The LOLIN32 board even offers a LiPo battery connection.
However, we consider LiPo batteries to be too dangerous in continuous operation, because LiPo batteries can catch fire or explode. Therefore, LiPo batteries that are used for drones must also be stored in so-called fireproof battery safes.
We advise against using LiPo batteries in the smart home area if you are not constantly in the vicinity and can extinguish a fire that may break out.
Thus, from our point of view, the use of LiPo batteries is less practical or can even be fire hazard in the truest sense of the word.
Operation with NiMH batteries
NiMH batteries are somewhat larger and heavier than LiPo batteries. But they are cheaper and safer.
The ESP32 processor of the LOLIN32 recommended below can be operated with voltages from 2.3 V to 3.6 V. Three NiMH batteries with 1.2 V each have a total voltage of 3.6 V and can therefore be connected to the 3 V input of the development board.
Operation with three Mignon (AA) NiMH batteries is from our point of view the most sustainable solution.
Due to the low price, we recommend buying branded products (e.g. VARTA) to be on the safe side.
Hardware and software optimization
In order for the operation with NiMH batteries to be enjoyable for a long time, and the batteries are not empty after a few hours, the corresponding NEOE-IOT kit must be optimized in terms of hardware and software.
There are the following options for optimization:
Use DeepSleep mode
First of all, the microprocessor's DeepSleep mode can be used.
The larger the deep sleep phases between the individual measurements, the lower the power consumption.
In addition, the power supply to the sensors can be switched on and off via the software, if required, in order to save further electricity.
Selection of energy-saving components
According to our measurements, the LOLIN32 needs a little less power than the D1 Mini in DeepSleep mode:
- DeepSleep power consumption D1 Mini: approx. 260 µA
- DeepSleep power consumption LOLIN32: approx. 150 uA
We therefore prefer the LOLIN32 for autonomous operation. The batteries last almost twice as long with a LOLIN32 before they have to be recharged.
No continuous operation of displays
In our opinion, a continuously lit LED, an LCD or OLED display also consume too much power for battery operation. It therefore makes sense that IOT smart home devices intended for autonomous operation do not have an LCD or OLED display. For example, an LED should only flash to signal an "exceptional state" (e.g. urgent watering of the plant).
Switch off the power supply to the sensors when not in use
Many sensors also need electricity to operate. The capacitive soil moisture sensor, for example, has a power requirement of approx. 3.5 mA. Therefore, their power supply via the GPIO pins of the development board should only be switched on when required and switched off again after the measurement (where technically possible and sensible).
NEOE-IOT-Kit: Soil moisture sensor for monitoring plants
One measurement per hour is sufficient for this sensor, as plants usually use up the available water slowly.
Let's consider the parameters in detail:
- Power consumption LOLIN32 in DeepSleep mode: approx. 150 µA (0.15 mA).
- Power consumption in measuring mode: approx. 75 mA (LOLIN32 development board and capacitive soil moisture sensor).
- Measurement duration: approx. 7 seconds (depending on how quickly the connection to WLAN and MQTT server is established).
- Capacity of our VARTA NiMH batteries: 2100 mAh.
Based on these parameters, we can calculate the possible battery life:
- In total, average power consumption (simplified calculation): 0.15 mA + ((75 mA x 7 seconds) ÷ (60 seconds x 60 minutes)) = approx. 0.3 mA
- Battery life (hours): 2100 mAh ÷ 0.3 mA = approx. 7000 hours
- Or approx. 292 days (7000 hours ÷ 24 hours per day)
- Or about 9.7 months (7000 hours ÷ (24 hours per day x 30 days per month))
Full autonomy with solar cell
If the above-mentioned soil moisture sensor is used outdoors, full autonomy is certainly desirable. We can supplement the soil moisture sensor with a solar cell and a charge controller module. Of course, all components must then be housed in a rainproof housing (currently not part of the kits).
The solar operation works well on sunny days and in direct sunlight. However, solar cells produce almost no electricity on cloudy days. It is therefore important that both batteries and solar cells are designed in such a way that, on the one hand, cloudy periods of several days can be bridged and, on the other hand, the batteries gain sufficient charge on a sunny day.
Our NEOE kit, "Extension for solar operation" contains a 60 mA solar cell in addition to the battery compartment and charge regulator.
The soil moisture sensor consumes 0.3 mA x 24 hours = approx. 9.6 mA per day.
With an average of 4 hours of sunshine per day in Germany, at least in Outside operation enough Buffer for full autonomy.
If the device is operated on a window (with less solar radiation and fewer hours of sunshine), the battery life is at least further increased.
Disclaimer - all information without guarantee:
The information contained in this tutorial (contribution) has been researched and compiled to the best of our knowledge and belief. However, mistakes can happen to us too. And something can also go wrong during the implementation of the tutorial or the content can be misunderstood. We cannot therefore accept any liability for any damage caused by following this tutorial. We are continuing to develop our tutorials. If something is inconsistent or unclear, please let us know so that we can correct or add to the point concerned. Thanks very much.