ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
You can find my blog post about this project here.
It is worth to change factory firmware on your clock under the name of "Baiyangshu 1902 Wifi Clock K2 02" if the always on Wifi access point bothers you too or the missing automatic day light saving capability or if you just simply want to use an open-source software you can extend with any features whenever you need something new.
- Web user interface.
- Wifi AP turns off after configuration.
- NTP time synchronization. Server can be set via web UI.
- Backup battery backed time source if NTP fails.
- Optional blinking second LEDs.
- Optional leading zeros.
- Displaying numbers in a clever way.
- Static brightness control.
- Time zone management with automatic DST support.
- OTA of Arduino IDE. Password is the same as the name of the AP.
- Automatic brightness controll.
- Syslog capabilities.
- Drop down choice as time zone selector (instead of the current simple tex box)
- Find out why firmware update via the web UI doesn't work.
- Password protected web UI.
- MQTT client capabilities
The PCB is nice and clean, simple to program. Full schematic can be found here.
An ESP12-F microcontroller controls the display via a serial-to-paralel shift register array consists of four 74HC595D chip. Each segment made of 4 parallel LEDs. Second LEDs are also controlled from the array.
There is a DS3231SM Real Time Clock (RTC) chip managed via I2C. It has a temperature sensor with +/- 3 C precision. Original firmware offers displaying temperature but it never mentions the precision of the sensor which was originally designed to keep the clock precise within the RTC chip. No other temperature sensore on the PCB.
Display brightness can be set by PWM via the Output Enable (OE) pin of the shift registers. There is an environment light sensor too connected to the ADC pin of the ESP. It can help to set the right brightness if static one is not fit for your needs.
There is an unplaced connector with 6 pins for programming:
- FLASH
- RST
- GND
- RDX0
- TXD0
- +5V
Sixth pin is the closest one to the ESP12-F microcontroller.
After flashing your clock, at the first boot, WiFi AP turns on under the name of halclock.... . SSID is fixed but the second part depends on the MAC address of the microcontroller. There has a hardcoded magic password: password. AP also turns on if WiFi client connection fails.
- Ubuntu 22.04.4 LTS (jammy)
- Arduino IDE 2.3.2
- Wemos D1 mini as development test board
My factory firmware is available here.
It was extracted the way as shown on the below screenshot.
Feel free to open pull request against my repository.
When you do so please describe the change itself (e.g. feature you implemented) and the way how you have tested your changes.
Try to follow industry best practices :)