Although pin-powering the DS3231 (i.e. using a GPIO pin to power the DS3231) results in less current draw from the primary batteries, it ends up draining the DS3231's coin cell much more quickly. The coin cell backup is supposed to be able to keep time for ~10 years under normal circumstances, but we also make use of the DS3231's once-per-second alarm function to wake the device up to take pressure readings. This not only drains the battery faster during use, but unless it is disabled, it will continue to wastefully create these alarm pulses even when the device is unused. I've had a few coin cells die after ~1 year because of this.
The problem here is that now not only do we need to worry about checking the primary batteries before each deployment, but we also need to check (and replace) the coin cell frequently. There are two things I can think of to reduce this problem:
Always keep the DS3231 pin-powered. I'll need to compare the current draw from this approach, which I think I did at one point, but I don't remember how big the difference was. In this case, we would expect that ~10 year life span.
Have a way to disable the RTC once-per-second alarm pulses when the device isn't being used. This would at least prevent the battery from being wasted. The trouble is that the user would have to remember to do this, since there's no opportunity in the code to do anything before the device is powered down (it's a hard shutdown). Currently the best approach I can think of would be to disable the alarm whenever an error is encountered in the main program, so that if the user wanted to disable the alarm, they could simply remove the SD card, turn on the device (which would then error since it wouldn't detect an SD card) and then power down the device until they intend to use it. At least with this approach, the user wouldn't have to reprogram the device or use some other device to reprogram the DS3231 and disable its alarm.
We could make use of the button connected to D4 on the FireBeetle. Perhaps this button could be used to enter a testing mode, in which holding / pressing the button in different ways could trigger certain behaviour, including a shutdown functionality.
Although pin-powering the DS3231 (i.e. using a GPIO pin to power the DS3231) results in less current draw from the primary batteries, it ends up draining the DS3231's coin cell much more quickly. The coin cell backup is supposed to be able to keep time for ~10 years under normal circumstances, but we also make use of the DS3231's once-per-second alarm function to wake the device up to take pressure readings. This not only drains the battery faster during use, but unless it is disabled, it will continue to wastefully create these alarm pulses even when the device is unused. I've had a few coin cells die after ~1 year because of this.
The problem here is that now not only do we need to worry about checking the primary batteries before each deployment, but we also need to check (and replace) the coin cell frequently. There are two things I can think of to reduce this problem: