One of my favorite Arduino components. I use the Sodaq library but overall very similar. Set it and forget it (at least for a while). Having that battery helps and I keep everything on Standard Time (so no need to reset to DST). You can also modify code to always output YYYY/MM/DD, HH:MM:SS ---- makes it look neater and keeps consistent spacing.
This board has a pull-up resistor connecting SQW to VCC, which is a BAD THING. That connection assumes that you will never want to use SQW when the I2C is not powered (that is VCC is open). The DS3231 chip with its backup battery is capable of signalling an alarm condition via SQW, but the "pull-up" resistor connects SQW to VCC which is connected to the power on LED (via a 1K resistor) and thence to ground. When VCC is not separately powered, whatever source is connected externally to SQW has its power drained away. That connection can be de-soldered with difficulty from the top right connector on the topmost component labelled 472 (actually a resistor array) (below the POWER label and to the right of the leftmost SDA and VCC labels). When SQW is not low, removing this trace raises the resistance between SQW and GND from 13K to 180K by my measurement. (When SQW is low because an alarm is triggered, SQW to GND is about 32 ohms). I agree with other commenters: the 24C32N is not where the clock registers are stored, but rather on the DS3231 chip itself. Also remove the resistor above the right hand SCL label for lithium battery health.
Learning electronic by watching your awesome videos. Seeing this makes me want to ask some questions. 1. Can it be set to auto adjust to summer and winter time (the ridiculous +- 1 hour)? 2. Can it be programmed to be a timed trigger? In order to make the Arduino consume less power by sleeping it or power on/off 3. Could you please mention a use case for the oscillation?
Hello, may could you tell me what following error means: 'DS3231 clock' redeclared as different kind of symbol I juse this lib: github.com/jarzebski/Arduino-DS3231
Is one required to set the DoW or will the chip figure it out? I have no use for that one bit of info in my sketches and the uRTClib.h I'm using now has the set command wrapped up like your get command with all parameters required.
learnelectronics I've found that leaving out the DoW when setting the RTC using the DS3231 library causes the chip to override my year variable with a value that is valid for the month & day setting I send it. Or I need to change the order I send the value to make it set the DoW internally. Trying to decide if I persue that or cut my losses & add DoW to my GUI.
Does anyone know how to disable the battery charging on it. The LIR2032 battery it uses is not available in my country and I am concerned what would happen if I used a regular CR2032 battery. So I need to disable the charging.
On the 4-pin header side of the board, remove the resistor located immediately above the silkscreened SCL marking. Or the diode to the left of it, or cut the trace to one of them. The Elegoo variety comes with it unpopulated and the CR2032 battery, but unless you want to get one of their kits, you have to order it from their website directly.
@@xiaomong8 Damaging the battery is the least of your worries when charging a non-rechargeable Lithium-ion battery. Yes, you may not notice any issues, but the thing about Lithium batteries is they are little bombs. They contain metallic Luthium, which spontaneously combusts when exposed to air. Also the natural internal resistance is very low, so an internal short can develop temperatures high enough to start a fire. Recall all the stories about exploding cell phones, and notice how newer cell phones do not have user replaceable batteries. That's because people were buying cheap no-name replacement batteries and then blaming the phone manufacturers when suddenly their pockets we're on fire. So when the other commenter said it's "safest" to disable the charging circuit, he's referring to fire safety, not just equipment failure.
Excellent video on the DS3231. I downloaded your _7_segment_4_digit.ino sketch but it will not compile. Line 35 of the code says "Clock.getTime(year, month, date, DoW, hour, minute, second); //get time from DS3231". I get the error message "Compilation error: 'class DS3231' has no member named 'getTime'; did you mean 'getA1Time'?" . How do I resolve this. I've installed all DS3231 Libraries via the Arduino Library Manager but trying each in turn doe's not solve the problem. Can you help?
I'm late to the Arduino party and I appreciate your videos very much. You're a good teacher. Thanks!
One of my favorite Arduino components. I use the Sodaq library but overall very similar. Set it and forget it (at least for a while). Having that battery helps and I keep everything on Standard Time (so no need to reset to DST). You can also modify code to always output YYYY/MM/DD, HH:MM:SS ---- makes it look neater and keeps consistent spacing.
Michael Padovani it sure is a great module. couple lines of code and you have a clock in any project.
Follow-up with a deep sleep project that awakens every hour by alarm2. That would be golden. I keep searching and what I find keeps falling short.
Nice tutorial. Thank you. Stay creative.
Very helpful, I should stop watching yt in bed tho, gonna try this maybe tomorrow
you forgot the alram
This board has a pull-up resistor connecting SQW to VCC, which is a BAD THING. That connection assumes that you will never want to use SQW when the I2C is not powered (that is VCC is open). The DS3231 chip with its backup battery is capable of signalling an alarm condition via SQW, but the "pull-up" resistor connects SQW to VCC which is connected to the power on LED (via a 1K resistor) and thence to ground. When VCC is not separately powered, whatever source is connected externally to SQW has its power drained away. That connection can be de-soldered with difficulty from the top right connector on the topmost component labelled 472 (actually a resistor array) (below the POWER label and to the right of the leftmost SDA and VCC labels). When SQW is not low, removing this trace raises the resistance between SQW and GND from 13K to 180K by my measurement. (When SQW is low because an alarm is triggered, SQW to GND is about 32 ohms).
I agree with other commenters: the 24C32N is not where the clock registers are stored, but rather on the DS3231 chip itself.
Also remove the resistor above the right hand SCL label for lithium battery health.
Bull that the DS3231uses the EEPROM to store RTC data!!!!! It is totally independent
Sir Would you please tell me that when i should use enableoscillator() function or when not?
You have to be careful with the ZS-042. It tries charging the battery. See the discussion here: forum.arduino.cc/index.php?topic=278270.0
How about charging the battery?
Can u tell me the difference between ds3231m 12c and DS3231 .both can work with the same code
Learning electronic by watching your awesome videos. Seeing this makes me want to ask some questions.
1. Can it be set to auto adjust to summer and winter time (the ridiculous +- 1 hour)?
2. Can it be programmed to be a timed trigger? In order to make the Arduino consume less power by sleeping it or power on/off
3. Could you please mention a use case for the oscillation?
All about the DS1307RTC
that module has an I2C 32K eeprom, too...
squalazzo yes it does. that's where it does the time and date
@@learnelectronics Yes, but 32k is a whole lotta memory to store just the time and date. Wonder if it could be used for other stuff.
Not true, it''s a separate EEPROM. The jumpers A0-2 are for adressing this chip, the clock is not adressable.
Hello,
may could you tell me what following error means:
'DS3231 clock' redeclared as different kind of symbol
I juse this lib:
github.com/jarzebski/Arduino-DS3231
namespace issue. fix : find/replace all "clock" with "cl_ck" or something different.
Is one required to set the DoW or will the chip figure it out? I have no use for that one bit of info in my sketches and the uRTClib.h I'm using now has the set command wrapped up like your get command with all parameters required.
I'm pretty sure you can leave it out.
learnelectronics I've found that leaving out the DoW when setting the RTC using the DS3231 library causes the chip to override my year variable with a value that is valid for the month & day setting I send it. Or I need to change the order I send the value to make it set the DoW internally. Trying to decide if I persue that or cut my losses & add DoW to my GUI.
learnelectronics Where is the sketch in your dropbox. What is it called?
Where is the sketch for this located in your dropbox? What is the file called
I just looked and I can't find it either...
Does anyone know how to disable the battery charging on it. The LIR2032 battery it uses is not available in my country and I am concerned what would happen if I used a regular CR2032 battery. So I need to disable the charging.
On the 4-pin header side of the board, remove the resistor located immediately above the silkscreened SCL marking. Or the diode to the left of it, or cut the trace to one of them. The Elegoo variety comes with it unpopulated and the CR2032 battery, but unless you want to get one of their kits, you have to order it from their website directly.
@@xiaomong8 Damaging the battery is the least of your worries when charging a non-rechargeable Lithium-ion battery. Yes, you may not notice any issues, but the thing about Lithium batteries is they are little bombs. They contain metallic Luthium, which spontaneously combusts when exposed to air. Also the natural internal resistance is very low, so an internal short can develop temperatures high enough to start a fire. Recall all the stories about exploding cell phones, and notice how newer cell phones do not have user replaceable batteries. That's because people were buying cheap no-name replacement batteries and then blaming the phone manufacturers when suddenly their pockets we're on fire.
So when the other commenter said it's "safest" to disable the charging circuit, he's referring to fire safety, not just equipment failure.
Desolder the diode and the resistor on the 4 pin side of the module.
Unfortunately, all of mine, drifts a lot. I know, they are fake, cause, all of them were marked using laser.
what var type does rtc.getime return? I only want the hour to trigger a relay.. How do I o that. Thanks
Excellent video on the DS3231. I downloaded your _7_segment_4_digit.ino sketch but it will not compile. Line 35 of the code says
"Clock.getTime(year, month, date, DoW, hour, minute, second); //get time from DS3231". I get the error message "Compilation error: 'class DS3231' has no member named 'getTime'; did you mean 'getA1Time'?" . How do I resolve this. I've installed all DS3231 Libraries via the Arduino Library Manager but trying each in turn doe's not solve the problem. Can you help?