I have a project where several copies of the same objects should keep in sync over time (let's say keeping a drift of a few minutes over months and if possible, years).
Requirements :
The objects would power every 12 hours, perform a 1-3sec operation (write on an e-ink display) and then sleep. This has to happen at the same moment in time for all objects. I don't mind time drift (like 11h58 and not 12h) but it has to be the same for all objects.
They are solar-powered (with lipo battery as backup) so it has to be power efficient (especially since it's sleeping basically 99.99% of the time)
They are not connected to internet or any other network
They will be at room temp (15-35°C) but in different rooms (and maybe in different cities!)
I've started researching my options, but I'm new to this so maybe I'm missing something obvious.
What I've thought about:
Using the ROSC counter of the RP2040. The precision doesn't seem to fit my requirements, though
Using the XOSC counter. The precision is not given although it's supposedly better than the ROSC, but I'm not sure I can put the RP2040 into sleep mode using XOSC.
Using the PLLs. No idea if it can be useful for my use case, I just discovered this concept
Using an external RTC. But I'd like to avoid putting yet another module
Using a GPS module. GPS is just clock ticks, right? I figured I could use this signal to keep sync of the objects. But the power draw is huge and that's yet another module to buy and fit.
If they were Pico-W they could be in sync with a central control (timekeeper). Its time will slip, certainly, but the others will stay in step with it.
Can you put a parameter on "the same moment in time"? Is one second apart close enough? Two seconds? How will anyone viewing one display know whether it's changing at the same time as another instance?
The DS3231SN RTC can be calibrated to keep time to within a few seconds per year. But you would have to calibrate each one's aging register using the PPS output of a GPS module, and set the exact time, ahead of time. And then there would need to be some mechanism to re-sync them every year or so.
That particular RTC has an open-drain active-low alarm pin which could be used to switch the power every 12 hours, so there would be no battery current used at all during idle time - other than the RTC's coin cell, which should last for years.
When a GPS has time sync, then the edge of the 1PPS pulse it produces will be within a few tens of nS, regardless of location.
To get the real UTC time however, you need to wait until the GPS has received the leap seconds update, sent every 12.5 minutes. Its only at this point the GPS will be putting out real UTC. Until that time a lot of GPSs publish a time that will be 2 seconds out.
A UBLOX GPS can be put into a low current standby mode, around 15uA, with software so does not need to be running all the time.
Thanks all for your ideas. Sorry @runaway_pancake for not having been precise enough in my initial post (what's chrzempiec? I couldn't find anything relevant here or on google).
It's in my first post, a few minutes per month or per year is what I'm aiming for. The less the better, obviously.
Looks like I'll have to make peace with the idea of having this kind precision without adding anything to my RP2040 board. Is that correct?
Given that, the GPS module seems to be the most promising option. I did not realize that it was able to operate at such low currents. But I'm getting a bit lost in the different ublox gps modules available. Any module will work from a functional perspective, but there are many different prices (from $0.5 on AliExpress to 100€+ on other websites).
Do you guys know specific products I could use? (fwiw I'm in France)
When its 'running' the current can be 25mA to 60mA, depending on model.
But for time sync etc, you probably only need to turn it on once a day to check time sync.
A good working GPS, good view of the sky etc, will achieve time sync within 30 seconds or so. Thus, assuming you know the default leap seconds setting of the GPS, you can lock to the GPS time fairly quickly, then power the GPS off.
I'm not sure we're talking about the same thing. In your first post you said:
I took that to mean that all of them could drift together from "real" time, but they still had to be synced to each other. If you're now saying that they can drift apart from each other by a few seconds a month, then a calibrated RTC should be able to provide that easily, even a few seconds a year, with no power cost.
For completeness, we should say that another option is the OTA low frequency time standard broadcasts such as WWVB at 60KHz in the US. I believe France has one - ALS162 - at 162KHz. The receiver module would have an AM receiver and microcontroller which I suspect would draw much less power than a GPS module, but would require a much larger antenna. And there might be locations where reception is not good enough.
I don't have any experience with the RP2040's built-in RTC, but I suspect something like the DS3231SN would be much more accurate, and provide much greater power saving.
Indeed, I wasn't very clear (despite my best efforts!). I really don't care about drift for UTC time and I don't mind some drift between the objects in the order of a few seconds per month or year.
I'll try tinkering with the onboard counters/RTC first and maybe buy the DS3231SN if that's not precise enough.
As for the OTA low freq broadcasts, that's a good idea, although as you mention I think the antenna size will be an issue. I'll check.
There are specs at the bottom of the listing. The antenna ferrite bar is 5 cm long. I don't see a module for ALS162, which appears to be a kind of FM instead of AM like DCF77 and WWVB.
The advantages of the DS3231SN are that it has built-in temperature compensation, and that it has an "aging" register which can be used to calibrate each RTC. I use a GPS module that generates a 1Hz signal to compare to the RTC's 1Hz output, and adjust the aging register to the nearest correct value. Once that value is determined, you don't need the GPS anymore. So it's just a calibration tool. If you have an Arduino Nano or the like, I can provide the software that does the calibration. I use this GPS module. It has "PPS" output.
Dcf77 would be a good choice in Europe but operation in buildings can be problematic, also in close proximity to processors (like an Arduino!). The modules operate at low current (used in radio controlled clocks). Arduino libraries are available to decode the output. The antennas are tiny.
You could always try "calibrating" them. e.g., run a bunch of RP2040 devices for a day and use one as a reference to compare how much the others drifted. Then add a calibration factor to time delays to compensate. It's not perfect, but it should help keep them on track.