Power management is one of the most distinctive and important features of XBee devices, enabling them to optimize energy consumption by entering sleep mode when not in use and waking up only when necessary. This ability to conserve power is crucial in applications where battery life is a priority, especially in remote or off-grid locations where replacing or recharging batteries can be difficult and costly.
The XBee 3 BLU device offers several sleep modes to suit different applications and product types, including:
-
Pin Sleep: The device enters sleep mode and wakes based on external pin control.
-
MicroPython Sleep: MicroPython script controls when the module enters sleep mode and wakes.
In addition to sleep modes, the XBee 3 BLU device allows you to control the amount of power used for some transmissions:
-
Bluetooth transmit power: Allows you to control the transmit power used for Bluetooth advertisment messages.
Managing sleep mode in XBee devices
XBee devices offer flexible and configurable sleep modes, which are managed through a combination of settings and specific pins on the module.
Sleep settings
The main setting that controls the sleep mode is SM
(Sleep Mode), but additional parameters may also be required depending on the type of sleep mode configured.
-
SM (Sleep Mode): Sets the sleep mode (e.g., Pin Sleep, MicroPython Sleep).
For more information about the supported settings in the XBee 3 BLU device, refer to the Sleep settings commands. |
Sleep pins
In addition to configuring sleep mode via settings, several hardware pins are available on XBee modules for managing and monitoring sleep and wake states. Here’s an overview of the key pins involved:
Pin | Description |
---|---|
DTR/SLEEP_RQ |
|
SPI_SSEL |
|
ON_SLEEP |
|
CTS |
|
DIO0 |
|
For more information about the pinout of the XBee 3 BLU device, refer to the Device pinout. |
Design considerations
Before using sleep mode, it’s essential to consider the structure of your solution and the specific needs of your XBee network.
-
Periodic Data Transmission: Certain applications, such as environmental monitoring, are well-suited for sleep mode. In these cases, the modules only need to send data at regular intervals, and are not expected to receive data frequently. As a result, the XBee devices can stay in sleep mode most of the time, waking up only to transmit the sensor data and then returning to sleep, maximizing power efficiency.
-
Event-Driven Data Exchange: Other applications, such as industrial automation, require more frequent communication or bi-directional data exchange. For example, an XBee might need to send sensor data while also waiting for commands from a central system. In such cases, sleep mode may be triggered by specific events, allowing the device to conserve power but remain responsive to important communication events.
While sleep mode provides significant power savings, there are certain moments when the device cannot enter low-power mode. Since the XBee stops executing instructions during sleep, it’s important to avoid sleep when the device has tasks to complete. The device will not enter sleep mode if any of the following conditions are met:
-
The device is operating in Command mode or in the process of entering it (using the
+++
sequence). -
The device is processing AT commands from API mode.
-
There is data queued on the serial port and it is not blocked by RTS flow control.
-
In Pin Sleep mode, sleep can be delayed long enough for a character to be received on the UART.
-
The Sleep Request pin is not asserted while in Pin Sleep mode.