Spare time has been at a bit of a premium recently. Work has been keeping me especially busy just lately, and then the release of Civilization VII successfully stopped me getting anything else done for at least another weekend. All that meant that my little Pico/e-Ink project had to take a back seat for a little while. Now it’s time to get it moving again.
I kicked this project off last month, with the aim of using a Pico 2 W microcontroller and an e-Ink display to build a small gadget I could stick on the side of the fridge to give me a quick visual indicator each week of which bins were due to be put out. You can read the first part of the story here.
When I left off, I had a small MicroPython application running that happily displayed the upcoming bin schedule. The downside is that I need to keep the Pico plugged into a power supply for it to work, and I really want to have it battery-powered to eliminate wires. The display really only needs to update once each day, and so to make sure I have a decent battery life, I need to be able to put the Pico into a deep sleep when it’s not actually doing anything, having it wake briefly once a day to refresh the display.
The Pico 2 W does support a deep sleep state. After scouring the Internet, from what I could gather, it wasn’t possible to enter deep sleep via MicroPython. Luckily for me, somebody else has already been down this route before. Somebody called ghubcoder posted an article in 2021 about how to do exactly this: Deep sleeping the Raspberry Pico with Micropython. This looks to be exactly what I need.
It’s not straightforward, I have to recompile MicroPython to build custom firmware, and things have changed in the pico-sdk and pico-extras since that post was written, but after an afternoon of head-scratching and poking around, I’m finally getting somewhere. I can get most way through the build process, but there are problems with the real-time clock module:
cannot find -lhardware_rtc: No such file or directory
The Pico 2 W is relatively new. Maybe it’s not fully supported yet? I try rebuilding it, this time targeting the Pico W board, and this time everything compiles just fine. I guess some things are still a work-in-progress.
I order myself a Pico W, and when it turns up a couple of days later, I successfully install my new custom firmware.

So far, so good. I try running some code to put it into sleep mode, and… it just hangs. Whenever I try using the sleep functions in pico-extras, my Pico shuts down and never comes back to life. I need to power-cycle it to get it back up and running.
It’s entirely possible I’m just not doing the right things – as I’ve said before, hardware is well outside my comfort zone, and I’m just fumbling in the dark here – but based on my reading of the code and comments, it does seem like it should work.
After a while randomly searching the Internet for any clues that might help me, I stumble upon a thread in the Raspberry Pi forums: How do you get a Pico W to sleep? I remember reading this before, but reading it more closely now, I spot something that had passed me by on first reading. The paragraph that caught my attention read:
My example does not use lightsleep rather it uses time.sleep_ms().
It uses a second project of mine https://github.com/cpottle9/RP2-PowerControl.
This project allows you to choose which RP2040 hardware blocks are running based on your applications needs.
This app should work with any version of micropython. I’ve tested in 1.23.0, 1.24.0, and recent 1.25.0 previews.
Now, that looks interesting. I need to take a closer look at that RP2-PowerControl project.
To be continued…
Leave a Reply