sleep() [ Sleep ]
ULTRA_LOW_POWER (SystemSleepMode)
// EXAMPLE
SystemSleepConfiguration config;
config.mode(SystemSleepMode::ULTRA_LOW_POWER)
.gpio(D2, FALLING);
System.sleep(config);
Since 2.0.0:
The SystemSleepMode::ULTRA_LOW_POWER
mode is similar to STOP mode however internal peripherals such as GPIO, UART, ADC, and DAC are turned off. Like STOP mode, the RTC continues to run but since many more peripherals are disabled, the current used is closer to HIBERNATE. It is available in Device OS 2.0.0 and later.
Wake Mode | Gen 2 | Gen 3 | Gen 4 |
---|---|---|---|
GPIO | ✓ | ✓ | ✓ |
Time (RTC) | ✓ | ✓ | ✓ |
Analog | ✓ | ||
Serial | ✓ | ||
BLE | ✓ | ||
Cellular | ✓ | ✓ | |
Wi-Fi | ✓ |
Typical power consumption in ultra-low power (ULP) sleep mode, based on the wakeup source:
Device | GPIO | RTC | Analog | Serial | BLE | Network |
---|---|---|---|---|---|---|
P2 | 579 uA | 572 uA | n/a | n/a | n/a | n/a |
M404 | 547 uA | 515 uA | n/a | n/a | n/a | n/a |
M524 | 421 uA | 415 uA | n/a | n/a | n/a | n/a |
T523 Eval | 139 uA | 139 uA | 140 uA | 564 uA | 214 uA | 21.7 mA |
T402 Eval | 114 uA | 114 uA | 117 uA | 530 uA | 186 uA | 16.9 mA |
Boron 2G/3G | 171 uA | 174 uA | 178 uA | 610 uA | 494 uA | 16.4 mA |
Boron LTE | 127 uA | 128 uA | 130 uA | 584 uA | 442 uA | 14.2 mA |
B402 SoM | 48 uA | 47 uA | 48 uA | 557 uA | 130 uA | 9.5 mA |
B523 SoM | 54 uA | 55 uA | 56 uA | 537 uA | 139 uA | 22.8 mA |
Argon | 82 uA | 81 uA | 82 uA | 520 uA | 141 uA | 21.3 mA |
Electron | 2.42 mA | 2.55 mA | n/a | n/a | n/a | n/a |
Photon | 2.76 mA | 2.83 mA | n/a | n/a | n/a | n/a |
In this mode:
- Real-time clock (RTC) is kept running.
- Network is optionally kept running for cellular, similar to
SLEEP_NETWORK_STANDBY
. - On the Argon, network can optionally be kept running for Wi-Fi.
- BLE is kept on if used as a wake-up source (Gen 3 devices only).
- UART and ADC are only kept on if used as a wake-up source (Gen 2 and Gen 3 only)
- GPIO are kept on; OUTPUT pins retain their HIGH or LOW voltage level during sleep.
- Can wake from: Time, GPIO. On some devices: analog, serial, BLE, cellular, and Wi-Fi.
- At least one wake source must be specified in ULP sleep mode.
- On wake, execution continues after the the
System.sleep()
command with all local and global variables intact.
Cellular Devices (B-Series SoM, Tracker SoM, Tracker One, Boron, E404X, E-Series, and Electron):
On Gen 3 cellular devices, wake-on network can be enabled in ultra-low power mode. This is recommended for any sleep duration of less than 10 minutes as it keeps the modem active while in sleep mode.
You should avoid powering off and on the cellular modem in periods of less than 10 minutes. Since the cellular modem needs to reconnect to the cellular network on wake, your mobile carrier may ban your SIM card from the network for aggressive reconnection if you reconnect more than approximately 6 times per hour.
The M-SoM does not support wake on network for cellular or Wi-Fi networks.