RU   EN

Battery Power Saving

ESP8266 and ESP32 do not cut off power on the 3.3V pin during sleep mode, which means that I2C-connected modules will continue to draw current from the battery. Therefore, if additional I2C sensors are connected — for example, the SCD41 air quality sensor — a power switch using a P-MOSFET or an Input Switch can be added to save battery life in sleep mode.

If only a display and a BME280 temperature sensor are connected, the overall consumption is much lower than that of the ESP itself and does not significantly affect battery life (tens of µA). The SCD41 sensor, however, consumes 3–5 mA — considerably more than all other modules combined — and in this configuration, a 1300 mAh battery can discharge by about 20% per day even if the ESP is in deep sleep (since the SCD remains powered).

In testing, the version using a P-transistor power switch was used because it is easier to solder. A variant using the TPS22810 chip also works, but requires a small SC-70 adapter board — the package is very small, and its pins cannot be easily soldered by hand.

To enable the power control switch, you need to define the corresponding settings in the firmware file UserDefines.h

// For ESP32 — any free GPIO pin available for OUTPUT mode. For ESP8266 — not tested (all pins are in use except D4, which might work; no restrictions were documented).

#define VCCCONTROLL_PIN 2 // pin controlling power for I2C modules

// For the P-transistor version

#define VCCCONTROLL_ON LOW

#define VCCCONTROLL_OFF HIGH

// For the TPS22810 version

#define VCCCONTROLL_ON HIGH

#define VCCCONTROLL_OFF LOW

Components [P-Transistor Version]

Components [TPS22810 Version]

The resistor values are not strict — they were chosen from available components during testing (the smaller the resistance, the better protection against noise, but the higher the power consumption). In many transistor circuits, capacitors are sometimes omitted, but they are also recommended here to help eliminate noise.

You can first assemble only the power switch on a breadboard and test it in advance — by applying (−) to the (G) pin of the transistor and verifying that voltage appears on (D).

Example of adding a power switch using a P-transistor:

Based on testing with a 1300 mAh battery — the ESP32 S3 SuperMini board (≈ 2% per day) with a P-MOSFET power switch consumes slightly more compared to the ESP8266 D1 Mini (≈ 1% per day). Overall power consumption depends on the ESP32 board design itself — generally, bare ESP8266 and ESP32 chips consume about the same in similar operating modes.

X