PCF8563 real-time clock module con ESP32
Alimentazione 3.3-5 V
Bus I2C
Indirizzo I2C
0x51
Misura ora
Pin e collegamento all’ESP32
| Pin | Ruolo | Pin ESP32 | Note |
|---|---|---|---|
| VCC | Alimentazione | 3V3 | |
| GND | Massa | GND | |
| SDA | Dati I2C (SDA) | D21 | |
| SCL | Clock I2C (SCL) | D22 | |
| INT | Interrupt | D35 | Alarm / timer output, open drain, optional |
| CLKOUT | Non collegato all’ESP32 | — | Clock output (32.768 kHz), not needed |
Collegamento consigliato per l’ESP32 DevKit a 30 pin, evitando i pin della flash, di sola lettura e di strapping. BoardPilot lo controlla mentre colleghi.
Codice di partenza (Arduino)
#include <Wire.h>
void setup() {
Serial.begin(115200);
Wire.begin(21, 22); // SDA = GPIO 21, SCL = GPIO 22
Wire.beginTransmission(0x51);
bool found = Wire.endTransmission() == 0;
Serial.println(found ? "PCF8563 real-time clock module found at 0x51" : "Not found: check power, GND and SDA/SCL");
}
void loop() {}
Fonti
- NXP PCF8563 datasheet, Slave address A2h/A3h (7-bit 0x51); INT open drain; supply 1.0 to 5.5 V
- Common PCF8563 modules, Header order varies between boards: check the silkscreen
Provalo in 3D in BoardPilot
Componenti simili
ADS1015 12-bit ADCADS1115 16-bit ADCADXL375 high-g accelerometer (±200 g)AHT10 temperature + humidityAHT20 + BMP280 combo moduleAHT20 temperature + humidity
Dati dei componenti: CC BY 4.0, riutilizzabili citando BoardPilot.