Virtuabotixrtch Arduino Library |top| Jun 2026
While originally designed for the Virtuabotix RTC module, it is widely used for any compatible module due to its simplicity. Why Use an RTC Module?
Mastering Timekeeping with the VirtuabotixRTC Arduino Library virtuabotixrtch arduino library
Connecting a DS1302 RTC module to an Arduino using this library requires five physical connections: two for power and three for data communication. DS1302 Pin Arduino Pin (Example) Description 5V or 3.3V Power Supply GND Ground Reference CLK (SCLK) Digital Pin 6 Serial Clock Pin DAT (I/O) Digital Pin 7 Serial Data Input/Output Pin RST (CE) Digital Pin 8 Chip Enable / Reset Pin While originally designed for the Virtuabotix RTC module,
Because the VirtuabotixRTC library is an open-source, community-driven resource, it may not always appear in the official Arduino IDE Library Manager search results. Manual installation is straightforward: DS1302 Pin Arduino Pin (Example) Description 5V or 3
Sets the time on the DS1302 chip. Note: dayofweek (1=Sunday, 7=Saturday) is usually ignored by the DS1302 but required for compatibility.
Simplifies complex I2C/SPI communication into easy-to-use methods like updateTime() and setDS1302Time() .
// --- FOR FIRST-TIME SETUP --- // Set the date and time. Do this once, then comment/remove these lines. // Format: (seconds, minutes, hours, dayOfWeek, dayOfMonth, month, year) // dayOfWeek: 1 = Monday, 2 = Tuesday ... 7 = Sunday myRTC.setDS1302Time(00, 45, 16, 6, 22, 5, 2026); // --- ********** ---