Maximizing Battery Life in NB-IoT ESP32 Deployments

NB-IoT deployments often rely on battery-powered ESP32 devicesPeer-to-Peer NFC Communication Between ESP32 DevicesPeer-to-Peer NFC Communication Between ESP32 DevicesDiscover how to set up NFC P2P communication on ESP32 devices. Our tutorial covers hardware, software integration, and practical security measures. in hard-to-reach locations. Power efficiency isn’t optional-it’s existential. This article combines theoretical insights, practical implementation strategies, and real-world examples to help you master Power Saving ModeSIM7000G Module with ESP32: Configuring LTE-M and GNSSSIM7000G Module with ESP32: Configuring LTE-M and GNSSMaster ESP32 integration with SIM7000G for reliable LTE-M connectivity and precise GPS tracking, featuring hardware setup, AT commands, and power tips. (PSM) and Extended Discontinuous Reception (eDRXUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityExplore our detailed tutorial on integrating Quectel BC66/BG96 with ESP32 for low-power, reliable NB-IoT connectivity. Learn hardware setup and AT commands.), two 3GPP-standardized strategies for maximizing battery life in ESP32-based NB-IoT applicationsConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies..

Table of Contents🔗

Understanding PSM and eDRX🔗

Power Saving Mode (PSM)

Overview:

PSM allows NB-IoT devicesConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies. to enter a deep sleep state while remaining registered with the network. During sleep, the device is unreachable by the network but consumes minimal power (~3 µA).

How It Works:

Typical Use: Ideal for applications where the device sends data sporadically (e.g., hourly sensor readings).

AT CommandSIM7000G Module with ESP32: Configuring LTE-M and GNSSSIM7000G Module with ESP32: Configuring LTE-M and GNSSMaster ESP32 integration with SIM7000G for reliable LTE-M connectivity and precise GPS tracking, featuring hardware setup, AT commands, and power tips. Example:

// Enable PSM with T3324 = 5 minutes, T3412 = 1 hour
AT+CPSMS=1,,,"00100001","00100001"
AT+CEREG=5 // Enable network registration updates

Extended Discontinuous Reception (eDRX)

Overview:

eDRX allows devices to periodically check for incoming messages from the network, balancing battery lifeCost Analysis: Total Ownership for ESP32 Connectivity SolutionsCost Analysis: Total Ownership for ESP32 Connectivity SolutionsUnlock cost savings with ESP32 IoT solutions. This guide reveals how to balance hardware, connectivity, power, and maintenance costs to master TCO. with moderate responsiveness.

How It Works:

  • Instead of listening for downlink messages continuously, the device checks for pending data at extended intervals (e.g., every 10.24 seconds to 43 minutes).
  • Uses PTW (Paging Time Window) to stay briefly awake.

Typical Use: Balances battery life with moderate responsiveness for downlink commands (e.g., firmware updatesAWS IoT Core with ESP32: X.509 Certificates and Shadow UpdatesAWS IoT Core with ESP32: X.509 Certificates and Shadow UpdatesLearn to securely connect ESP32 to AWS IoT Core using X.509 certificates and device shadows, with step-by-step instructions and best practices.).

AT CommandSIM7000G Module with ESP32: Configuring LTE-M and GNSSSIM7000G Module with ESP32: Configuring LTE-M and GNSSMaster ESP32 integration with SIM7000G for reliable LTE-M connectivity and precise GPS tracking, featuring hardware setup, AT commands, and power tips. Example:

// Set eDRX cycle to 20.48 seconds (5.12s PTW)
AT+CEDRXS=1,5,"0101"

Implementing PSM on ESP32 with NB-IoT Modules🔗

Using a Quectel BC66Using Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityExplore our detailed tutorial on integrating Quectel BC66/BG96 with ESP32 for low-power, reliable NB-IoT connectivity. Learn hardware setup and AT commands. NB-IoT module with ESP32Setting Up ESP32 as a Wi-Fi Access PointSetting Up ESP32 as a Wi-Fi Access PointMaster ESP32 AP configuration with our step-by-step guide. Set up a secure, local IoT network using practical code examples and optimization tips.:

// Set PSM parameters (T3324 = 5 minutes, T3412 = 1 hour)
AT+CPSMS=1,,,"00100001","00100001"
AT+QSCLK=1 // Enable sleep mode

Breakdown:

Configuring eDRX for Periodic Connectivity🔗

eDRXUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityExplore our detailed tutorial on integrating Quectel BC66/BG96 with ESP32 for low-power, reliable NB-IoT connectivity. Learn hardware setup and AT commands. is particularly useful when occasional downlink communication is needed. Here’s how to configure it:

// Set eDRX cycle to 20.48 seconds (5.12s PTW)
AT+CEDRXS=1,5,"0101"
// Enable PSM alongside eDRX for hybrid operation
AT+CPSMS=1,,,"00000000","00000001" // T3324=0 (immediate sleep), T3412=1 hour

Breakdown:

Combining PSM and eDRX for Maximum Efficiency🔗

For many NB-IoT applicationsConnecting ESP32 to Cloud Services via Wi-FiConnecting ESP32 to Cloud Services via Wi-FiDiscover how to connect your ESP32 to AWS, Azure, and Google Cloud using secure Wi-Fi. This guide covers setup, error handling, and low power strategies., combining PSM and eDRX provides the best balance between power savings and network reachability.

Example Use Case:

Real-World Use Cases: Environmental Sensors and Asset Trackers🔗

Case 1: Soil Moisture Sensor (PSM-Centric)

Case 2: Fleet Tracker (eDRX-Centric)

PSM vs. eDRX: Latency, Power, and Network Trade-offs🔗

ParameterPSMeDRX
Downlink LatencyHigh (hours)Moderate (seconds to minutes)
Current Draw~3 µA (sleep)~1 mA (during PTW)
Network OverheadLow (no paging)Moderate (regular PTW checks)
Best ForAsynchronous uplink-only dataBidirectional, time-sensitive apps

Advanced Techniques: Combining Deep Sleep with PSM/eDRX🔗

1. ESP32 Deep SleepLTE Power Saving: Combining PSM and DRX with ESP32 Sleep ModesLTE Power Saving: Combining PSM and DRX with ESP32 Sleep ModesDiscover how combining LTE power-saving modes with ESP32 sleep techniques can extend battery life in IoT devices while ensuring reliable connectivity. Syncing:

esp_sleep_enable_timer_wakeup(edrx_interval_us - 1000000); // Wake 1 second early
esp_deep_sleep_start();

2. Dynamic Timer Adjustment:

  • Use RSSI to scale T3412: Longer timers in strong signal areas.
AT+CESQ // Check signal quality
if (rssi > -80) AT+CPSMS=,,,"00010000" // T3412 = 2 hours

3. Burst Buffering: Aggregate sensor dataSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsSigfox Message Encoding: Packing Sensor Data into 12-byte PayloadsLearn efficient data encoding techniques for Sigfox's constrained 12-byte payloads. Discover bitwise operations, structured encoding & CBOR strategies. during sleep and transmit in bulk.

Practical Example: ESP32 with Quectel BC66 Module🔗

Step 1: Initialize the NB-IoT Module

#include <SoftwareSerial.h>
SoftwareSerial nbSerial(16, 17); // RX, TX pins for ESP32
void setup() {
  Serial.begin(115200);
  nbSerial.begin(9600);
  // Check if the module is ready
  nbSerial.println("AT");
  delay(1000);
  if (nbSerial.find("OK")) {
    Serial.println("Module ready!");
  } else {
    Serial.println("Module not responding!");
  }
}

Step 2: Enable PSM and eDRX

void enablePSM_eDRX() {
  // Enable PSM with T3324 = 30 minutes and T3412 = 2 hours
  nbSerial.println("AT+CPSMS=1,,,\"01100010\",\"00100010\"");
  delay(1000);
  // Enable eDRX with a cycle of 10.24 seconds
  nbSerial.println("AT+CEDRXS=1,5,\"0101\"");
  delay(1000);
  Serial.println("PSM and eDRX enabled!");
}

Step 3: Transmit Data and Enter Sleep Mode

void transmitData() {
  // Send data to the server
  nbSerial.println("AT+CGDCONT=1,\"IP\",\"your_APN\"");
  delay(1000);
  nbSerial.println("AT+QIACT=1");
  delay(1000);
  nbSerial.println("AT+QISEND=1,12,\"Hello NB-IoT!\"");
  delay(1000);
  // Enter PSM
  Serial.println("Data sent. Entering PSM...");
}

Conclusion🔗

By leveraging PSMUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityExplore our detailed tutorial on integrating Quectel BC66/BG96 with ESP32 for low-power, reliable NB-IoT connectivity. Learn hardware setup and AT commands. and eDRXUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityUsing Quectel BC66/BG96 Modules with ESP32 for NB-IoT ConnectivityExplore our detailed tutorial on integrating Quectel BC66/BG96 with ESP32 for low-power, reliable NB-IoT connectivity. Learn hardware setup and AT commands., ESP32-based NB-IoTFirmware Updates over NB-IoT: Delta Updates with ESP32’s Dual PartitionFirmware Updates over NB-IoT: Delta Updates with ESP32’s Dual PartitionDiscover how delta firmware updates via NB-IoT optimize ESP32 device performance by minimizing data usage and ensuring secure, swift OTA transitions. deployments can achieve remarkable power efficiency without sacrificing connectivity. These strategies are particularly valuable for battery-operated devices in remote or hard-to-access locations. Whether you’re building a smart agriculture system, a utility meter, or an asset tracker, mastering these techniques will ensure your IoT solution is both reliable and energy-efficient.

Pro Tip: Always validate sleep timers with a power profiler. Simulated battery lifeCost Analysis: Total Ownership for ESP32 Connectivity SolutionsCost Analysis: Total Ownership for ESP32 Connectivity SolutionsUnlock cost savings with ESP32 IoT solutions. This guide reveals how to balance hardware, connectivity, power, and maintenance costs to master TCO. ≠ real-world results. Test in your target network-PSM/eDRX support varies by carrier!

Author: Marcelo V. Souza - Engenheiro de Sistemas e Entusiasta em IoT e Desenvolvimento de Software, com foco em inovação tecnológica.

References🔗

Share article

Related Articles