You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A feature-rich desktop clock and environmental station built on the ESP32-C3 microcontroller with a 1.8" colour TFT display. The device provides real-time clock, local weather sensing, online weather forecasts, moon phase tracking, and a fully on-device setup menu — all driven by a five-way joystick switch.
✨ Features
Screen
Description
Clock
Displays current time and date sourced from the DS3231 RTC. Time is synchronised via NTP on every boot when WiFi is available.
Environment
Live temperature, humidity, and barometric pressure readings from the BME280 sensor, refreshed periodically.
Weather
Dual-mode weather information: online forecasts via a weather API when connected, or offline local trend prediction using the Zambretti algorithm based on barometric pressure.
Moon Phase
Calculates and displays the current lunar phase, illumination percentage, and moon age using an astronomical algorithm — no internet required.
Setup
Two-level on-device configuration menu. Top level offers WiFi Setup, Set Time, and Set Date. WiFi Setup includes a network scanner for SSID selection, password entry, and city configuration. Settings are persisted in flash memory (Preferences).
Additional Capabilities
NTP Time Sync — Automatically synchronises the RTC with pool.ntp.org at startup.
Persistent Configuration — WiFi credentials and city are stored in ESP32 flash (NVS) and survive reboots.
WiFi Network Scanner — On-device discovery of nearby WiFi networks; select from the scanned list or enter manually.
Zambretti Weather Prediction — Offline barometric weather forecasting algorithm for when WiFi is unavailable.
Modular Architecture — Clean separation of concerns: Hardware, Input, Network, Screen, and Display layers.
🔧 Hardware
Components
Component
Description
ESP32-C3-DevKitC-02
Main microcontroller (RISC-V, WiFi, USB CDC)
1.8" ST7735 TFT
128×160 colour display (SPI)
BME280
Temperature, humidity & pressure sensor (I2C)
DS3231
High-precision real-time clock with battery backup (I2C)
USB-C cable (native USB CDC — no external UART chip needed)
Build & Upload
# Clone the repository
git clone https://github.com/<your-username>/MACmini_C3_Clock.git
cd MACmini_C3_Clock
# Build
pio run
# Upload
pio run --target upload
# Open Serial Monitor (115200 baud)
pio device monitor
Configuration
Edit include/config.h before building:
#defineWIFI_SSID "YourNetwork"
#defineWIFI_PASSWORD "YourPassword"
#defineNTP_SERVER "pool.ntp.org"
#defineGMT_OFFSET_SEC 0 // e.g. 3600 for CET
#defineDAYLIGHT_OFFSET_SEC 0 // e.g. 3600 for summer time
Alternatively, use the Setup screen on the device to scan for WiFi networks and enter credentials — these are stored persistently and override the compile-time defaults.