Clock with WS2812 LEDs, controlled by a NodeMCU ESP8266 module.
DO NOT EXPOSE THE CLOCK TO THE INTERNET
The clock stores your WiFi credentials and supports remote updates
- Setting color for hour, minute, second
- Brighness control
- Use NTP for time synchronization
- Convert from UTC to local time and DST
- Manual and automatic time triggered On/Off
- OTA Update
- Optional secure HTTPS communication
- Arduino 1.8.0
- Arduino Core for ESP8266 (Version 2.4.2 - I had OTA Update problems with 2.5.0)
- Adafruit NeoPixel Library (Version 1.2.1)
- NodeMCU v2
- Buck converter 12V to 5V
- 60x WS2812 LEDs on PCB
- Photo resistor 5539
- 3D printed housing
- Acryl glass front plate
- Open the Arduino IDE
- Install the required libraries
- Check the Board Settings
- Load the Clock.ino sketch
- Modify the Password in password.h (it is used as PSK in Access Point mode and OTA Update password)
- Flash the ESP8266 using Arduino IDE
-
Connect the NodeMCU with the buck converter, WS2812 LEDs and the photo resistor:
- Open the Serial Monitor in Arduino IDE
- Power on / reset the Clock
- Connect to Network with the SSID "Clock-xxxxxx" and the password specified in the password.h file (both are shown in the Serial Monitor)
- Open the web page "http://192.168.4.1"
- On the Settings page enter the credentials (SSID and PSK) of your Wireless LAN and press "save"
- The clock will now connect to your network, fetch the current time and display it
- Check your router for the network address of the Clock and open the page in the browser to check the other settings
- At next power on the clock will remember the settings
- The LEDs can be switched on/off manually and automatically. If automatic mode is enabled and the LEDs are switched manually, the automatic mode stays enabled and will switch at the next configured time again.
- The OTA Update username is the Name specified on the Settings page and the password is the one specified in password.h file
By default the Clock does not use https for communication, it's too slow. Https can be enabled in Clock.ino (#define HTTPS ...).
The repository contains a certificate and private key, but you should use your own. To create and upload them:
- Run the script "source/make-cert.sh" to create the certificate file "cert.der" and the private key file "key.der". The script requires OpenSSL to be installed.
- Create the directory "source/Clock/data" and copy the generated files into that directory.
- Install the SPIFS tool for Arduino as described in the ESP8266 documentation.
- Use the Upload Tool to upload the files to the ESP8266.
The OpenSCAD file to 3D Print the housing is in the hardware folder. STL files are available at Thingiverse
An alternative to 3D Printing is to use a WS2812 LED ring with 60 LEDs