FeatherClock is a project for the ESP32-based Adafruit Feather HUZZAH32 (hence the name) or the Raspberry Pi Pico W or , both running running MicroPython.
It uses the Adafruit FeatherWing four-digit, seven-segment LED add-on, or the equivalent 16 x 8 matrix LED add-on — or any other HT16K33-based segment LED for that matter. You’ll want a non-FeatherWing display if you’re assembling a Pico W, for which you’re free to select any of its I2C pins. The Feather/FeatherWing combo requires specific pins, but the display assembly fits directly on top of the MCU board into a single, convenient unit.
Note I previously supported the Adafruit Feather HUZZAH ESP8266, but this is no longer the case: its RTC is poor and it has too little memory. If you are using this board, you can find the original, un-updated code in the repo’s archive
directory.
The code is an attempt to replicate my Electric Imp clock project. Currently, the clock has no remote control, which the Electric Imp Platform makes very easy to implement, but is rather less so here. You can set preferences, though. Adding a web UI, served locally or remotely, lies in a future phase of the project.
The project makes use of the HT16K33-Python library.
Version 1.4.0 includes the option to alternate the clock with a readout of the current outdoor temperature. This requires the prefs.json file to be updated with additional keys, and this has been done with the sample file included here (see Clock Settings, below). It is easy to turn off this feature if you don’t require it: change the value of the show_temp key to false, or comment out the line. By default, the clock will not enable this feature.
The temperature is collected from Open Meteo, which provides free access for low-volume, non-commercial applications. The code contains a basic Open Meteo integration class, which can be extracted and used elsewhere.
Version 1.4.0 of featherclock
also includes the option to alternate the clock with a readout of the current day of the month and the month. This requires the prefs.json file to be updated with additional keys, and this has been done with the sample file included here (see Clock Settings, below). It is easy to turn off this feature if you don’t require it: change the value of the show_date key to false, or comment out the line. By default, the clock will show the date.
For ESP32 boards
pyboard.py
from GitHub.pyboard.py
to a location accessible via your $PATH
. Rename it pyboard
.esptool.py
using brew install esptool
For Pico W boards
pyboard.py
from GitHub.pyboard.py
to a location accessible via your $PATH
. Rename it pyboard
..uf2
file onto the mounted RP2
drive.Pre-requisites
git clone https://github.com/smittytone/FeatherClock
cd FeatherClock
python -m venv .python
source .python/bin/activate
pip3 install -r requirements.txt
deactivate
For ESP32 boards
ls /dev/cu*
(macOS) or ls /dev/ttyAM*
(Linux)esptool.py --chip esp32 --port <FEATHER_DEVICE_PATH> erase_flash
1. esptool.py --chip esp32 --port <FEATHER_DEVICE_PATH> --baud 460800 write_flash -z 0x1000 ESP32_GENERIC-20241129-v1.24.1.bin
cd featherclock
./install.sh <FEATHER_DEVICE_PATH>
3
for an ESP32 device.For Pico W boards
ls /dev/cu*
(macOS) or ls /dev/ttyAM*
(Linux)RPI_PICO_W-20250415-v1.25.0.uf2
cd featherclock
./install.sh <FEATHER_DEVICE_PATH>
W
for a Pico W.For now, the clock’s prefs are set by sending over a prefs.json
file with the following values:
{ "mode": <true/false>, # 24-hour (true) or 12-hour (false)
"colon": <true/false>, # Show a colon between the hours and minutes readouts
"flash": <true/false>, # Flash the colon symbol, if it's shown
"bright": 10, # Display brightness from 1 (dim) to 15 (bright)
"bst": <true/false>, # Auto-adjust for Daylight Saving Time
"do_log": <true/false>, # Write log data to the file `log.txt` on the device
"show_date": <true/false>, # Alternate clock with day and month readout
"show_temp": <true/false>, # Alternate clock with outside temperature
"lat": float, # Your location, in latitude and longitude
"lng": float
}
Having installed pyboard.py
as above, you send over prefs file using:
pyboard.py -d <FEATHER_DEVICE_PATH> -f cp prefs.json :prefs.json
However, the install.sh
script does this for you, and allows you to enter your WiFi credentials
To get <FEATHER_DEVICE_PATH>
, you can add my Z Shell function dlist()
to your .zshrc
file. After restarting your terminal, you can run:
./install.sh $(dlist)
You can view FeatherClock’s source code at GitHub.
install.sh
.esptool.py
installation instructions.dlist()
link.pyboard.py
.prefs.json
over if it is present in the working directory.prefs.json
).