A desktop digital clock built using an ESP32 microcontroller, MAX7219 led matrix display, and Arduino lang.
- Syncs time from an Internet time server (NTP) on boot-up
- Syncs time once a day from Internet servers to prevent drift.
- Connects to WiFi just before Internet time sync and then disconnects when done to conserve power
- Automatically adjusts UK daylight saving
- Optimise for power consumption.
- Minimise external service dependencies.
- JIT connect to WiFi for external calls. Disconnect immediately after.
- Minimise third part library dependencies.
- SPI.h
- WiFi.h
- LedMatrix.h MAX7219 library. Forked from @nhatuan84 and modified to support the max7219 hardware variation I have.
- time.h ref, source - standard C library.
Note: the following has only been tested on macOS.
- Open Arduino IDE > preferences, note the sketchbook location
cd <sketchbook location>/libraries
git clone https://github.com/janaka/esp32-led-matrix
Just the Arduino IDE Arduino IDE
Board manager URLs - one off config
http://arduino.esp8266.com/stable/package_esp8266com_index.json
https://dl.espressif.com/dl/package_esp32_index.json
Using VS Code
Arduino VS Code extension Depends on the Arduino IDE
- Rename
1.wifi_config.tmp
to1.wifi_config.ino
- NOTE: the
1.wifi_config.ino
is in.gitignore
. DO NOT check-in
- NOTE: the
- Add your wifi details.
- Serial port should show as
/dev/tty.SLAB_USBtoUART
.- this needs the SLAB driver to be install
- Upload from VS Code:
option + command + u
.
Look at the serial monitor output for information using the Arduino IDE
TODO: diagram
- CS -> GPIO 15
- CLK -> GPIO 14
- DIN -> GPIO 12
You may have a different variation of the ESP32 dev board. Check before connecting.