The DS1302 on three wires
A DS1302 on its own three-wire bus: CE, a clock and one data line both ways, write-protect and halt bits, 31 bytes of battery-backed RAM, and setting the time.
Open it in the simulatorKeep real time: millis() rollover tested in seconds, the DS1307, DS3231 and DS1302 clocks, time zones and the US and EU daylight saving rules, NTP on an ESP32-C3, alarms and schedules, and a sunrise alarm clock.
0 of 7 done
7 lessons in 4 chapters, about 6 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.
A DS1302 on its own three-wire bus: CE, a clock and one data line both ways, write-protect and halt bits, 31 bytes of battery-backed RAM, and setting the time.
Open it in the simulatorAn ESP32-C3 asks an NTP server for the time: Unix time in UTC, an offset added by the sketch, a resync interval, and the seconds of the minute running around a strip.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
millis() and the clock chips that keep the calendar.
millis() is a 32-bit count that wraps to 0 after 49.7 days: a clock that starts five seconds before the wrap, a blinker that survives it with subtraction, and one that goes haywire.
0 of 6 steps
Inside a DS1307: a 32.768 kHz crystal, seven BCD registers, the clock-halt bit and a coin cell, and why the DS3231 drifts ten times less.
0 of 6 steps
A DS1302 on its own three-wire bus: CE, a clock and one data line both ways, write-protect and halt bits, 31 bytes of battery-backed RAM, and setting the time.
0 of 6 steps
Time zones, daylight saving and the network.
Keep UTC on the RTC and show local time: a zone offset, the US and EU daylight saving rules worked out for any year, and the hour that is skipped in spring and repeated in the fall.
0 of 6 steps
An ESP32-C3 asks an NTP server for the time: Unix time in UTC, an offset added by the sketch, a resync interval, and the seconds of the minute running around a strip.
0 of 6 steps
Let the clock chip watch the time.
Two DS3231 hardware alarms, one at a set time and one every minute, flags that wait to be read, and a daily schedule table checked against the clock.
0 of 6 steps
A sunrise alarm clock that wakes you with light.
Wake up to light: a DS3231 in UTC, New York time with daylight saving on a TM1637, a 16 LED ring that rises from deep red to warm white before the alarm, weekdays only, and a snooze.
0 of 8 steps
All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 7 lessons of Clocks, RTCs and time are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 6 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: The DS1302 on three wires and NTP: time from the network.
With "millis() rollover", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.