Skip to content

leoclee/7-segment-clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

7-segment-clock

Introduction

This project was created for a 3D printable 7 segment clock. You can find more information on Thingiverse https://www.thingiverse.com/thing:2947883 or Printables https://www.printables.com/model/302816-7-segment-led-clock

Installation

  1. Install the (Legacy) Arduino IDE (tested with version 1.8.19)
  2. Install the latest Arduino CLI
  3. Install the CH340 driver (tested with version 3.5)
  4. Run the following commands to install the required libraries and ESP8266 core:
    arduino-cli core install esp8266:esp8266@3.1.1 --additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json
    arduino-cli lib install ArduinoJSON@5.13.5
    arduino-cli lib install FastLED@3.5.0
    arduino-cli lib install Time@1.6.1
    arduino-cli lib install WiFiManager@0.16.0
    
  5. Install the Arduino ESP8266 filesystem uploader plugin (tested with version 0.5.0)
  6. Open clock.ino using the Arudino IDE
  7. Connect your D1 mini to the computer using a micro USB cable
  8. Under Tools, select "LOLIN(WEMOS) D1 mini (clone)" as the board
  9. Tools > Flash Size > 4M (FS:1MB OTA:~1019KB)
  10. Tools > Port > (pick the one that corresponds to your USB com port)
  11. Sketch > Upload
  12. Upload the sketch data files (the data directory in the sketch folder) using Tools > ESP8266 Sketch Data Upload.
  13. If you want to use the Serial Monitor (Tools > Serial Monitor) for troubleshooting, be sure to change the baud rate to 115200 to match the baud rate specified in the sketch code

Initial Configuration

  1. When the sketch runs for the first time, the D1 mini will try to connect to your wifi and fail (because it doesn't have any previously saved wifi credentials). This will cause it to start up an access point, which serves up a captive configuration portal (thanks to WiFiManager.
  2. You can connect to this access point to select and enter credentials for your network
  3. You can also enter your ipstack.com API key and Google Time Zone/Google Maps Javascript API key on this screen
  4. OPTIONAL If you would like to manually specify a UTC offset, edit config.json and specify a value for the JSON property "tzOffset" in seconds. You would only need to do this if you wish to avoid setting up an ipstack key or Google Maps API key or are experiencing issues with either API. For example, to set your clock to UTC−06:00, you would set "tzOffset" to -21600. You will need to upload the sketch data files again using Tools > ESP8266 Sketch Data Upload.
  5. Save (the D1 mini will restart and connect to your wifi)

Runtime Configuration

  1. While connected to the same network as the D1 mini, open a browser and go to http://<IP of D1 mini> (you can find the D1 mini's IP address using your router). web UI