A real-time clock module counts seconds with its own crystal oscillator and, thanks to the backup battery, does not forget the time when the main supply is cut. The board talks to the module over a two-wire bus and reads hours, minutes, day and month. A display on the same bus shows this information. The board also produces a visual pulse by briefly lighting an LED every second. The circuit teaches uninterrupted timekeeping and redundant supply; note that the battery feeds only the clock circuit.

Interactive circuit guide
Run the simulation, follow the build steps one by one and try it in our real app.
Stopped
Step-by-step build
You can open this circuit in the browser simulator, trace the connections and change values to see what happens.
Open in simulatorParts you need
Build the circuit with the components below. Each component’s role is listed in the parts list.
- Control board × 1 — Reads the time and drives the display.
- Real-time clock module × 1 — Keeps time with its crystal.
- I2C display × 1 — Shows the time and date.
- Backup battery × 1 — Feeds the clock circuit when power is lost.
- +5V power rail × 1 — Supplies voltage for the module and display.
- 220Ω resistor × 1 — Limits the LED current.
- Green LED × 1 — Lights briefly every second.
Build steps
Placement on the breadboard: the control board is on the left; the clock module and display sit side by side in the upper half (rows 4-11). The data line leaves pin 2 and the clock line pin 3; the backup battery sits next to the clock module, with the green LED and 220Ω resistor at the lower left. All ground pins are on the bottom rail.
- Place the control board and connect its GND pin to the bottom rail. Tip: Ground is the reference for the bus.
- Add the clock module and display to the upper half and connect their supply pins to the +5V rail. Tip: Both devices use the same bus.
- Connect the data and clock pins to board pins 2 and 3. Tip: Devices are selected by different addresses.
- Connect the backup battery to the clock module’s battery input. Tip: The battery’s negative end goes to common ground.
- Connect the LED with a 220Ω resistor to board pin 4. Tip: Connect the cathode to ground.
- Set the time in the simulation and watch it advance on the display. Tip: The LED lights once every second.
How it works
The real-time clock circuit counts oscillations of a 32.768 kHz crystal to produce seconds. Binary dividers reduce this frequency to one second, which is written into the hour, minute, day, month and year registers. The backup battery feeds only the clock circuit, so the registers are preserved even if the main supply fails. The board writes to the module’s address over the two-wire bus and reads the time registers; the display on the same bus is selected by its own address. The values read are converted to characters and sent to the display. The board’s own timing tracks elapsed time to produce a one-second pulse and drive the LED. In this way the time kept by hardware and the time shown by software work together. This structure shows the basis of uninterrupted timekeeping and low-power backup supply design.
Expected result
The current time and date appear on the display; the green LED blinks briefly every second.
Tips and common mistakes
- If the clock resets, check the backup battery connection.
- If the display is blank, try swapping the data and clock lines.
- Pay attention to polarity when inserting the battery.
- Do not set the time on every start; set it only during initial setup.
Try it yourself
- Show the time and date on the display.
- Watch the one-second pulse with the LED.
- Cut the supply and observe that the backup battery preserves the time.
What you learn in this circuit
- Explains the function of a real-time clock module.
- Understands the backup battery’s role in preserving time.
- Reads the clock registers and transfers them to the display.
- Uses a timestamp to generate the one-second pulse.
Finding the parts
If you want to build this project in real life, you can get the parts from hobidevre.com.
Looking for more project ideas? Browse the guides on the hobidevre.com blog.