DS3231 RTC requires Mega to work

So, I'm building a battery-powered rocket motor thrust stand and I chose Arduino Nano to control everything. I need a precise clock to set timestamps correctly. I've connected DS3231 to Arduino Pro Mini and noticed a strange behavior – although all four connections are soldered correctly, the board doesn't go past rtc.begin(). I've tried many different libraries, so I'm sure the issue is hiding somewhere else.

You might think that the module is just faulty, that's what I thought too. Then, I've decided to connect it to Arduino Mega and it worked just fine. Since DS3231 module has SCL, SDA, VCC and GND pins on both sides, I've connected it to Mega using the available ones. These will be connected to HX711 after I'm done troubleshooting the issue. I've found out that I accidentally slightly shorted VCC and GND pins on the Pro Mini – it was heating up more than it should. I've de-soldered it and got Arduino Nano instead, thinking the problem will go away. It didn't. But, there's a very confusing configuration that allows the whole system to operate.

So, the setup is as follows:
Nano and DS3231 are connected to steady 5v battery power or USB when debugging
Nano and DS3231 are connected to each other via A4 - SDA and A5 - SCL pins
All four connections on the other side of the SD3231 are connected to Mega as follows:
GND - GND
VCC - 5V
SDA - SDA
SCL - SCL

Mega has the default blink test.
Nano has the DS3231 test.

Mega contributes literally nothing to this system, but as soon as I disconnect any of the 4 connections between it and DS3231, Nano stops printing date and time. Confusing. Here's something worth mentioning: the I2C scanner stalls on "scanning" when Mega isn't connected. Any ideas?

I suspect the Mega board has pull-up resistors on the I2C lines.

From here...

image

... and these are not present on the Nano. Try adding your own when the Nano is connected by itself.

1 Like

3v cell is dead. it drain power and will not start. two power supply sources are mighty enough to hold voltage near 5v.

they present on module

1 Like

Interesting... You see, as with any new module I've tried searching for available tutorials and all of the ones I've seen never mention pull-up resistors, some of them use the Nano board. I guess I can try connecting SCL and SDA to 5V via 10K ohm resistors.

As per @kolaha's comment... if they are present on the module itself then they won't be required... still worth a try.

My DS3231 has no 3v battery attached. I don't need it either since I only need the time to be persistent, I don't care about long term time preservation. Do I need one to make the module work with Nano?

if you not desolder D1 or U4(on showed schematic) don't install the cell.
do you have multimeter?

Yes, I do have one, I'm trying to measure VCC to SDA resistance on DS3231 right now, looks like it's about 4.5K ohm.

Edit: VCC to SCL resistance is also around 4.5K ohm

ok. what is voltage on vcc on DS3231 with Mega and without?

With Mega: 4.958V
Without Mega: 4.958-4.959V
It's the same because the whole thing is being powered by the USB connection to the Nano board.

ok. check on SDA line same way, and SCL.
did you complete disconnect the mega or only vcc?

It looks like I've managed to solve the issue by connecting both SDA and SCL to VCC via two 179.1 ohm resistors. The Nano board began to spit out date and time without being connected to Mega. The thing is, I've tried disconnecting the resistors... and it continued to work just fine. Trying to figure out what's going on, I've unplugged the power. Then, I've reconnected it to the board. Now it's silent again.

It seems like the DS3231 module requires less resistance in order to start up properly with Arduino Nano. By providing the 179.1 ohm connection, I've bypassed 4.5K ohm resistors and allowed the module to initialize. Why? No idea, I'm not that good at electronics to determine the reason. But it works now, I guess I'll have to add these resistors permanently to the circuit. I don't know the parameters of the resistors that would be the best though, the 179.1 ohm ones were picked just because they were lying around.

grat's

Thank you @kolaha and @red_car for being so helpful! Without your help I would've not figured out how to fix this issue!

1 Like

UPDATE: no resistor soldering required! After trying to short SDA to VCC directly for a brief moment, DS3231 began working correctly. I'm not sure what exactly happened here since I didn't change anything permanently. Now it just works, even after complete power loss. Maybe it has something to do with the DS3231 firmware, I could've triggered something to change the initialization sequence. No idea, it looks like DS3231 is just a mysterious module that people struggle with for no apparent reason.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.