Battery charging circuit of DS3231 module

 Posted by:   Posted on:   Updated on:  2019-08-11T09:37:20Z

ZS-042 is a real time clock module with DS3231 IC. Find out if it can be powered at 3.3 V and 5 V and whether you can use CR2032 or LIR2032 backup battery.

I'm working on a project which requires an RTC clock. So I decided to get a module, since my project is based on a development board with ATmega328. The cheapest and most available module is a small PCB with "ZS-042" printed on it. Besides DS3231 realtime clock IC, it also includes an I2C EEPROM (24C32). Both share the same bus lines. The module is shipped without a battery. Product description (on AliExpress) mentions only LIR2032 battery and 5V supply for the module. They even say that it does not ship with the battery and that's not a big deal since it costs only "0.01 dollars". Really?!

The reason I chose DS3231 is because I need 3.3 V compatibility. I'll be using other peripherals which support 3.3 V only and ATmega328 will run at 8 MHz. RTC datasheet confirms DS3231 is 3.3 V (and 5 V) compatible. But the module specifications say you should use 5 V. I began wondering if there is something else that made sellers say this. In this post I will answer two questions: can ZS-042 operate at 3.3 V and what type of battery should you use (CR2032 or LIR2032).

ZS-042 DS3231 Module

ZS-042 DS3231 Module

Below are parts of the specifications of this module, as seen on a seller on AliExpress.

ZS-042 DS3231 Module Specifications

ZS-042 DS3231 Module Specifications

To clarify things, we need to take a look at the schematic. It's easy to follow some traces and draw the schematic of this module. But there is no need for that, it can be found on the internet.

ZS-042 RTC Module schematic

ZS-042 RTC Module schematic

There's nothing special about this circuit except the 2032 battery "charger", which is made of a 200 ohms resistor and 1N4148 diode. So a charging circuit does exist. This would mean you should use the rechargeable type, LIR2032. But is that a good charger for Li-Ion batteries? Not quite. First of all, it seems to be designed for 5 V supply, where at least 0.8 V would drop across 1N4148 diode and the 200 ohms resistor would limit charging current. I say 0.8 V because fully charged Li-Ion cell voltage must not exceed 4.2 V. Going higher, the battery life is severely reduced and there is the risk of catching fire. That's why Li-Ion cells are being charged using specific ICs. Charging has two steps; first is called constant current, where the charger supplies a steady current (usually selected by cell capacity) until voltage reaches a threshold. Then the charger switches to constant voltage mode, when the battery is almost charged and voltage difference between it and the charger is low enough in order not to determine a dangerous current flow.

The simple charging circuit of this module could work if voltage across the cell can go as high as 4.2 V but never exceed this value. Well, the forward voltage drop of 1N4148 varies, as with any diode, with forward current and junction temperature. Unfortunately, when battery voltage is increasing as it gradually charges, current decreases and so does diode forward voltage. For a junction temperature of nearly 25 degrees Celsius, when charging current is 0.1 mA, voltage drop across diode is as low as 0.5 V. Add to this a little higher supply voltage of 5.2 V and you have a dead LIR2032 cell, "fully charged" at 4.7 V. Even at a precise voltage of 5.0 V, the cell is still overcharged at 4.5 V.

Issues appear when using a supply voltage of 5 V. You should definitely use a LIR2032 cell and make sure your voltage supply does never get higher than 4.7 volts to allow a safe voltage for the cell in the case of 0.5 V drop across diode. If using the 3.3 V supply voltage I wouldn't worry at all. Current from power supply will start flowing through battery only when its voltage drops below 2.7 V. The RTC still works as long as battery voltage is above 2.3 V.

Battery type 3.3 V Supply 5 V Supply
CR2032 Battery not affected Disable charging circuit
LIR2032 Battery not affected
Charging does not work
Disable charging circuit, or
Make sure 5 V is actually 4.7 V

As a conclusion, when powered at 3.3 V the module behaves good, except battery charging does not work (no matter what battery type you use). When powered at 5 V, I highly suggest disabling charging circuit. It is very easy to do this. You can remove the 1N4148 diode or the 200 ohms resistor. Or you can cut the PCB track. It passes very close to the edge of the board, and it is very easy to cut it. Be careful not to cut the track from battery to DS3231 pin 14. See the photo below. The red track may be cut, but not the green one.

ZS-042 battery charging tracks and fix (diode removed)

ZS-042 battery charging tracks and fix (diode removed)

Having that charging circuit disabled, you get a nice I2C RTC module with EEPROM that's compatible with 2.7-5.5 V and any 2032 cell. If you have decided to buy one, you can find it on Banggood.

References

15 comments :

  1. Thank you for your clear and lucid explanation.
    Always enjoy reading your posts,
    Richard

    ReplyDelete
  2. Your schematic clears up so much as far as programming the -042 for a Nano. I've spent days on tracking down this info. Many thanks and a Huge thumbs UP!

    ReplyDelete
  3. I noticed that that the battery became blotted so i research and i traced the pat of the battery. I cut that line too..

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. I desolderedby a battery holder, replaced by 0.47F 5.5V Gold cap and changed 200R resistor by a 1K resistor for limiting charge current. Works like a charm

    ReplyDelete
  6. How about just running the RTC with the regular CR2032 and not connecting power to the Vin pin? I don't mind changing batteries every so often?

    ReplyDelete
  7. This Board is sold as ZS-042 DS3231 and maybe others and can have DS3231 or DS3231M chip and while pin compatible not the same.
    Both chips are UL rated for CR2032 and other primary batteries.
    datasheets.maximintegrated.com/en/ds/DS3231M.pdf

    All should disable the "charging" Diode and Resistor and not use LIR2032. This "charger" circuit can over change the battery and may cause a fire.
    Note that Many boards are made without the diode and resistor and only have empty pads.

    Can Power the chip by either VCC, Vbat or Both. VCC only then ground Vbat. Vbat only then ground VCC. But this board isn't made with a decoupling cap for Vbat for power by Vbat only. Read datasheet for the chip you have.

    DS3231M can be "damaged" if you install battery in the wrong order. See datasheet under "Initial VBAT Attachment" on page 10

    ReplyDelete
  8. I have a lot of those boards. It came with the battery actually. I have never changed it and wanted to make a air quality meter with this rtc board. It was powered on 7/24. After around a year or so, about 02 o clock (I could never forget that moment) some big bang explosion happened accompanied with a lithium alike smell on the room. I have checked everything at home and it took an hour for me to realize that the cr2032 exploded. well it was loud. lir2032 is too pricey 3 times the board with cr2032 so its not an option. I have to find another solution.

    ReplyDelete
  9. Very Useful info thx & rgds

    ReplyDelete
  10. Awesome! Thank you!

    ReplyDelete
  11. Thank you very much for your article, I had problems with the module, but I already understood the root of the problem thanks to you.

    ReplyDelete
  12. This is such a useful page, thank you. I had thought the charging would be benign and hadn't considered the overcharge possibilities of a 5V supply. Given your final comments before the table "Current from power supply will start flowing through battery only when its voltage drops below 2.7 V. The RTC still works as long as battery voltage is above 2.3 V.", this suggests that with a 3V3 supply the (LI2032) battery will be charged comfortably between 2.3V and 2.7V. Is that correct?

    ReplyDelete

Please read the comments policy before publishing your comment.