- Arduino Uno
- ESP8266 ESP-01 Wi-Fi board
- 5V DC to 3.3V DC converter
- Scroll pHAT HD
- Light dependent resistor (LDR)
Hardware
- Attach the Scroll pHAT HD to the Arduino.
- Wire the ESP8266 board using the DC-DC converter to provide power from the Uno's 5V pin.
- Wire the LDR to analog pin A0.
Software
- In Arduino IDE, install these libraries:
- Adafruit IS31FL3731 Library
- ezTime
- WifiESP
- Create an
arduino_secrets.h
file alongside the .ino file. In this file, define your Wi-Fi network name and password as follows:#define SECRET_SSID "<ssid>" #define SECRET_PASS "<password>"
- Open the .ino file in Arduino IDE and flash it to the Uno.
- Raspberry Pi
- Scroll pHAT HD
- Light dependent resistor (LDR)
- 1uF capacitor
Hardware
- Attach the Scroll pHAT HD to the Pi (see pinout)
- Wire the LDR and capacitor to GPIO pin #24 (see instructions)
Software
- Install dependencies:
pip3 install gpiozero scrollphathd
- Run the script:
python3 clock.py
- To rotate the clock 180 degrees, run
python3 clock.py flip
- To run the script on boot, run
crontab -e
and add@reboot python3 /home/pi/clock.py