OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) How to avoid SD card corruption? Reply To: How to avoid SD card corruption?

#42669

JimS
Participant

Quality/speed of SD card may solve other issues but not this one. If the system is writing to the card when power goes down it may stop mid-cycle andcorrupt the card beyond what the startup checks can recover from. It doesn’t happen every time but it is a definite risk.

A battery backup will help for short outages but is only completely effective if combined with software to shut the board down before the battery runs out. In my case I had a backup battery but the outage lasted 5 hours and was longer than the battery could run the board so eventually I had a uncontrolled shutdown just the same as if I didn’t have any backup battery – possibly worse because it might do strange things as the voltage slowly dropped rather than cutting off quickly. Handling of this would be a nice feature to add to the OSPi and Beaglebone versions. Best case would be that the circuit holds off shutdown for several minutes (which would cover outages where power just briefly goes out) and then shutdown and remove power to the board to handle long outages. Many of the circuits I have seen don’t remove power from the board so it still draws a very small current after shutdown. This isn’t a real problem with running the battery down except in VERY long outages (probably weeks or even months). The real issue I see with this approach is the board doesn’t restart when power source comes back on – power has to be manually disconnected and reapplied.

If you google this issue you will get lots of hits, circuits, and opinions which may or may not be accurate…