An Arduino clock with automatic daylight-saving adjustment
I built a clock that shows big digits, the temperature and the humidity, and moves itself forward and back for daylight saving time. A DS3231 keeps the time, and the Arduino applies the US rules.
Results
128×64OLED pixels driving the big digits
2099year the DS3231 calendar runs through
2builds: 2023 original, 2025 SPI rebuild
The problem
Real-time clock modules keep time but do not apply daylight-saving rules, so the displayed time can be an hour off during daylight saving. My first adjustment also displayed 0:40 instead of 12:40.
What I did
- A 128×64 SSD1309 OLED showing large 12-hour digits with no AM/PM, the leading zero blanked without shifting the other digits.
- A DS3231 real-time clock for the time and date, which also handles leap years through 2099.
- A DHT22 sensor reading temperature in °F and humidity, shown centered under the time.
- Daylight-saving logic for the US rules, second Sunday in March to first Sunday in November, applied after reading the clock.
- A 2025 rebuild over SPI, after an I2C scan found nothing at 0x3C or 0x3D and the seller's I2C jumper instructions didn't match the printed board.
What I took from it
My first time adjustment displayed 0:40 instead of 12:40, so I checked the hour boundaries. During the later SPI rebuild, I checked the board markings when they disagreed with the seller's instructions.