Adafruit's CircuitPython Gets Initial Deep Sleep Support on the ESP32-S2, Ready for the MagTag

Currently supporting wake from timers only, with wake from pin inputs still to be implemented, the functionality is awaiting merging.

Adafruit is working on merging a pull request which adds deep sleep support to the ESP32-S2 port of CircuitPython, enabling some major power savings that go hand-in-hand with always-on E Ink display modules.

"The MagTag was made for 'deep sleep' thanks to the always-on E Ink display," Adafruit writes of its ESP32-S2-powered low-power display development board, unveiled earlier this month. "Thanks to a new pull request, we’re getting the beginnings of light and deep sleep support. We can get down to 250uA on the MagTag when in deep sleep which will let the board run for weeks at a time."

The pull request, written by developer Dan Halbert based on work carried out by Scott Shawcroft, adds alarms which can be used to wake the ESP32-S2 microcontroller from both light and deep sleep — though the feature comes with a few caveats, including that sleep modes don't truly activate when the microcontroller is connected to USB in order to provide easier debugging and prevent the user being trapped in a "sleep loop."

Another item on the to-do list is the ability to wake the microcontroller based on a pin input, rather than a timer: The current version of the code allows for PinAlarm objects to be created, but they cannot yet be used to wake a system from sleep.

Those interested in the feature can monitor the status of the pull request and see when it is merged on the Adafruit CircuitPython GitHub repository.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire:
Related articles
Sponsored articles
Related articles