Challenge 100 Arduino Projects: Network Clock

Network Clock

Difficulty Index: ⭐⭐⭐⭐Suitable Age: 12+

Introduction

This is an automatically calibrated network clock. With it, you no longer need to worry about adjusting your clock. Isn’t it amazing? Challenge 100 Arduino Projects: Network Clock In fact, mobile phones and computers already have this capability. Challenge 100 Arduino Projects: Network Clock To briefly introduce, this project uses the DS3231 clock module for automatic timekeeping. It is said that the annual error is less than one second (PS: I don’t really know if that’s true Challenge 100 Arduino Projects: Network Clock I haven’t tested it for a whole year). A short press of the button connects to the internet to update and calibrate the time, while a long press puts it into configuration mode, eliminating the hassle of needing to modify the program when changing Wi-Fi passwords. Challenge 100 Arduino Projects: Network Clock Just a reminder, the latest program for the weather broadcast project from issue 14 has added a configuration feature. Interested friends can enter the link below, find the Baidu Cloud mini program code at the bottom, and download it quickly. Challenge 100 Arduino Projects: Network Clock
【Issue 14】Challenge 100 Arduino Projects: Weather Broadcast from a Pen Holder

Challenge 100 Arduino Projects: Network Clock

Materials Required

ESP8266 —– 1 piece

DS3231 Clock Module —– 1 piece

OLED Display IIC Interface —– 1 piece

10K Resistor —– 1 piece

Wires —– Several

Module Explanation

ESP8266: It’s a common topic.

DS3231 Clock Module: A professional timekeeping module that provides various time data. It also has a built-in temperature sensor, but its accuracy is questionable, with an error of ±2℃. Would you dare to use it? Challenge 100 Arduino Projects: Network Clock It has a built-in 3V battery (the yellow object on the back), and it continues to run even when powered off. Once powered back on, it simply retrieves the time.

OLED Display: Uses an IIC interface and is responsible for displaying various information (time, prompts).

Wiring Diagram

The wiring is a bit messy. In summary, both the OLED and DS3231 modules use IIC interfaces, and you just need to connect the SCL and SDA pins of the ESP8266 to the corresponding SCL and SDA pins of the OLED and DS3231. In summary, you can connect many IIC devices on the same two signal lines; how many exactly is something you can search for online.

Challenge 100 Arduino Projects: Network Clock

Click to view the full image

Production Process

Challenge 100 Arduino Projects: Network Clock

Challenge 100 Arduino Projects: Network Clock

Reference Program

There are many libraries to import, so it is recommended to download the Arduino IDE from the cloud disk to avoid compilation failures due to missing libraries.
#include <RtcDS3231.h>#include <Wire.h>#include <U8g2lib.h>#include <SimpleTimer.h>#include <OneButton.h>#include <ESP8266WiFi.h>#include <DNSServer.h>#include <ESP8266WebServer.h>#include <WiFiManager.h>   #include <TimeLib.h>#include <NtpClientLib.h>
Enter the configuration mode, open your phone’s Wi-Fi, search for and connect to NetClock, a window will pop up automatically, and follow the prompts to operate. For details, please refer to the video below.
wifiManager.resetSettings();wifiManager.autoConnect("NetClock");

Project Appreciation

Challenge 100 Arduino Projects: Network Clock

Data Download

To obtain the materials for this project, please add the WeChat QR code below.

What good ideas do you have?
Feel free to leave comments and share below!
Challenge 100 Arduino Projects: Network Clock
Challenge 100 Arduino Projects: Network Clock
Challenge 100 Arduino Projects: Network Clock

Challenge 100 Arduino Projects: Network Clock

This article is authored by
If you have technical questions, feel free to add WeChat for consultation.
Challenge 100 Arduino Projects: Network Clock
Challenge 100 Arduino Projects: Network Clock
Challenge 100 Arduino Projects: Network Clock

Recommended from Previous Issues:

【Issue 18】Challenge 100 Arduino Projects: Electronic Scale

【Issue 17】Mobile Remote Control Car

【Issue 16】Data Collection and Saving to Excel

【Issue 15】Distance Measuring Instrument

【Issue 14】Weather Broadcast from a Pen Holder

【Issue 13】Rock Paper Scissors Game Box 02

【Issue 12】Swimming Rescue Bracelet – Part 2

【Issue 11】Rock Paper Scissors Game Box 01

【Issue 10】Swimming Rescue Bracelet – Part 1

【Issue 9】Let’s Play Tug of War (2)

【Issue 8】Water Remote Control Car

【Issue 7】Let’s Play Tug of War (1)

【Issue 6】Vibration Fan

【Issue 5】Temperature and Humidity Detector

【Issue 4】Electronic Piano

【Issue 3】Radio

【Issue 2】Gesture Flow Light

【Issue 1】Ultrasonic Radar Detector

Leave a Comment

Your email address will not be published. Required fields are marked *