Clocks with no Knobs
This digital clock has no setting or control knobs because the date and time are automatically set using the accurate internet time. Email parts@robotsforfun.com to get the parts for this project.
Before you attempt to do this, you need to first know how to work with the ESP8266 WiFi module.
Parts needed:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() ![]() ![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | Connect the MAX7219 to the 7-segment common cathode LED displays as follows:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MAX7219 | UDN2981A | LED digit | Power | Description |
---|---|---|---|---|
2 | Common cathode | Digit 0 (leftmost digit) | ||
11 | Common cathode | Digit 1 | ||
6 | Common cathode | Digit 2 | ||
7 | Common cathode | Digit 3 | ||
3 | Common cathode | Digit 4 | ||
14 | 11 | 11 | Segment A | |
15 | 10 | 10 | Segment F | |
16 | 7 | 7 | Segment B | |
17 | 5 | 5 | Segment G | |
20 | 4 | 4 | Segment C | |
21 | 1 | 1 | Segment E | |
22 | 3 | 3 | Segment DP | |
23 | 2 | 2 | Segment D |


/*
* 5 digit x 7 segment LED with NO colon display clock using the MAX7129
* Digits: Common cathode
* D0 is the leftmost digit
*
* Connections:
* MAX7219 ESP8266
* DIN pin 1 to pin D14
* CLK pin 12 to pin D12
* CS pin 13 to pin D13
*
* After uploading this program to the ESP8266-12 module,
* open the serial monitor and restart the ESP8266 module to
* see what IP address is assigned to this webserver,
* then browse to this IP address.
*
* or
*
* Connect your WiFi to the default ssid
* "WiFi setup ESP8266-xxxx"
* or to the one you provided, then browse to the IP address
* 1.2.3.4
* for the main page or
* 1.2.3.4/setup
* for the WiFi setup page
*
* If the WiFi is not connected then you will have to go to
* 1.2.3.4/setup to setup the ssid and password
*
* Copyright 2020 Enoch Hwang
*/
//////////////////////////////////////////////////////////////
//// VCC voltage stuff
ADC_MODE(ADC_VCC);
//////////////////////////////////////////////////////////////
//// status LED stuff
#define statusLed 2 // for ESP8266-12
//////////////////////////////////////////////////////////////
//// NTP clock stuff
#include "DateTime_RobotsForFun.h"
//////////////////////////////////////////////////////////////
//// WiFi stuff
#include "WiFi_RobotsForFun.h"
// Do delay without using the delay() function
void nonblockingDelay(int wait) {
unsigned long timesUp;
timesUp = millis() + wait;
while (millis() < timesUp) {
// flashActivityLed();
server.handleClient();
yield(); // must have this to give time to handle wifi background stuff
}
}
//////////////////////////////////////////////////////////////
//// HTML webpage
void indexHTML() {
String msg = "";
msg += "";
msg += "";
msg += ""; // keep fonts consistent between devices
msg += ""; // auto refresh page every 1 second
msg += "LED Clock ";
msg += " ";
msg += "";
msg += "";
msg += "Jumbo LED Network Clock
";
msg += "Real time clock for the
5x7 segment LED display
using the MAX7219 controller";
msg += "
" + formattedTime() + "";
msg += " ";
msg += "
";
if (!isTimeValid()) {
msg += "";
msg += "
";
}
// wifi setup and info links
msg += "IP address: ";
if (wifiIsConnected) {
msg += "" + WiFi.localIP().toString() + "";
msg += "
Wifi setup and info: ";
msg += "" + WiFi.localIP().toString() + "/setup";
} else {
msg += "1.2.3.4";
msg += "
Wifi setup and info: ";
msg += "1.2.3.4/setup";
}
msg += "";
msg += "