Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

MicroPython • Re: How to set the right Pi Pico system time? With the use of DS3231?

$
0
0
For setting the time on the DS3231, and then subsequently reading the time from the DS3231 and setting the pico's own RTC etc. then this library will do that nicely.

https://github.com/peterhinch/micropyth ... ter/DS3231

The library also has routines to use the DS3231 to set its alarm settings and act upon the receipt of an alarm call. I use one of those cheapo Chinese GS3231 boards with a coin cell battery, plus a simple circuit with a MOSFET, to periodically turn on a battery pack that powers a pico and then the pico, having finished whatever it was doing, triggers a power down to await its next awakening. The DS3231 coin cell battery has enough juice to run the DS3231 on its own for a long time. A complete power off alarm circuit beats the current pico's deep sleep 8-)

So it maybe with all this alarm stuff the DS3231 library I mentioned is overkill for your requirements and there may be other DS3231 libraries to be found, but a glance at the library to grab the routines you are after may be all you need.

Statistics: Posted by SirFico — Fri Apr 25, 2025 2:51 pm



Viewing all articles
Browse latest Browse all 8015

Trending Articles