This guide is a demonstration of the new Adafruit Connection Manager library for CircuitPython, along with the new optional timezone argument for the Adafruit IO library.
More Countdown Clocks?
Why on earth might you need another Countdown Clock project? Well maybe you're planning to remotely trigger another device at the end of the countdown, want the option to count past the event, or maybe because your last countdown clock thought it belonged in another part of the world.
Here at Adafruit, we've been offering an easy way for microcontrollers to fetch the current time, via the Time Service integration, as part of Adafruit IO (our IoT platform).
Unfortunately, there have been many cases where the automatic time zone detection has gone haywire, leading to time-based projects not behaving as expected!
Time Zones
Time zones can be tricky, some countries even have a few! That's why when a timezone is not specified, the Adafruit IO Time service uses "automatic timezone detection" based on IP address. This is like having a listing of all the IPs in the world and where they should be located geographically. It's never going to be 100% accurate, as an IP can be shared or recycled or just unlisted. It's estimated to be 99% accurate to the country level.
Instead, the Time Service can accept a requested time zone, and respond with exactly the right time for your location/geography. And now the CircuitPython library for Adafruit IO has been updated to add the optional timezone parameter when requesting the time.
Adafruit Connection Manager
The other new kid on the block is the Adafruit Connection Manager library. This library makes getting connected to the internet on different boards a total breeze, by using standardized methods and providing "helpers" for families of hardware (like ESP WiFi or WizNet Ethernet boards) to make programming easier.
- For more information, read through this Adafruit-Playground Note which explains it in more detail.
Parts
To complete this project you will need a microcontroller board supported by CircuitPython, with a built-in display (or an external one, possibly with minor code changes).
This project was originally written for the Adafruit Feather ESP32-S2/S3 Reverse TFT, but then adapted to also run on the Adafruit Qualia (ESP32-S3) with the 3.2" bar display (820 x 320 pixels). To support this there is a conditional block that selects a larger font and background image when running on the Qualia board.
It should also work on most other boards, although you may want to use a differently sized background image to better suit your display's size and aspect ratio. You can easily edit the supplied image with your favourite graphics editing software (or an online service).
CircuitPython displays refresh much more slowly with overlapping images and labels. On the Qualia the background image is positioned just above the label with no overlap. This brings the refresh speed from under one frame per second up to 5-10fps. Not such an issue on smaller resolution displays (less data to send).
Either use a board with built in display:
Or for the Qualia version:
With either the 3.2" Rectangle Bar display (820x320 pixels):
Or the touchscreen version (which has a bezel with nice rounded corners):
Text editor powered by tinymce.