Virtuabotixrtc.h Arduino Library -
The VirtuabotixRTC library provides a straightforward interface for time-keeping projects. Its primary advantage lies in the easy-to-use setDS1302Time function, which simplifies the often complex process of initializing a Real Time Clock module. It is ideal for data loggers, alarm clocks, and timer-based automation systems.
Wiring issue or poor connection on CLK, DAT, or RST lines. Fix: Check all jumper wires. Use shorter wires. Add 10k pull-up resistors on DAT and CLK if the wires are long.
The backup battery is dead or missing. Fix: Replace the CR2032 battery. The DS1302 draws microamps; a good battery lasts 2-5 years. virtuabotixrtc.h arduino library
This is a very common issue when working with cheap DS1302 modules. Users have reported that their clock runs five times faster than normal. This is almost always due to a faulty or low-quality 32.768kHz quartz crystal on the RTC module. The best solution is to or upgrade to a DS3231 module.
: RAM addresses 0–30 are valid. Address 31 is the trickle charger register, which the library does not natively expose but can be accessed via writeRegister(0x90 | 0x01, value) . The trickle charger is essential for supercapacitor-backed RTCs. Wiring issue or poor connection on CLK, DAT, or RST lines
If you want, I can:
Because VirtuabotixRTC.h bit-bangs the protocol, its timing is critical. The DS1302 expects SCLK periods as fast as 2.5 MHz, but bit-banging on an Arduino Uno (16 MHz) typically yields a few hundred kHz. This is sufficient for occasional reads/writes but too slow for high-frequency polling. Add 10k pull-up resistors on DAT and CLK
If you want, I can: