diymore ZS-042

Contents

DS3231 AT24C32 IIC RTC Module (ZS-042)

Instruction Manual

Brand: diymore | Model: ZS-042

1. Introduction

The DS3231 AT24C32 IIC RTC Module (ZS-042) is a low-cost, extremely accurate I2C real-time clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO) and crystal. It also incorporates an AT24C32 (32K) EEPROM for data storage. This module provides precise timekeeping for various applications, including data logging, time-stamping, and scheduling tasks for microcontrollers like Arduino and Raspberry Pi.

Video: A 15-second overview showcasing the DS3231 AT24C32 IIC RTC Module.

2. Safety Information

  • Always ensure correct polarity when connecting power (VCC and GND) to prevent damage to the module and connected devices.
  • Operate the module within its specified voltage range (3.3V-5.5V).
  • Avoid static discharge by handling the module on an anti-static surface or by wearing an anti-static wrist strap.
  • Do not expose the module to moisture, extreme temperatures, or corrosive environments.
  • If soldering, ensure proper ventilation and use appropriate safety gear.

3. Package Contents

  • 1 x DS3231 AT24C32 IIC RTC Module (ZS-042)

Note: The module may come with or without a CR2032 battery depending on the specific variant (HW-084B includes battery, HW-084A does not). Please check your order details.

4. Setup

4.1. Pinout Description

The module features a standard pin header for easy connection to microcontrollers. Refer to the image below for pin identification.

Top view of DS3231 RTC module showing pin labels: POWER, 32K, SQW, SCL, SDA, VCC, GND, A0, A1, A2.

Image: Top view of the ZS-042 module with pin labels.

PinDescription
POWERPower indicator LED (usually lights up when power is supplied)
32K32.768 kHz output (from DS3231)
SQWSquare Wave Output (programmable frequency from DS3231)
SCLI2C Serial Clock Line
SDAI2C Serial Data Line
VCCPower Supply (3.3V to 5.5V DC)
GNDGround
A0, A1, A2Address pins for AT24C32 EEPROM. Can be short-circuited to modify the I2C address of the EEPROM.

4.2. Wiring Instructions

Connect the module to your microcontroller (e.g., Arduino, Raspberry Pi) as follows:

  • VCC to 3.3V or 5V on your microcontroller (match the logic level of your microcontroller).
  • GND to Ground on your microcontroller.
  • SCL to the I2C Clock pin on your microcontroller (e.g., A5 on Arduino Uno, GPIO3 on Raspberry Pi).
  • SDA to the I2C Data pin on your microcontroller (e.g., A4 on Arduino Uno, GPIO2 on Raspberry Pi).

4.3. Initial Configuration

The DS3231 RTC typically uses the I2C address 0x68. The AT24C32 EEPROM has a default I2C address of 0x57. This address can be modified by short-circuiting the A0, A1, and A2 pins on the module to GND or VCC, allowing for multiple EEPROM devices on the same I2C bus.

5. Operating

5.1. Basic Functionality

  • Timekeeping: The DS3231 maintains time in seconds, minutes, hours, day, date, month, and year. It automatically adjusts for months with fewer than 31 days and for leap years.
  • Temperature Sensor: An integrated digital temperature sensor provides temperature readings with an accuracy of ±3°C.
  • Square Wave Output (SQW): The module can output a square wave at frequencies of 1Hz, 4kHz, 8kHz, or 32kHz, configurable via I2C.
  • EEPROM Storage: The AT24C32 provides 32K bits (4KB) of non-volatile memory for storing configuration data or small amounts of application data.

5.2. I2C Communication

Both the DS3231 and AT24C32 communicate via the I2C (Inter-Integrated Circuit) protocol. You will need to use an I2C library compatible with your microcontroller to interact with the module. Common operations include:

  • Setting Time: Write current time and date values to the DS3231 registers.
  • Reading Time: Read time and date values from the DS3231 registers.
  • Reading Temperature: Read the temperature registers from the DS3231.
  • Writing to EEPROM: Write data to specific memory addresses in the AT24C32.
  • Reading from EEPROM: Read data from specific memory addresses in the AT24C32.

6. Maintenance

6.1. Battery Replacement

The DS3231 module typically uses a CR2032 coin cell battery (if the HW-084B variant is used) to maintain time when external power is removed. To replace the battery:

  1. Ensure the module is powered off and disconnected from your microcontroller.
  2. Carefully remove the old CR2032 battery from its holder.
  3. Insert a new CR2032 battery with the positive (+) side facing upwards.
  4. Reconnect the module and verify timekeeping.

6.2. General Care

  • Keep the module clean and free from dust and debris.
  • Avoid physical shock or excessive force on the components.
  • Store in a dry, room-temperature environment when not in use.

7. Troubleshooting

  • Module Not Detected on I2C Bus:
    • Check all wiring connections (VCC, GND, SCL, SDA) for looseness or incorrect placement.
    • Verify the power supply voltage is within the 3.3V-5.5V range.
    • Ensure your microcontroller's I2C pins are correctly configured.
    • Run an I2C scanner sketch to confirm if the module's addresses (0x68 for DS3231, 0x57 for AT24C32) are visible.
  • Incorrect Time Readings:
    • Ensure the CR2032 battery is installed correctly and is not depleted.
    • Verify that you are setting the time correctly in your code, including the day of the week.
    • Check for any software conflicts or incorrect library usage.
  • EEPROM Read/Write Errors:
    • Confirm the correct I2C address for the AT24C32 (default 0x57).
    • Ensure you are using the correct functions for reading and writing to the EEPROM.

8. Specifications

FeatureDetail
Module ModelZS-042
Dimensions (L x W x H)38mm x 22mm x 14mm
Operating Voltage3.3V - 5.5V DC
Clock ChipDS3231 (High-precision RTC)
Clock Accuracy±2 ppm (0-40°C), approx. 1 minute/year error
Calendar FeaturesSeconds, minutes, hours, day, date, month, year; Leap year compensation until 2100; 2 calendar alarm clocks
Temperature SensorIntegrated, ±3°C accuracy
Memory ChipAT24C32 (32K bits / 4KB EEPROM)
InterfaceI2C (Inter-Integrated Circuit)
I2C Speed (Max)400kHz (at 5V operation)
DS3231 I2C Address0x68
AT24C32 I2C Address0x57 (default, modifiable via A0/A1/A2 pins)
Square Wave Output (SQW)Programmable (1Hz, 4kHz, 8kHz, 32kHz)
Battery Type (Optional)CR2032 coin cell (for HW-084B variant)

9. User Tips

  • Always double-check your wiring before applying power to prevent damage.
  • When using the AT24C32 EEPROM, ensure you account for its write cycle time in your code to prevent data corruption.
  • If you experience issues, try using an I2C scanner sketch to confirm that both the DS3231 (0x68) and AT24C32 (0x57) are detected on the bus.
  • For optimal accuracy, ensure the module is not exposed to rapid temperature fluctuations.

10. Warranty and Support

This product is covered by the standard manufacturer's warranty against defects in materials and workmanship. For technical support, troubleshooting assistance, or warranty claims, please contact your retailer or the manufacturer directly. Please have your purchase details and product model number (ZS-042) ready when contacting support.

Ask a question about this manual

Ask about setup, troubleshooting, compatibility, parts, safety, or missing instructions. Manuals+ will review the question and use this page’s manual context to help answer it.

After a successful submission, we securely hash the supplied account or form email before sending it to Microsoft Advertising for conversion attribution. Privacy details.