Skip to content

RV-8803-C7 real-time clock (Micro Crystal) – An Arduino-compatible library for I²C communication with epoch-based time read/write support.

Notifications You must be signed in to change notification settings

import-tiago/Lib-RV8803

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RV-8803-C7 Real-Time Clock Library (ESP32 + Arduino)

An Arduino-compatible library for interfacing with the Micro Crystal RV-8803-C7 I²C real-time clock (RTC), supporting easy epoch-based time read/write.

Part Image

Key Features

  • Simple read/write using Unix Epoch (time_t)
  • Compatible with ESP32 and other Arduino-compatible boards
  • Uses standard I²C communication via Wire or Wire1
  • No internal Wire.begin() — user initializes I²C externally
  • Human-readable and epoch-friendly interface

Basic Usage

RV8803 rtc;

void setup() {

    Serial.begin(19200);

    Wire.begin(48, 47); // SDA, SCL (or use Wire.begin() for default pins)

    rtc.set_epoch(1704067200); // Example: Jan 1, 2024        
}

void loop() {

    time_t now = rtc.get_epoch();
    struct tm *tm = gmtime(&now);

    Serial.printf("%04d-%02d-%02d %02d:%02d:%02d UTC (%ld)\n",
        tm->tm_year + 1900,
        tm->tm_mon + 1,
        tm->tm_mday,
        tm->tm_hour,
        tm->tm_min,
        tm->tm_sec,
        now
    );

    delay(1000);
}

This library simplifies working with the RV-8803 by abstracting I²C register handling into clean epoch-based functions.


Basic Circuit

RV8803 Basic Circuit


Serial Output

RV8803 Serial Output


Documentation & Reference


I²C Slave Address

RV8803 I2C Address

The I²C address of the RV-8803 is fixed at 0x32 and cannot be changed.


Compatibility

This library was tested with:

For best results, use this or a later version of the Arduino-ESP32 core.

About

RV-8803-C7 real-time clock (Micro Crystal) – An Arduino-compatible library for I²C communication with epoch-based time read/write support.

Topics

Resources

Stars

Watchers

Forks

Languages