Skip to main content
5 votes
Accepted

Why the unsigned long is overflowing?

It's not the unsigned long that's overflowing but the calculation that you're assigning to it. 3600 is a signed integer (by default), and now.hour() is an unsigned byte. The unsigned byte gets ...
Majenko's user avatar
  • 106k
3 votes

Turning off a LED

1. pushpressed gets set, but never reset. It's set in stopPins() and stopPins2() if the input is HIGH. Since it's never reset back to zero, once it's been set, the logic in startBuzz and startBuzz2 ...
Dave Newton's user avatar
3 votes
Accepted

How to manage two alarms with one interrupt?

Consider it is good practice to leave as little code in an interrupt as possible. In this case, as the time in question is much greater then how often the loop() function is called, setting a single ...
st2000's user avatar
  • 7,470
3 votes
Accepted

DS3231 RTC module and battery problem

If i keep using the CR2032 battery for long run 24/7, how long will battery last? is there a chance of explosion? Yes. Recharging a non-rechargeable battery is dangerous. It should be avoided at all ...
Majenko's user avatar
  • 106k
2 votes
Accepted

What precision can I expect by syncronising DS3231 with PC serial?

I second the general idea of Dmitry Grigoryev’s answer: your best option is to measure a round-trip time and use half of that as an estimate of the one-way time. Otherwise you will have too many ...
Edgar Bonet's user avatar
  • 44.3k
2 votes

What precision can I expect by syncronising DS3231 with PC serial?

Transmission time will certainly not be negligible. To estimate it, you could use the roundtrip delay calculation, which is (roughly) how the NTP protocol is implemented in the first place. at PC ...
Dmitry Grigoryev's user avatar
2 votes

Maintaining time in Arduino

I see from eBay that you can get the DS1307 for around 10 cents. Is that really too much to pay? You also need a crystal and a backup battery (eg. CR2032). Without a battery the device cannot possibly ...
Nick Gammon's user avatar
  • 38.7k
2 votes
Accepted

Problem understanding how to program DS3231 RTC

DS3231 address is 104. Instead of using that large complicated header, send simple frame. For 1 sec pulse the frame will be : S 208 A 14 A 0 P N.B. Here address is 7 bit value 104. And a extra bit for ...
Sadat Rafi's user avatar
2 votes
Accepted

Arduino with interrupts enters in a locking state

When the AVR processor goes to sleep, the only way it can wake up is by an interrupt. If it goes to sleep with interrupts disabled, then it will never wake up. Interrupt routines are by default non-...
Edgar Bonet's user avatar
  • 44.3k
2 votes

How to manage two alarms with one interrupt?

The typical solution to this type of problem is: In the ISR set a flag to indicate an RTC interrupt has occurred. In the loop check the flag and if the set: a) Read the alarm flags from the RTC, b) ...
Mikael Patel's user avatar
  • 7,979
2 votes
Accepted

How to set Alarms on the DS3231 easily so the Nano doesn't have to go to sleep with delay statements?

Here it is: https://github.com/sleemanj/DS3231_Simple Example: https://github.com/sleemanj/DS3231_Simple/blob/master/examples/z2_Alarms/Alarm/Alarm.ino This is what I was looking for. My system ...
SDsolar's user avatar
  • 1,175
2 votes
Accepted

DS3231 is unable to keep record of time

So you disconnect the 5V to the DS3231, but keep the SDA and SCL pins connected? By doing that, you are working outside of the recommended operating conditions. If you leave the SDA and SCL pins ...
Gerben's user avatar
  • 11.3k
1 vote

Use DS3231 with battery and vcc at the same time

Your first stop on issues like this is the data sheet. Reading and understanding is a necessary skill for developers. Isnt the device switching between vcc when power is on and battery when it is off?...
the busybee's user avatar
  • 2,200
1 vote

DS3231 Clock project shows right date but wrong day

The library seems to be addressing device register 3. According to the DS3231 datasheet this register has valid values 1-7, with 1 being Sunday. You have: dow2str(Clock.getDoW()+1, szMesg, MAX_MESG); ...
timemage's user avatar
  • 5,414
1 vote

Set control register to low in ds3231 rtc

From the DS3231 data sheet: Control Register (0Eh) Bit 7: Enable Oscillator (EOSC). When set to logic 0, the oscillator is started. When set to logic 1, the oscillator is stopped when the DS3231 ...
DrG's user avatar
  • 409
1 vote

Real Time clock module error-DS3231

I will take a SWAG as I do not know what module you are having problems. Remove the battery, power it up and measure the voltage at the battery terminals. If you have about 3.2V the module is designed ...
Gil's user avatar
  • 1,853
1 vote

Real Time clock module error-DS3231

I am posting a code please try it may be it can help you #include "RTClib.h" RTC_DS3231 rtc; char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", &...
Maaz Sk's user avatar
  • 345
1 vote
Accepted

Parola library and DS3231 clock

Your first problem is the definition of the text array: const char *pc[NUM_ZONES] = { "TIME", // This will be replaced by real time its only for logic of rows here "ROOM", "SUBJECT", "...
Codebreaker007's user avatar
1 vote

How to count the number of rising edges on DS3231 rtc?

I'm not sure why you're getting 0 as such, but your interrupt and variable methodology leaves a lot to be desired (probably the cause of the "tutorials" you followed). My primary concern is that you ...
Majenko's user avatar
  • 106k
1 vote

How to manage two alarms with one interrupt?

After the interrupt read the time from the RTC and then do the correct thing based on the result.
ratchet freak's user avatar
1 vote

Stepper motor based clock movement with DS3231

It is unclear, why you need the high accuracy, and you didn't include your code. So my explanations will be as broad as your question. "millisecond resolution" is a broad term. Generally you have to ...
chrisl's user avatar
  • 16.5k
1 vote

'RtcDateTime' does not name a type

I was also getting the same problem, place the printDateTime function on the first page or the page where the headers and declaration's available below function #define countof(a) (sizeof(a) / ...
nukesh's user avatar
  • 11
1 vote

How to only detect the opening and closing of door sensor once

As often, the answer to this question is “Implement a ‘Finite State Machine.’”. In this instance, you need at least three distinct states: ARMED: the buzzer is not active, but it is only a matter of ...
Edgar Bonet's user avatar
  • 44.3k
1 vote

Using RTC DS3231 + Arduino UNO to calculate time lapsed

One idea would be to use force/pressure sensor on chair. You have to find what the sensor outputs when an average person sits on it and calibrate the values accordingly in code. Finally you have to a ...
Mitu Raj's user avatar
  • 424

Only top scored, non community-wiki answers of a minimum length are eligible