If you'd like to maximize the battery life on a CircuitPython project, you need to be able to put your program to sleep when it's not doing something. For instance, you may want to read a temperature or fetch some data only every few minutes or hours. In between, your board can go to sleep and draw only a tiny amount of power from the battery.

If you're using a display that is visible even when powered off, such as the e-ink display on the Adafruit MagTag, then you can sleep between updates to the display.

This guide will talk about using the sleep and wake-up alarm capabilities that are available in CircuitPython.

As of 6.2.0, alarms and sleep are currently available only on the ESP32-S2 platform. Support on more platforms will be added.

This guide was first published on Dec 17, 2020. It was last updated on Dec 17, 2020.

This page (Overview) was last updated on Jun 16, 2021.

Text editor powered by tinymce.