This is actually a follow up question to this question, so basically I'm using DS18B20 temperature sensor which requires Onewire.h library that interrupts millis() function.

Luckily i have a DS3231 RTC module which I'm using it with RTClib library, is there any way to use that module as a timer instead of millis() function?

1 Answer 1


You can use the SQW output of the module to indicate the passage of precisely 1 second. Every time it transitions from LOW to HIGH one second will have passed.

RTCs cannot give you times of higher resolution than 1 second, but they can give you that 1 second granularity to a high accuracy.

  • Thanks, but i don't know how to do that! can you please provide a link to an article/tutorial? Commented Jul 15, 2019 at 19:47
  • 1
    digitalRead(). When it changes from LOW to HIGH you know a second has gone by.
    – Majenko
    Commented Jul 15, 2019 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.