Low Power Operation
In most examples when your device goes idle, it will go into a sleep mode automatically. In the best case,
-
v6 boards draw:
- ~10 uA via 3.6V Vbat at room temp
-
v4 boards draw:
- ~30µA via 3.6V Vbat at room temp.
Optimizing for low power does take some extra work to make sure all sources of current draw are turned off. The active sleep sample in NFED does this for you.
If you'd like to optimize manually, here are some important steps to getting low power.
-
Remove all connections to SWD programmer
-
Set your prj.conf to match these values
# Stacks and heaps CONFIG_MAIN_STACK_SIZE=4096 CONFIG_HEAP_MEM_POOL_SIZE=16384 CONFIG_GPIO=y CONFIG_I2C=y CONFIG_SPI=y CONFIG_DEBUG=n # Add the accelerometer CONFIG_SENSOR=y CONFIG_LIS2DH=y CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_SERIAL=n # Zephyr Device Power Management CONFIG_DEVICE_POWER_MANAGEMENT=y CONFIG_PM=y # Network CONFIG_NETWORKING=y CONFIG_NET_SOCKETS=y CONFIG_NET_NATIVE=n CONFIG_NET_SOCKETS_POSIX_NAMES=y # Modem CONFIG_NRF_MODEM_LIB=y # Enable Zephyr application to be booted by MCUboot CONFIG_BOOTLOADER_MCUBOOT=yImportantly the accelerometer needs to be enabled and
CONFIG_SERIALMUST be set to =n. This turns off all console/debug output to the USB to UART chip. -
In an
boards/circuitdojo_feather_nrf9160_ns.overlaydefine the following:&i2c1 { lis2dh@18 { compatible = "st,lis2dh"; label = "LIS2DH"; reg = <0x18>; irq-gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>, <&gpio0 30 GPIO_ACTIVE_HIGH>; disconnect-sdo-sa0-pull-up; }; };disconnect-sdo-sa0-pull-upsaves about 130µA during sleep as it disables a Pull-Up within the LIS2DH12TR that is connected to the grounded SDO pin.
If you only have one thread running you can put the device into idle this way:
while (1)
{
k_cpu_idle();
}
Examples like the Asset Tracker will manage this state for you.
PSM (Power Saving Mode)
PSM allows the modem to sleep for extended periods between data transmissions, dramatically reducing current draw. To request PSM, use the lte_lc API:
#include <modem/lte_lc.h>
// Request PSM with a 30-minute periodic TAU timer and 10-second active time
lte_lc_psm_req(true);
Or configure it statically in prj.conf:
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_PSM_REQ=y
CONFIG_LTE_PSM_REQ_RPTAU="00000110" # 30 minutes
CONFIG_LTE_PSM_REQ_RAT="00000101" # 10 seconds active time
Important: PSM is not guaranteed — it depends on your carrier supporting it. On some LTE-M networks, PSM may not be available at all, leaving the modem active at full power. If you need guaranteed low power, design your application to power the modem on only when needed using
lte_lc_offline()andlte_lc_normal().
eDRX (Extended Discontinuous Reception)
eDRX is a lighter-weight alternative to PSM that keeps the modem reachable but reduces how often it listens for pages:
CONFIG_LTE_EDRX_REQ=y
CONFIG_LTE_EDRX_REQ_VALUE_LTE_M="0101" # ~81 seconds
CONFIG_LTE_EDRX_REQ_VALUE_NBIOT="0101"
eDRX has wider carrier support than PSM and is a good first option when PSM is unavailable.