Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

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

Image of ZS-042 RTC ModuleaDesign 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!
Image of NodeMCU ESP8266 Based Smart Relay with LCD Interface and RTC Support: 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.

Open Project in Cirkit Designer
Image of Dual RTC DS3231 Synchronization with Glyph C3 Microcontroller: 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.

Open Project in Cirkit Designer
Image of Cellular-Enabled IoT Device with Real-Time Clock and Power Management: 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.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

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

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

Solutions and Tips for Troubleshooting

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.