How to display a real time clock with Arduino
In this tutorial we will learn how to display a real time clock on the OLED screen.
For this tutorial we will use OLED 128×64 I2C display, DS1302 Real Time Clock Module and Arduino UNO.
Hardware Required :
- DS1302 RTC
- OLED Display I2C
- Jumper Wires
Project circuit :
Project circuit diagram is shown below.
The DS1302 trickle-charge timekeeping chip contains a real-time clock/calendar and 31 bytes of static RAM. It communicates with a microprocessor via an easy serial interface. The real-time clock/calendar provides seconds, minutes, hours, day, date, month, and year information. the top of the month date is automatically adjusted for months with fewer than 31 days, including corrections for intercalary year. The clock operates in either the 24-hour or 12-hour format with an AM/PM indicator (The library only support the 24-hour mode).
Link to the Code :