Yet Another Clock
![20180730_220143.jpg](/proxy/?url=https://content.instructables.com/FGT/BEES/JK8K4FBL/FGTBEESJK8K4FBL.jpg&filename=20180730_220143.jpg)
As can be seen from my previous uploads I obtained some 7 Segment Display boards from some old weighing equipment.
My previous effort used an Arduino with a Real Time Clock module.
This Instructable uses a ESP8266 D1 Mini connected to an NTP server !
The code is based on an example from the ESP8266WiFi library.
I am not going to go into detail regarding the 7 Segment display wiring as there are dozens of examples on the net. The 2 boards I have, use the MAX7219 decoder driver chip, these only require 3 pins to control up to 8 x 7 Segment Displays.
I also wanted to show the date, so another 3 pins were needed !
I needed another 7 ouputs to display the Day! To get around the lack of output pins, I chose a Neo Pixel display, 1 pin, 7 outputs !
The Hardware
![20180618_113400.jpg](/proxy/?url=https://content.instructables.com/FLO/CBLM/JK8K4E9I/FLOCBLMJK8K4E9I.jpg&filename=20180618_113400.jpg)
![20180730_213900.jpg](/proxy/?url=https://content.instructables.com/FGM/C10L/JK8K4ERT/FGMC10LJK8K4ERT.jpg&filename=20180730_213900.jpg)
![20180623_111425.jpg](/proxy/?url=https://content.instructables.com/FR9/JFH9/JK8K4EQA/FR9JFH9JK8K4EQA.jpg&filename=20180623_111425.jpg)
![20180619_125535.jpg](/proxy/?url=https://content.instructables.com/FB6/PSF1/JK8K4EBN/FB6PSF1JK8K4EBN.jpg&filename=20180619_125535.jpg)
![20180619_125555.jpg](/proxy/?url=https://content.instructables.com/FLU/MJF4/JK8K4EDX/FLUMJF4JK8K4EDX.jpg&filename=20180619_125555.jpg)
Parts required
12 x 7 segment displays (in my case I was very lucky to have a couple of old weighing machine boards which saved an awful lot of wiring.
1 x ESP8266 D1 Mini OR any ESP8266 with 7 or more digital outputs
2 x MAX7129 (Again, I was fortunate to have the weighing machine display boards)
1 x Straight 8 NeoPixel display
2 x level shifters
1 x 5v power supply
The DAY Display
![20180619_133157.jpg](/proxy/?url=https://content.instructables.com/F70/HX9U/JK8K4EJG/F70HX9UJK8K4EJG.jpg&filename=20180619_133157.jpg)
![20180619_135137.jpg](/proxy/?url=https://content.instructables.com/F6B/EA43/JK8K4ELM/F6BEA43JK8K4ELM.jpg&filename=20180619_135137.jpg)
For this I used part of an old credit card for the base, some thick card (in my case 300gsm photo paper) and some double sided mounting tape.
Its just 2 strips of the tape with slots cut with a craft knife.The spacing being the distance between the LEDs on the NeoPixel board.
Thin strips of the card are used to create a channel for each day.
The day names are printed on clear tape with a Dymo label maker.
​Connecting Up & the Software
The ESP8266 product range is excellent maily due to
a) They are dirt cheap
b) They need very few external components
I needed 5v for the displays and 3v for the ESP so I used a couple of level shifters with a 5v power supply.
The MAX7219 only needs 3 pins to control up to 8 displays, these are pins 1 (Din),12 (Load / CS) & 13 (Clock).
These are connected via a level shifter.
The code is as follows :
// inputs: DIN pin, CLK pin, LOAD pin. number of chips
LedControl mydisplay = LedControl(3,2, 1, 1)
LedControl datedisp = LedControl(7,6, 5, 1);
The number of chips is set at 1 because I am treateting the 2 displays as separate items rather than using the DOUT and cascading them.
The NeoPixel is connected to digital output 4
#define PIN 4
#define NUMPIXELS 7 (ignoring 1 of the 8 LEDs)
There are a few #includes all of which can be found on GitHub.
Router SSID & PASSWORD need to be entered and an NTP Server selected,(I Googled free NTP Servers).
Downloads
On Power Up
![20180730 091353](/proxy/?url=https://content.instructables.com/F1G/9WQJ/JK8K4K2E/F1G9WQJJK8K4K2E.jpg&filename=20180730 091353)
On power up, the NeoPixel LEDs are rippled through, then, the 7 segment displays show alternate 'c' & '8' until a connection is made to the router.
If all segments show a contant c8 it means that a NTP server connection was not established, a reset should solve this.
Once a connection is established, the Time & Date are displayed, the Day is indicated by a blue LED.