Arduino
Using the RV-8803 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller, installing the Adafruit_RV8803 library, and running the provided example code.
Wiring
Wire as shown for a 5V board like an Uno. If you are using a 3V board, like an Adafruit Feather, wire the board's 3V pin to the sensor VIN.
Here is an Adafruit Metro wired up to the RTC using the STEMMA QT connector:
- Board 5V to breakout VIN (red wire)
- Board GND to breakout GND (black wire)
- Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
Here is an Adafruit Metro wired up using a solderless breadboard:
- Board 5V to breakout VIN (red wire)
- Board GND to breakout GND (black wire)
- Board SCL to breakout SCL (yellow wire)
- Board SDA to breakout SDA (blue wire)
Library Installation
You can install the Adafruit_RV8803 library for Arduino using the Library Manager in the Arduino IDE.
Click the Manage Libraries ... menu item, search for Adafruit RV8803, and select the Adafruit RV8803 library:
If asked about dependencies, click "Install all".
If the "Dependencies" window does not come up, then you already have the dependencies installed.
/*!
* @file simpletest.ino
*
* Simple example for the Adafruit RV8803 RTC library.
* Reads and prints the time every second.
*
* Written by Limor 'ladyada' Fried with assistance from Claude Code
*/
#include <Adafruit_RV8803.h>
Adafruit_RV8803 rtc;
void setup() {
Serial.begin(115200);
while (!Serial)
delay(10); // Wait for serial on native USB boards
Serial.println(F("Adafruit RV8803 Simple Test"));
if (!rtc.begin()) {
Serial.println(F("Couldn't find RV8803"));
while (1)
delay(10);
}
Serial.println(F("RV8803 found!"));
// Report retained status before setting the time clears the power flags.
uint8_t flags = rtc.readFlagRegister();
if (flags == RV8803_READ_ERROR) {
Serial.println(F("Could not read temperature-compensation status"));
} else if (flags & RV8803_FLAG_TEMP_COMP_STOPPED) {
Serial.println(F("Low voltage interrupted temperature compensation; clock accuracy may have been affected"));
} else {
Serial.println(F("No low-voltage interruption of temperature compensation recorded since flags were cleared"));
}
// Check if RTC lost power and needs time set
if (rtc.lostPower()) {
Serial.println(F("RTC lost power, setting time to compile time"));
// Set to compile time
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
}
// Clear any power flags
rtc.clearPowerFlags();
}
void loop() {
DateTime now = rtc.now();
// Print date
Serial.print(now.year(), DEC);
Serial.print(F("/"));
if (now.month() < 10)
Serial.print(F("0"));
Serial.print(now.month(), DEC);
Serial.print(F("/"));
if (now.day() < 10)
Serial.print(F("0"));
Serial.print(now.day(), DEC);
Serial.print(F(" "));
// Print time
if (now.hour() < 10)
Serial.print(F("0"));
Serial.print(now.hour(), DEC);
Serial.print(F(":"));
if (now.minute() < 10)
Serial.print(F("0"));
Serial.print(now.minute(), DEC);
Serial.print(F(":"));
if (now.second() < 10)
Serial.print(F("0"));
Serial.print(now.second(), DEC);
// Print hundredths
Serial.print(F("."));
uint8_t hundredths = rtc.getHundredths();
if (hundredths < 10)
Serial.print(F("0"));
Serial.print(hundredths, DEC);
// Print day of week
const char* days[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
Serial.print(F(" ("));
Serial.print(days[now.dayOfTheWeek()]);
Serial.println(F(")"));
delay(1000);
}
Upload the sketch to your board and open up the Serial Monitor (Tools -> Serial Monitor) at 115200 baud. You'll see the RV-8803 recognized over I2C. Then, it will list if any flags were cleared. In the loop, the timestamp is printed every second.
Page last edited October 30, 2026