ESP32 PCF8563 Real-Time Clock (RTC)

PCF8563 Real-Time Clock (RTC) image

PCF8563

Protocol: I2C

Overview

The PCF8563 is a low-power real-time clock/calendar with I2C interface, offering timekeeping functions, programmable clock output, alarm and timer features, and operating over a wide voltage range, making it ideal for portable and battery-powered applications.

About PCF8563 Real-Time Clock (RTC)

The PCF8563 is a CMOS-based real-time clock (RTC) and calendar designed for ultra-low power applications. It provides complete timekeeping functions, including year, month, day, weekday, hours, minutes, and seconds, along with a century flag. Unlike the DS1307, the PCF8563 operates over a wider voltage range (1.0V – 5.5V) and offers lower power consumption, making it ideal for battery-powered applications.

Key Features

  • Low Power Consumption – Optimized for battery-operated devices.
  • Wide Voltage Range – Operates from 1.0V to 5.5V, broader than DS1307.
  • Programmable Clock Output – Provides flexible timing and clock generation.
  • Alarm & Timer Functions – Supports event triggering and scheduling.
  • Integrated Oscillator Capacitor – Reduces external component requirements.

With its power efficiency and advanced features, the PCF8563 is a great choice for portable, low-power, and precision timekeeping applications. 🚀

Where to Buy

PCF8563 Real-Time Clock (RTC)

Starting from

2.00$ per unit

Amazon com
Amazon.com Ships worldwide
View Price
Amazon de
Amazon.de Ships to EU
View Price
Aliexpress
AliExpress Best value
View Price

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specifications

Timekeeping Range Seconds to Years (with Century Flag)
Operating Voltage 1.0V to 5.5V
Backup Current 0.25 µA typical at 3.0V
Interface I2C (up to 400 kHz)
Clock Output Frequencies 32.768 kHz, 1.024 kHz, 32 Hz, 1 Hz
Alarm Function Yes
Timer Function Yes
Operating Temperature -40°C to +85°C

Pinout Configuration

The VCC pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND pin is the ground connection and must be connected to the ground of your ESP32.

The PCF8563 pinout is as follows:

  • OSCI: Oscillator input; connect to a 32.768 kHz crystal.
  • OSCO: Oscillator output; connect to a 32.768 kHz crystal.
  • INT: Interrupt output; open-drain, active low.
  • SCL: Serial Clock Line for I2C communication.
  • VSS: Ground connection.
  • SDA: Serial Data Line for I2C communication.
  • CLKOUT: Clock output; programmable frequency.
  • VDD: Power supply input (1.0V to 5.5V).

Wiring with ESP32

To interface the PCF8563 with a microcontroller like Arduino or ESP32, connect VDD to a 3.3V or 5V power supply, VSS to ground, SDA to the microcontroller's I2C data pin, and SCL to the I2C clock pin. Attach a 32.768 kHz crystal between OSCI and OSCO. The INT pin can be connected to a digital input on the microcontroller if interrupt functionality is required. Optionally, the CLKOUT pin can be used to provide a programmable clock signal to other components.

Troubleshooting Guide

Common Issues

⏰ RTC Not Advancing Time Correctly

⚠️ Incorrect or Corrupted Date and Time Display

🔥 RTC Module Overheating

🔄 Time Resets After Power Loss

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🔧

ESP-IDF Example

C++
🏠

ESPHome Example

YAML
🛠️

PlatformIO Example

C++
🐍

MicroPython Example

Python

Conclusion

The ESP32 PCF8563 Real-Time Clock (RTC) is a powerful RTC sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.