ZS-042 DS3231 RTC module

Hi there,

I recently got my DS3231 module labeled ZS-042 off of ebay and it came with a CR2032 3V battery.

The module works at 3.3V and also 5V however after some days of usage at 5V I noticed that the battery has become quite "thick". A quick check with the multimeter confirms that the module force-charges the battery with VCC! Not quite nice. Here a pic:

So you should at least power this module only at 3.3V, even then, question to the experts: is it save to "charge" a 3V CR2032 at 3.3V continuously without it breaking after some time? 2nd question: is it ok to charge a LIR2032 at 5V?

Other than that the module works quite well with the time library :slight_smile:

Edit: corrected 3202<>2032 messup

Charging the LIR2032 at 5V is not such a good idea, it will shorten the life of the battery. Charging a CR2032 is a BAD idea. Just cut the PCB trace between the diode and the 201 resistor and use a CR2032. Check the attached image "trace_cut.png"
A CR2032 will last more than 10 years

trace_cut.png

Ah, ic, but as a LIR2032 is 3.6V, a VCC of 3.3V would be not be sufficient to charge it. So this thing is a complete fail?

I think it would be best to use a supercap instead of the CR/LIR battery, something like this:

Just received this module myself and very happy that I found this thread before wiring up the circuit.
Maybe the best solution, with a CR2032 as battery backup, is simply to desolder the diode. Then VCC is decoupled from the battery and pin 13 on DS3231.

dunio:
Hi there,

I recently got my DS3231 module labeled ZS-042 off of ebay and it came with a CR2032 3V battery.

The module works at 3.3V and also 5V however after some days of usage at 5V I noticed that the battery has become quite "thick". A quick check with the multimeter confirms that the module force-charges the battery with VCC! Not quite nice. Here a pic:

So you should at least power this module only at 3.3V, even then, question to the experts: is it save to "charge" a 3V CR2032 at 3.3V continuously without it breaking after some time? 2nd question: is it ok to charge a LIR2032 at 5V?

Other than that the module works quite well with the time library :slight_smile:

Edit: corrected 3202<>2032 messup

I don't understand, how the charging current can be 5V at 5V VCC, when there is a diode in the charging circuit. I thought it should be Vcc - 0.7V (voltage drop on the diode) = 4,3V, or not? That would be just a bit above the standard charging current (4.2V) for the Li(ion,pol) batteries. And the resistor in series should drop the charging voltage also, or not?

I received two ZS-042 modules from ebay today which look like the one shown in the picture. Since I found this thread while looking for a library for this module, I would like to clarify something:

I cannot confirm that the battery is charged at VCC. I measured 4.2V after the diode when attaching the module to a VCC of 5V. So it is OK to use the module at 5V if a LIR2032 is used.

However, it is a bad idea to use the module with a CR2032, unless you cut the PCP trace as suggested by shahidali55.

Looking at this post 6 months after it was started, I'm wondering whether anyone has decided the better thing to do is cut the wires or use an LIR2032 battery instead?

Hi

Thought this might help....

The use of a LIR2032 could well work fine if you leave the circuit as it is and use a 5V supply.

The LIR2032 can have a maximum charge voltage of 4.2V and a maximum charge current of 35mA.

Someone is saying in the discussion that they measured 4.2V between the diode and the 200ohm (201) resistor. Assuming that is correct, that takes care of the maximum charge voltage for the LIR2032.

The resistor will take care of the max charge current for the LIR2032, because....

The current that will pass through the 200 ohm resistor (resistor 201) to the battery is the voltage across the resistor divided by its resistance.

So in the worst case the maximum current that can ever pass to the battery is;-
Voltage between the diode and resistor = 4.2V
Voltage the other side of the resistor (battery completely discharged) = 0V
Voltage across resistor is therefore 4.2V - 0V = 4.2V
Resistors resistance = 200 ohms

The current through the resistor and to the battery = (4.2V - 0V) / 200 = 21mA

As the battery charges and its voltage rises the voltage across the resistor will decrease.
As the voltage across the resistor decreases so will the current to the battery. e.g.
Assume the battery has charged to 3.0V
The current through the resistor and to the battery will be = (4.2V - 3V) / 200 = 6mA

So as the battery gets closer to being fully charged the current to it will drop and effectively will provide a trickle charge for the battery....

Regards
Gypo

This sounds promising. Some german vendor on ebay suggested that one should use a zener diode to drop the voltage as the device as-is does harm the lir on the long run...

Something diffenrent: I wanted to use the ds3231 to send an interrupt every second to my arduino pro mini (5V). There are some libs that set up the ds3231 to do just that however not the most cited one (DS1307RTC Library, For Accessing Real Time Clock (RTC) Chips). Also I don't like the overhead of a library if I only want a 1Hz Interrupt.

To wire the stuff up connect SQW of the ds3231 to pin 2 or 3 of your arduino pro mini. Actually interrupt 0 is pin 2 and interrupt 1 is pin 3 - that confused me just a bit. Also you do not need a pullup resistor.

Now here a simple sketch that just requires the Wire.h library that comes with the sdk:
#include <Wire.h>

volatile bool ledstate = 0;
volatile bool interrupt = 0;

void rtc_interrupt()
{
ledstate = !ledstate;
interrupt = 1;
}

void setup() {

pinMode(13, OUTPUT);//Led
Wire.beginTransmission(0x68); //DS3231 address
Wire.write(0x0E); //The configuration register
Wire.write(0); //This will enable the interrupt at 1Hz intervals
Wire.endTransmission();

attachInterrupt(0, rtc_interrupt, FALLING); //the ds3231 pulls the line to GND when issuing an interrupt
}

void loop() {

if (interrupt) {
digitalWrite(13, ledstate);
//your code goes here...
interrupt = 0;
}
}

Gypo:
Hi

Thought this might help....

The use of a LIR2032 could well work fine if you leave the circuit as it is and use a 5V supply.

The LIR2032 can have a maximum charge voltage of 4.2V and a maximum charge current of 35mA.

Someone is saying in the discussion that they measured 4.2V between the diode and the 200ohm (201) resistor. Assuming that is correct, that takes care of the maximum charge voltage for the LIR2032.

The resistor will take care of the max charge current for the LIR2032, because....

The current that will pass through the 200 ohm resistor (resistor 201) to the battery is the voltage across the resistor divided by its resistance.

So in the worst case the maximum current that can ever pass to the battery is;-
Voltage between the diode and resistor = 4.2V
Voltage the other side of the resistor (battery completely discharged) = 0V
Voltage across resistor is therefore 4.2V - 0V = 4.2V
Resistors resistance = 200 ohms

The current through the resistor and to the battery = (4.2V - 0V) / 200 = 21mA

As the battery charges and its voltage rises the voltage across the resistor will decrease.
As the voltage across the resistor decreases so will the current to the battery. e.g.
Assume the battery has charged to 3.0V
The current through the resistor and to the battery will be = (4.2V - 3V) / 200 = 6mA

So as the battery gets closer to being fully charged the current to it will drop and effectively will provide a trickle charge for the battery....

Regards
Gypo

I just tested this and it's not true. Without a battery inserted the voltage reading at the battery terminals is 4.67V

After 20 hours of charging a LIR 2032 (3.6V) in the unmodified ZS-042 module the voltage at the battery is 4.4V and the LIR is already a bit bloated.

1 Like

My solution was to cut the trace that leads to the battery +ve terminal, strip the solder resist in order to make two solder pads, and to put in a surface mount diode (1N4148 or equivalent) so that it will block any "charge" current.

This simple mod is the same as we used to use back in the days of boards of 'non-volatile' static RAM when the NiCd batteries died and we put in 3 AA alkaline cells.

While the battery voltage is dropped somewhat, it still provides sufficient power to keep the clock running.

Hey guys,
I have a different question to the RTC Module but didn´t want to open a new thread.

So I was calling the Module over I2C address 0x68. Since I upgraded my sketch, I now need to use a different address. I always thought I could alter the address shorting the A0, A1 or A2 pins.
I shorted the A1 pin. The address should be 0x6A then right?
Unfortunately I still get an answere from the RTC via the address 0x68.

What am I doing wrong??
Thx in advance...
heni40

heni40:
Hey guys,
I have a different question to the RTC Module but didn´t want to open a new thread.

So I was calling the Module over I2C address 0x68. Since I upgraded my sketch, I now need to use a different address. I always thought I could alter the address shorting the A0, A1 or A2 pins.
I shorted the A1 pin. The address should be 0x6A then right?
Unfortunately I still get an answere from the RTC via the address 0x68.

What am I doing wrong??
Thx in advance...
heni40

As far as I know, the A0,A1 and A2 jumpers are used for changing the address of the onboard EEPROM 24C32.
The address is 1 0 1 0 A2 A1 A0 R/W
this means 0xa0 for writing, 0xa1 for reading when A0=A1=A2=0

Hope I could help you.

The Modules I received ALL come with the LIR2032 now. Maybe someone had an issue.

I wish I saw this thread earlier! I've been running this module with the included CR2032 battery at 5V ever since I got it with no issue until today. Today I heard a loud pop noise and looked up to see that the battery exploded and shot across the room. Pretty surprising considering how long it's been operating just fine.

Looks like I'll be getting an LIR2032 or cutting that trace!

Hello,

I am very happy i found this thread with the help of another member in another thread.

First, i have worked with hardware for many years now and i took an especially good look at Li-ion battery charging circuits because i had to work with them a lot in the past.

What i found out is that Li-ion batteries are more dangerous than other types and that they require a very very specific charging technique in order not to damage them or create fire.

What i found out about RTC boards like this one is that the ones with an LIR2032 battery (which is an Li-ion) have one of the poorest charging circuits for a battery of that type that i have EVER seen before. It's just a diode and resistor. This causes the battery to overcharge over time when the board is run at a voltage of about 4.5v or above. In any case, at 5v it definitely over charges as careful measurements have shown. This can cause fire or at least early failure of the back up battery, which results in no back up battery when the power goes out.

One single measurement may not be enough, there has to he several measurements done over time, several days, in order to see the rise in voltage of the battery. When the unit is first powered up at 5v, the battery may seem fine at 4v or even less, but allowed to run for several days in a row the battery voltage climbs higher and higher. My measurements had shown first 4.29 volts, then today (12/05/2015) it was up to 4.37 volts. The absolute max is specified as 4.225v for safe operation and of course battery life.

Solution? Some have been mentioned already, but i decided just to pull the series resistor which is 200 ohms and is surface mount. Using a hot air gun and directing the heat away from the main chip, the resistor was removed. it is easier and safer to remove the resistor than the diode on this board because the diode is much closer to the IC chip than the resistor, and also the connection can be made again in the future if you want to charge the battery again for some reason, for a short time period that is. I doubt you will ever need to charge the battery again however, unless you let it sit for a very long time without powering up.

You will note that the smart designs do not have a back up battery or else have the CR2032 non rechargeable battery with NO charge circuit.

BTW the Due board could run the charge circuit at 3.3v which would not over charge the battery.

Would the CR2032 battery overcharge when running at 3.3v if the board had a charge circuit?
Well the silicon diode used looks like a standard 1N4148 diode and that drops a nominal 0.65v when conducting, so the max charge voltage reaching the battery would be 3.3v minus 0.6v which equals 2.7v, so it may not hurt anything. The diodes voltage drops somewhat though for light currents, so it is possible that it might reach as high as 3v, and as the diode temperature is increased it could reach higher because that decreases the characteristic voltage more, so we could run into some charging of the non rechargeable battery. It'd doubtful this would happen, but we cant fully eliminate the possibility without careful testing. So in the end it is probably best to just desolder the resistor and remove it. After doing that there is NO way it can charge without some very abnormal board or chip failure like an accidental short (drop the board onto something metallic) or perhaps whisker growth. These would be more rare though.

Please pass this information along so other people know about this.

1 Like

Hello, I try to powered the DS3231 by backup capacitator 5.5V 0,22F and i can say that is work very good. If I compare price of capacitator and LIR2031 the capacitator is 1/3 price. It can backup time module for 24h sure (tested). Now I try if it possible to backup it for all weekend. That is enough for me.

1 Like

It's a good thing I came across this topic, got the same RTC module here and even though there's a diode, the voltage at the battery-holder is above 4.2V. I measured 4.7V. So using the LIR is out of the question.

Are there any others who started using a capacitor like

Tominakasi:
Hello, I try to powered the DS3231 by backup capacitator 5.5V 0,22F and i can say that is work very good. If I compare price of capacitator and LIR2031 the capacitator is 1/3 price. It can backup time module for 24h sure (tested). Now I try if it possible to backup it for all weekend. That is enough for me.

That would be an alternative solution, but I would like to read more than one experience :slight_smile:

I don't mean to waist anybody's time, or insult anyone, but this question needs some closure.

OK. that said, the diode and resistor circuit is not intended to make a charging circuit for the CR2032 battery.
The first question one should ask needs to be: What does a RTC do? Answer: It keeps a constant signal (clock). It's second function is to keep that clock when the normal system power is gone. This is why your PC computer has a similar or even the same CR2032 battery on the motherboard. The RTC battery's purpose is to keep the clock running when the power is lost to the system. By cutting the trace or removing the diode or resistor, you have only removed the ability to keep the time when the VCC power is gone. Now, that would only be the case if the ZS-042 circuit was built correctly. In case nobody has checked to see if any CR2032 battery voltage is getting to VCC, to power the RTC, when system power is down, I thought I would mention that it is not. In other words, the battery is not connected correctly to do anything, let alone work as a battery backup. Don't waste your time cutting traces, just take the battery out if you are concerned about it. You will have the same result. The battery does nothing in this circuit except take voltage from VCC.

If you are wondering if I will ever get to the point (solution), here it is. The diode is in backwards. That is it.

The diode's only function is to block charging of the CR2032 from power off of VCC, not provide a charging circuit. The resistor is a current limiting resistor intended to take the load off of the diode.
The battery should provide power to VCC to keep the RTC running in case of a power failure. This is a one way job from the battery to VCC. The way the board is shipped from China, makes a power path from VCC to the battery, not the other way around.
If you reverse the diode, you will have full functionality of the RTC, including battery backup. Only problem is that the power LED will drain the battery quickly. If you want to remove or cut anything, reverse the diode and then remove the LED so your battery will last longer when the system power is off. Remember, just because someone manufactured it, it does not make it correct. This board is both a bad design along with bad manufacturing. But does work if you fix it.

I know this is an old thread but found it recently and think the above reply is incorrect.

@SpoodleMix
I'm aware that you do not often visit here, so a good chance that you will not see this.

I think you're totally wrong. The DS3231 has a battery input that provides the chip with power when normal power goes off (if battery is connected). So the diode/resistor is not there to feed the DS3231; why even put a resistor in there in the first place if it was not for charging and the battery is supposed to supply power to the Vcc pin.

2 Likes