Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to achieve longer MCU battery life with low power sleep mode

By Ayush Jain July 28, 2022

There are generally six power modes in an MCU:

  1. Run: In full run mode, an MCU consumes full current. This mode is best suited for applications where power efficiency is not essential.
  2. Doze: As we know, power increases proportionally to the frequency. Therefore, we can conclude that higher clock speeds tend to higher power consumption. Doze mode helps to reduce power consumption. In Doze mode, the CPU and Flash memory runs at a lower clock rate than the rest of the chip as Flash and CPU are very power-hungry components.
  3. Idle: In idle mode, the CPU and Flash stop, and the rest of the chip continues to operate.
  4. Sleep: In sleep mode, we can save more than 90% of the power consumed in Run. Typically, MCUs achieve the lowest power consumption in sleep mode, consuming nano amps or microamps of current. The CPU, Flash, and most peripherals are disabled or offline in this mode. Some peripherals are available, like the A/D, UART Interrupt, and some timers, which allow the MCU to accomplish some work in the system, waking it up at a specific time.
  5. Low Voltage Sleep: In this mode, a second regulator can be employed to reduce the voltage to the logic gates. This significantly reduces the leakage current of the MCU.
  6. Deep Sleep: In this mode, the CPU, flash, RAM, and nearly all peripherals are disabled. Only low-power peripherals, such as the Real-Time Clock, Deep Sleep Brown-out for detecting battery droop, a watchdog timer, and the ultra-low-power wake-up feature, remain powered. With power removed from most of the chip, the current consumption can be as low as 20nA.

In this series, we will present three experiments to better understand the low power mode.

Experiment 1

Aim
To run an MCU on low power mode, read the temperature and humidity reading using the AHT10 sensor, and send the reading over WiFi.

Requirements

  1. MCU: ESP32-WROOM-32D (generic Wi-Fi + Bluetooth + Bluetooth LE MCU module)
  2. Sensor: AHT10 (temperature and humidity sensor)
  3. Battery: AA battery MX1500 (3.6V, 2700mAh)

Theory
In this experiment, we are using the MCU ESP32-WROOM-32D. Here we will learn how to use a timer to wake up the ESP32. The ESP32 will remain in the active mode for 2-3 seconds, take the temperature and humidity reading, and send it over WiFi. After that, the ESP32 will be back in deep sleep mode. It will remain in deepsleep() mode for five minutes.

ESP32 power modes
The ESP32 chip has mainly two types of processors, the main and the ultra-low power, or ULP processor. ESP32 usually consumes about 75mA current in normal operation and about 240mA while transmitting data over WiFi. ESP32 deep sleep mode will reduce the power consumption and increase the battery life as every mA is critical with a battery. Five configurable power modes manage ESP32’s current consumption.

  1. Active
  2. Modem Sleep
  3. Light Sleep
  4. Deep Sleep
  5. Hibernation

The table below details the power modes:


In the deep sleep mode, the RTC (real-time clock) controller, peripherals, and memories are in active mode. Most of the RAM with all the digital peripherals and the CPU is powered off in deep sleep mode. Only the RTC module is active, which results in the data loss not initially present in the RTC recovery memory. If the ULP co-processor is turned on, the current consumption goes low to 0.15 mA – 10 µA. Note that the system cannot go into deep sleep mode automatically.

The function that can be used to activate the deep sleep once wake-up sources are configured immediately is:
“esp_deep_sleep_start()”

ESP32 wake up sources
There are several ways to wake up the ESP board from deep sleep mode.

  1. Timer, wake up. Waking up your ESP32 using predefined periods of time, which is achieved through the function: “(esp_sleep_enable_timer_wakeup(sleep_time_in_us)”
  2. Touch pin wake-up. We can wake up the ESP32 from deep sleep using the touch pins achieved using the following function:
    “esp_sleep_enable_touchpad_wakeup()”
  1. External wake-up. We can wake up the ESP32 using multiple RTC GPIOs. There are two different logic functions.
    Wake up the ESP32 if any of the selected pins are high.
    Wake up the ESP32 if all the pins you’ve selected are low.

We need to use the following function:
“esp_sleep_enable_ext1_wakeup(bitmask, mode)”

Schematic
In this schematic, you may recognize functions we studied in earlier articles to reduce power consumption. We run the circuit on a low power supply (3V). The value for the resistor with the LED is of high value(1K), and the pull up for Enable pin is also of high value (20K). We have not used the pull-ups for the I2C connection because we will use the internal pull-ups of the ESP32 instead.

Fig: 1 MCU Deep Sleep Mode Schematic

Experiment setup
Below is the image showing the setup of the experiment.

Fig: 2 Experiment Setup

 

Code 

Observation table

Fig: 3 Current consumption by module

  1. The Current Consumption by the ESP32 in active mode is ~123 mA.
  2. The battery capacity is 2700 mAH.
  3. According to the battery’s datasheet, its shelf life is about seven years.
  4. The monthly self-discharge rate of the AA alkaline battery is 0.3 %.
    Battery Capacity(mAH) * Self Discharge Rate / 100 = Self-Discharge Current (mAH)
    2700 mAH * 0.3 / 100 = 8.1 mAH

This means that a 2700 mAH battery will self-discharge 3% losses or 8.1 mAH of its capacity after one month.
                       Shelf Life = 2700 mAH /( 8.1 mAH) = 333.3 months = ~ 27 Years

  1. Battery life calculation,

Fig: 5 Battery life calculation

Results
Below are the results of the device’s data sent to the ThinkSpeak Platform.

Fig: 6 Readings of Temperature from AHT10 sensor (left). Readings of Humidity from AHT10 sensor (right)

According to the above, the battery with 2700mAH capacity will have a life of approximately 261 days if the current drawn from the battery is 123mA during active mode.

You may also like:


  • What are top applications of CAN protocol?

  • How does LoRa modulation enable long-range communication?
  • battery selection low power design
    What are the battery-selection criteria for low-power design?

  • Key factors to optimize power consumption in an embedded device

  • What is a low power design?

  • How to use ESP32’s sleep and wake-up modes in MicroPython

Filed Under: PIC Microcontroller, Power, Tech Articles, Tutorials
Tagged With: ESP32, low power, pic, power modes, ULP
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • High Side current sensing
  • How to simulate power electronics converter in PSpice?
  • Voltage mode pushpull is a nonsense SMPS?
  • Layout IRN reduction in Comparator

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe