Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use ZS-042 RTC Modulea: Examples, Pinouts, and Specs

Image of ZS-042 RTC Modulea
Cirkit Designer LogoDesign with ZS-042 RTC Modulea in Cirkit Designer

Introduction

The ZS-042 RTC Module is a Real-Time Clock (RTC) module that provides precise timekeeping when embedded in electronic projects. It is based on the DS3231 integrated circuit, which is known for its high accuracy and stability due to its temperature-compensated crystal oscillator. This module is commonly used in applications such as data loggers, alarms, time-stamping events, and digital clocks.

Explore Projects Built with ZS-042 RTC Modulea

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
NodeMCU ESP8266 Based Smart Relay with LCD Interface and RTC Support
Image of IoT based bell system: A project utilizing ZS-042 RTC Modulea in a practical application
This circuit features a NodeMCU V3 ESP8266 microcontroller connected to a KY-019 Relay module for controlling power to a device, a DS3231 Real Time Clock (RTC) for timekeeping, and an LCM1602 IIC module interfaced with an LCD Display for user interface. The circuit is powered by a Mini AC-DC converter module that steps down AC mains to 5V, and the NodeMCU facilitates communication between the RTC, the relay, and the display, likely for scheduling and displaying the status of the connected device.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO and Sim800l Battery-Powered Real-Time Clock with GSM Communication
Image of circuit1: A project utilizing ZS-042 RTC Modulea in a practical application
This circuit integrates an Arduino UNO with a DS3231 RTC module for real-time clock functionality and a Sim800l GSM module for communication. The Arduino is powered by a Li-ion battery and interfaces with the RTC via I2C, while the GSM module is connected for serial communication and powered through a resistor network.
Cirkit Designer LogoOpen Project in Cirkit Designer
Dual RTC DS3231 Synchronization with Glyph C3 Microcontroller
Image of DS: A project utilizing ZS-042 RTC Modulea in a practical application
This circuit integrates two RTC DS3231 real-time clock modules with a Glyph C3 microcontroller. The RTC modules are connected to the microcontroller via I2C communication protocol, using the SCL and SDA lines for clock and data respectively. Both RTC modules and the microcontroller share a common power supply (3V3) and ground (GND), indicating that they operate at the same voltage level.
Cirkit Designer LogoOpen Project in Cirkit Designer
Cellular-Enabled IoT Device with Real-Time Clock and Power Management
Image of LRCM PHASE 2 BASIC: A project utilizing ZS-042 RTC Modulea in a practical application
This circuit features a LilyGo-SIM7000G module for cellular communication and GPS functionality, interfaced with an RTC DS3231 for real-time clock capabilities. It includes voltage sensing through two voltage sensor modules, and uses an 8-channel opto-coupler for isolating different parts of the circuit. Power management is handled by a buck converter connected to a DC power source and batteries, with a fuse for protection and a rocker switch for on/off control. Additionally, there's an LED for indication purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ZS-042 RTC Modulea

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of IoT based bell system: A project utilizing ZS-042 RTC Modulea in a practical application
NodeMCU ESP8266 Based Smart Relay with LCD Interface and RTC Support
This circuit features a NodeMCU V3 ESP8266 microcontroller connected to a KY-019 Relay module for controlling power to a device, a DS3231 Real Time Clock (RTC) for timekeeping, and an LCM1602 IIC module interfaced with an LCD Display for user interface. The circuit is powered by a Mini AC-DC converter module that steps down AC mains to 5V, and the NodeMCU facilitates communication between the RTC, the relay, and the display, likely for scheduling and displaying the status of the connected device.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of circuit1: A project utilizing ZS-042 RTC Modulea in a practical application
Arduino UNO and Sim800l Battery-Powered Real-Time Clock with GSM Communication
This circuit integrates an Arduino UNO with a DS3231 RTC module for real-time clock functionality and a Sim800l GSM module for communication. The Arduino is powered by a Li-ion battery and interfaces with the RTC via I2C, while the GSM module is connected for serial communication and powered through a resistor network.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of DS: A project utilizing ZS-042 RTC Modulea in a practical application
Dual RTC DS3231 Synchronization with Glyph C3 Microcontroller
This circuit integrates two RTC DS3231 real-time clock modules with a Glyph C3 microcontroller. The RTC modules are connected to the microcontroller via I2C communication protocol, using the SCL and SDA lines for clock and data respectively. Both RTC modules and the microcontroller share a common power supply (3V3) and ground (GND), indicating that they operate at the same voltage level.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of LRCM PHASE 2 BASIC: A project utilizing ZS-042 RTC Modulea in a practical application
Cellular-Enabled IoT Device with Real-Time Clock and Power Management
This circuit features a LilyGo-SIM7000G module for cellular communication and GPS functionality, interfaced with an RTC DS3231 for real-time clock capabilities. It includes voltage sensing through two voltage sensor modules, and uses an 8-channel opto-coupler for isolating different parts of the circuit. Power management is handled by a buck converter connected to a DC power source and batteries, with a fuse for protection and a rocker switch for on/off control. Additionally, there's an LED for indication purposes.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Data logging with time stamps
  • Alarm clocks and wake-up devices
  • Timekeeping for embedded systems
  • Synchronization of events in electronic systems

Technical Specifications

Key Technical Details

  • Timekeeping Accuracy: ±2ppm from 0°C to +40°C
  • Battery Backup: CR2032 coin cell battery
  • Communication: I2C interface
  • Operating Voltage: 3.3V to 5.5V
  • Operating Temperature: -40°C to +85°C

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 VCC Power supply (3.3V to 5.5V)
2 GND Ground
3 SDA Serial Data Line for I2C communication
4 SCL Serial Clock Line for I2C communication
5 SQW Square Wave/Interrupt Output
6 32K 32KHz Output

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Module: Connect the VCC pin to a 3.3V or 5V power supply and the GND pin to the ground of your system.
  2. I2C Communication: Connect the SDA and SCL pins to the corresponding SDA and SCL pins on your microcontroller (e.g., Arduino UNO).
  3. Battery Backup: Insert a CR2032 coin cell battery into the battery holder to enable timekeeping even when the main power is off.

Important Considerations and Best Practices

  • Ensure that the power supply voltage does not exceed the recommended operating voltage.
  • Use pull-up resistors on the SDA and SCL lines if they are not already present on the microcontroller board.
  • To avoid data corruption, do not remove the battery or power down the module while writing to the registers.

Example Code for Arduino UNO

#include <Wire.h>
#include "RTClib.h"

RTC_DS3231 rtc;

void setup() {
  Wire.begin();
  Serial.begin(9600);

  if (!rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);
  }

  if (rtc.lostPower()) {
    Serial.println("RTC lost power, let's set the time!");
    // The following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
  }
}

void loop() {
  DateTime now = rtc.now();

  Serial.print(now.year(), DEC);
  Serial.print('/');
  Serial.print(now.month(), DEC);
  Serial.print('/');
  Serial.print(now.day(), DEC);
  Serial.print(" ");
  Serial.print(now.hour(), DEC);
  Serial.print(':');
  Serial.print(now.minute(), DEC);
  Serial.print(':');
  Serial.print(now.second(), DEC);
  Serial.println();

  delay(1000);
}

Troubleshooting and FAQs

Common Issues Users Might Face

  • Incorrect Time: If the time is not accurate, ensure that the battery is properly installed and charged.
  • No Communication: Verify that the SDA and SCL connections are correct and that the pull-up resistors are in place.
  • Module Not Found: Check the wiring and ensure that the correct I2C address is being used in the code.

Solutions and Tips for Troubleshooting

  • Double-check the wiring against the pin configuration table.
  • Use an I2C scanner sketch to confirm that the module is detected on the I2C bus.
  • Replace the battery if the module fails to keep time after power cycles.

FAQs

Q: Can the ZS-042 RTC Module work with both 3.3V and 5V systems? A: Yes, the module can operate within a range of 3.3V to 5.5V.

Q: How long will the battery last? A: The CR2032 battery can last for years, depending on the quality of the battery and the environmental conditions.

Q: Is it necessary to use an external crystal with the ZS-042 RTC Module? A: No, the DS3231 IC has an integrated temperature-compensated crystal oscillator.