Re: rtc clock

Hi there.

I'm currently doing a project where I need to use an RTC to keep time of measurements I have to make.

My setup is an Arduino MEGA 2560, an Arduino Tiny RTC I2C DS1307, an SD Micro-SD Card Breakout Module, and finally an Emon TX Arduino shield. And long story short, today, out of the blue, my rtc stoped working. After searching on the foruns, I came across several posts that said that the module I use, although cheap, is basically "crap". They break very easily, they have more resistances than they need, etc, etc, etc.

Again, after searching a while, most people agree that the DS3132 is the best low price/quality RTC.

My question is: Can I use an DS3231 RTC module, say like the one I posted on the link below, and still use the DS1307 library like the one cattledog said? I ask this because I'm used to that library. and because out of all the one's I viewed, it seemed the simpler one (this is maybe because i'm kind of new to the whole programming scene, and honestly that library and those examples were just plain understandable and simple :cold_sweat: )

http://www.ebay.co.uk/itm/DS3231-AT24C32-IIC-High-Precision-RTC-Module-Clock-Timer-Memory-Module-Arduino-H-/351149610735?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item51c225d6ef

Thanks in advance for any feedback you guys can give me.

João Almeida.

There are (at least) two flavors of the DS3231 chip floating around. Most libraries expect the DS3231SN chip, but I got an RTC that looks exactly like yours (prolly made in the same Chinese factory) that has the DS3231N (no S) chip on it. The standard DS1307 libraries can be used to read the time on the DS3231N (no S) chip, but they are unable to set the time.

To set the time, I had to use the DS3231RTC library written by trunet, available on Github (RTC3231.write command). Otherwise, it works the same.

It's hard to tell in the blurry pic in your eBay ad, but it looks like it should have the DS3231SN. That doesn't mean that's what you'll actually get, through. I bought my RTC from DealExtreme which shows the DS3231SN in the pic, but what actually arrived in my mailbox was the DS3231N (no S).

Thank you so much for the quick response tylernt :slight_smile:

I was acctually doing some more research now, and I found one topic where you posted the same response, so I apologize for that. So regarding the RTC, it's a matter of luck I guess. If I receive the one with no S, I have to do what you did, meaning use one library to set the time, and another to read from the the RTC. If I receive the other it should be all good. What I can do is, if I receive the same RTC as you, I can test the library that Jack Christensen posted, since you said you didn't tested it, and then tell you something (don´t know if you tested it mean while, because the post I've read is from late 2013 XD ).

Just a final question. In that post I read someone saying they had issues because de DS3231 works at 3.3V but the SDA and SCL are pulled to 5V. Do I have to worry for having the "normal" connetcions, meaning Vcc -> 5V, GND -> GND, etc etc? (sorry if the question sounds dumb, but like I said, I'm new to the game XD )

Thanks again for the help you provided, and thanks in advance for any help you can provide again :grin:

Ah, nice find on that other thread, I'd forgotten I had posted it. :wink: Still haven't tried Jack's library, my RTC is "in service" so no opportunity to play.

I've just been running my Arduino and my RTC at 5V and it works reliably. Just hook up +5V to VCC, ground to ground, and SDA/SCL as normal, nothing special (I left SQW and 32K disconnected). I assume that if the DS3231 chip itself requires 3.3V, the module's PCB has level shifters or voltage dividers to take care of that automatically.

Again, thank you so much for the quick response tylernt.

Going to order the RTC, and gonna try Jack's library. I'll tell you if it works then XD

Best regards,

João Almeida.