Virtuabotixrtch Arduino Library Jun 2026
The DS1302 uses 3 wires (plus power). Connect as follows:
// Format: seconds, minutes, hours, day of week, day of month, month, year // Note: Day of week is usually 1-7 (e.g., 1=Monday, 7=Sunday)
The library is a dedicated Arduino library designed to interface with real-time clock (RTC) modules, most notably the widely used DS1302 chip. Real-time clocks are essential in electronics for maintaining accurate time and date tracking, even when the main microcontroller loses power or is reset. virtuabotixrtch arduino library
Arduino Uno, Nano, Mega, or compatible clone. RTC Module: A DS1302 Real-Time Clock module. Jumper Wires: To connect the module to the Arduino. Breadboard: Optional, for easy prototyping.
Whether you are logging soil moisture every hour, controlling a night light based on sunset, or building the world’s most over-engineered alarm clock, the DS1307/DS3231 paired with VirtuabotixRTC is the workhorse solution you need. The DS1302 uses 3 wires (plus power)
The library makes connecting the DS1302 to your Arduino straightforward, as it uses simple digital pins and is not reliant on more complex communication protocols like I2C.
// Initialize RTC on A4 (SDA) and A5 (SCL) VirtuabotixRTC myRTC(A4, A5); Arduino Uno, Nano, Mega, or compatible clone
This was the most common use case, with creators building clocks featuring LCD displays and various alarm systems using buttons for control.