DS3231 RTC Module: Difference between revisions

From Embedded Workshop
Jump to navigation Jump to search
m (JMerkle moved page DS3231 RTC to DS3231 RTC Module)
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
The DS3231 RTC is a low cost, battery backup, Real Time Clock, that connects to an I2C bus, providing accurate time information.
The DS3231 RTC is a low cost, battery backup, Real Time Clock, that connects to an I2C bus, providing accurate time information.
[[File:DS3231.jpg|right|thumb]]
[[File:DS3231.jpg|right|thumb]]
[[File:DS3231 Module Schematic.jpg|right|thumb]]
  Many DS3231 modules, like this one, https://www.ebay.com/itm/314250880191, have two I2C devices on-board,
  Many DS3231 modules, like this one, https://www.ebay.com/itm/314250880191, have two I2C devices on-board,
  a DS3231 RTC and a AT24C32 EEPROM, allowing the storage of information into non-volatile memory.
  a DS3231 RTC and a AT24C32 EEPROM, allowing the storage of information into non-volatile memory.
Line 19: Line 20:
   defeating the charging circuit.  This method allows the circuit to be restored easily in the future.
   defeating the charging circuit.  This method allows the circuit to be restored easily in the future.


==DS3231M==
==DS3231, DS3231SN, DS3231M==
  A variant of the DS3231SX chip is the DS3231M
  A variant of the DS3231/DS3231SN chip is the DS3231M
  This device uses an internal MEMS oscillator vs a crystal
  The "M" variant using a MEMS oscillator which is less accurate (around 5ppm)
  This device only produces a 1Hz output frequency on the INT/SQW pin.  Although the frequency output
compared to the standard "SN" version that uses a crystal oscillator,
can be enabled/disabled, the frequency is fixed at 1Hz.
  providing higher precision (around 2ppm). The "M" is more resistant to shock and vibration.
The "M" variant only produces a 1Hz output frequency on the INT/SQW pin.
  Although the frequency output can be enabled/disabled, the frequency is fixed at 1Hz.


==Notes / Other Links==
==Notes / Other Links==
  https://thecavepearlproject.org/2014/05/21/using-a-cheap-3-ds3231-rtc-at24c32-eeprom-from-ebay/
  https://thecavepearlproject.org/2014/05/21/using-a-cheap-3-ds3231-rtc-at24c32-eeprom-from-ebay/
https://forum.arduino.cc/t/ds3231-and-sqw-unable-to-change-output-frequency-beyond-1hz/479262/10
'''Example DS3231 and AT24C32 source code:'''
https://github.com/JimMerkle/Arduino_Uno_Command_Line_I2C_DS3231_TM1637

Latest revision as of 15:33, 27 January 2025

The DS3231 RTC is a low cost, battery backup, Real Time Clock, that connects to an I2C bus, providing accurate time information.

Many DS3231 modules, like this one, https://www.ebay.com/itm/314250880191, have two I2C devices on-board,
a DS3231 RTC and a AT24C32 EEPROM, allowing the storage of information into non-volatile memory.

Documents

DS3231: https://www.analog.com/media/en/technical-documentation/data-sheets/ds3231.pdf
The time (and temperature), are accessed via 19 byte-wide registers, see Address Map on page 11.

AT24C32: https://ww1.microchip.com/downloads/en/devicedoc/doc0336.pdf
This 32Kbit EEPROM (4096 x 8), will hold 4096 bytes of data.

Charging Circuit

These modules typically have a battery charging circuit to recharge a LIR2032, lithium coin cell.
This can cause a problem if using CR2032, a cheaper non-rechargable coin cell.
This page describes the problem:
  https://forum.arduino.cc/t/ds3231-cr2032-vs-lir2032-warning-is-your-module-killing-the-battery/557346
  My preferred fix is to desolder the diode (or resistor), and lift one end from the board, thus
  defeating the charging circuit.  This method allows the circuit to be restored easily in the future.

DS3231, DS3231SN, DS3231M

A variant of the DS3231/DS3231SN chip is the DS3231M
The "M" variant using a MEMS oscillator which is less accurate (around 5ppm)
compared to the standard "SN" version that uses a crystal oscillator,
providing higher precision (around 2ppm). The "M" is more resistant to shock and vibration.

The "M" variant only produces a 1Hz output frequency on the INT/SQW pin.
Although the frequency output can be enabled/disabled, the frequency is fixed at 1Hz.

Notes / Other Links

https://thecavepearlproject.org/2014/05/21/using-a-cheap-3-ds3231-rtc-at24c32-eeprom-from-ebay/
https://forum.arduino.cc/t/ds3231-and-sqw-unable-to-change-output-frequency-beyond-1hz/479262/10
Example DS3231 and AT24C32 source code:
https://github.com/JimMerkle/Arduino_Uno_Command_Line_I2C_DS3231_TM1637