Nano IoT RTCZero Losing Time

Hello All,

I have been encountering a really strange issue with the internal RTC I had set up on the Arduino Nano IoT where it was losing time quite quickly (as in noticeable within an hour or so).

The RTC followed the basic premise of the RTCZero Wifi time example and seemed to work fine on its own, but the issue occurred when I put it all together with my other components/libraries.

The other libraries this is working with is as follows: SD NeoPixelBus Servo

I don't know a huge about how the internal RTC works other than it uses a crystal oscillator and runs off the Time library but my suspicion comes from the fact that Neopixels have this moment where they require precise timing and use very specific delays and turn off all interrupts. However, I could just be clutching at straws there.

Are there any obvious culprits or am I missing something? I have tried to fish around the forums but have had little luck, although I may have missed the perfect post...

I would post my code but (a) it's over 1700 lines long and (b) I will need to actively seek permission to do so.

Any help or pointers would be appreciated.

Thanks, Matt

Hi Matt,

Your RTC isn’t accurate, because unfortunately the Nano33 IoT board doesn’t use an external 32.768kHz crystal as the microcontroller’s clock source. Instead, it uses the SAMD21’s on-chip, internal 32.768k oscillator, however this has far less accuracy and precision.

Expect a board with a 20ppm (parts per million), 32.768kHz external crystal to be out by around ±1.7 seconds per day, while with the internal 32k oscillator, you can expect around up to ±20 minutes per day.

The Arduino MKR boards (unlike the Nano33 IoT) comes with an external crystal.

Hello MartinL,

Ah right, that explains it then, quite a crazy amount of time lost!. Guess I will be needing an external DS3231 after all!

Thanks for the quick response!