Never had damage to microSD or SSD. File system can screw up, reboot fails. There are mini UPS designs to give the Pi a few seconds to shut down. They do not handle external disks and other devices you might need.
The most problems appear to be when the power blips out for a fraction of a second then on then off/on/off/on. The OS and file system end up confused. A good UPS will count a delay before restarting.
I am using a solar panel to power a Pi through a battery and am looking at a similar system where a trickle charger tops up the battery. Sort of a DIY UPS. For OMV, the UPS will keep your machine recording that fantastic European movie on SBS or Backroads without missing a frame.
Peter makes some good points about the risks of power outages and the benefits of a UPS. If you’re interested, here are a few UPS options from Core Electronics that work well with Raspberry Pi:
Thanks Peter, Yes I like the battery supply system charged either by solar or mains. I have a similar system powering a ESP32 CAM, second hand panel from the tip shop and a tired car battery.
I’ve had a few UPSs which have all ended up needing new expensive batteries, and I don’t want to fit a hat.
A UPS is highly recommended if you want to protect your RPi and prevent damage to the SD card during power outages. Even a small UPS can provide enough power to allow the Pi to shut down cleanly during a power failure, avoiding file system corruption. A UPS will also give you more time to safely back up any files and ensure that your NAS stays accessible even during short power outages.
I assume you’re using the SDcard for the OS, and different disk(s) for your NAS data. If your main concern is corrupting your SDcard, you should consider making a copy on a second SDcard.
All battery backups keep the RasPi running longer, avoiding brown-outs and short power cuts. However in a long power cut, the battery will eventually run down, and most will cut the power off - thus just postponing the problem they were supposed to fix. In a 5 hour power cut, will it matter whether your SDcard corrupted after 3 hours rather than 3 minutes ?
I now have my greenhouse running on an ESP32 with a solar panel and DFRobot Solar Power Manager - and hate that it “manages” the power by also just cutting power without warning. The answer is to :
(a) detect the battery’s voltage - can be an Analog Voltage Divider (couple of resistors if you’re happy soldering, or a board) connected to an analog pin; or a power monitor board like this which supplies a digital value
(b) provide the voltage value to the microcontroller (RasPi or ESP32)
(c) run a program on the microcontroller to take action when the battery voltage reaches a predefined low point. This is where the Witty’s supplied software shines.
It all comes down to how much risk vs how much expense you are comfortable with.
Yes, risk v expense is the question. As I am just experimenting at this stage, I will hook up a battery. I have recently replaced my old Land Cruiser starter battery which was failing but still has plenty of juice for my electronics projects and I also salvaged some solar panels from the tip shop to keep it topped up.
I will also make a copy of the SD card as you advised, thanks.
The Witty Pi 4 L3V7 module appears ideal for system reliability, not too dear either.
OK I suppose for a temporary measure but this is the wrong type of battery for anything permanent. Auto batteries are not designed for float charging and will sulphate fairly quickly. They need that few hundred Amps every so often (like in starting the engine) to keep them happy.
Cheers Bob
Probably OK as long as you keep an eye on the battery state.
I do know of one installation where a float charged car battery was installed as a DIY back up power for a security system. I am not sure if they even switch the mains power off now and again to check operation and exercise the system so when the premises gets burgled and the perpetrators turn the power off they probably will not have any video to look at.
When a car battery gets to the stage where it is no longer chargeable the modern mains power operated smart charger will indicate this and will not go ahead. At least mine does anyway. Even the older ones will just sit there with zero or very little charging current probably for ever if you don’t terminate the process.
Battery charging is not electricity storage, it is a chemical process and when this can no longer happen for whatever reason the whole operation stops and in practice that is usually the end of useful life.
Cheers Bob
PS. It is a bit academic but the only thing that can “store” electricity is a capacitor. Even if the term “store” is often used a battery is a chemical action that changes the chemical characteristics of the internal materials.