My wife was recently away traveling and I decided that I wanted a project to keep me busy and out of trouble in her absence. I determined that I would build her a custom clock while she was gone. I began sketching out my design and found some great parts on Adafruit for my project.
I decided on using a pair of Adafruit’s 16×8 matrices that include the I2C control backpacks. An Adafruit Feather Huzzah seemed the logical choice for microcontroller, both for its Wi-Fi connectivity but also it’s generous computing resources (particularly when compared with ATmega 328s).
I also thought it would be cool to leverage an Adafruit Feather OLED display shield as a secondary display (for date, etc.). This, too, is I2C-controlled. A DS3231 was to serve as the Real Time Clock (RTC) for its TCXO and extremely low drift. I used Adafruit’s Feather DS3231 shield.
A level shifter was necessary as some components were 3v logic (the Huzzah, RTC and Feather OLED) while others 5v, such as the matrices. Adafruit’s bidirectional-level shifter made this very easy.
Using a number of commonly-available libraries I was able to build sketch which connects to my local Wi-Fi, syncs the RTC to NTP and then displays, time, date and temperature on the screens. We re-sync with NTP periodically. The “1.0” version of the code, fully functional and polished, was just shy of 1000 lines. Were it not for the copious available libraries this would be much more!
The complete parts list:
- 1x Adafruit Feather Huzzah ESP8266-based microcontroller
- 2x Adafruit 16×8 Green LED matrices with backpacks
- 1x Adafruit Feather OLED Display Shield
- 1x Adafruit Feather DS3231 Precision RTC Shield
- 1x Adafruit Bidirectional, I2C-safe level shifter
- 1x Adafruit NeoPixel 8mm RGB LED
- 1x Adafruit Feather Wing doubler
- 6 ft Micro USB cable
- 1x Generic BMP180 I2C temperature sensor
- Adafruit Perma-proto board or other breakout
- RadioShack project box
- Wire (regular solid core & some dupont connectors)
- 1x 1000uF capacitor, 1x 330 ohm resistor
First there was some prototyping and ensuring my concept worked.
Then I cut the project box with a cheap, crappy Xacto knife. It took a while but eventually (sloppily) cut the pattern that I needed. Then I sanded and primed!
I did some testing here and figured out I should be using a capacitor on the 5v power with my NeoPixel (status LED) as well as a 300-500 ohm resistor on its data line.
Eventually I got everything secured and glued into place.
Success! It works!
I did some cleaning and put on the final touches. Hurray, it’s done!
The code is now posted on Github!