A simple hardware test project for the DS3231 Real-Time Clock (RTC) module using an ESP32.
The project:
- Connects the ESP32 to Wi-Fi.
- Retrieves the current time from an NTP server.
- Synchronizes the DS3231 clock.
- Reads the time from the DS3231 every second.
- Prints the current date and time to Serial Monitor.
- ESP32 / NodeMCU ESP32
- DS3231 RTC module
- CR2032 3V coin cell battery
| DS3231 | ESP32 |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | GPIO 4 |
| SCL | GPIO 5 |
Battery: The DS3231 module uses a standard CR2032 3V non-rechargeable battery as a backup power source to keep time when the main power is disconnected.
- Arduino Framework
RTClib- ESP32 Wi-Fi library
- ESP32 Wire (I2C)
Update the Wi-Fi credentials in the source code:
const char* WIFI_SSID = "YOUR_WIFI";
const char* WIFI_PASSWORD = "YOUR_PASSWORD";The current implementation uses:
Wire.begin(4, 5);So:
SDA β GPIO 4
SCL β GPIO 5
ESP32
β
βββ Connect to Wi-Fi
β
βββ Get current time from NTP
β
βββ Set DS3231 time
β
βββ Read DS3231 every second
β
βββ Serial Monitor
Example:
Connecting...
WiFi connected
RTC updated!
2026-10-01 21:37:01
2026-10-01 21:37:02
2026-10-01 21:37:03
This repository is part of the TechOnIt Hardware Test collection and is intended for validating individual hardware modules before integrating them into the TechOnIt Edge Node system.
agent-nodeβ TechOnIt Edge Node firmwareagent-controllerβ Raspberry Pi Controlleragent-sdkβ Shared SDK and communication contracts
Part of the TechOnIt open-source ecosystem.