I want to program an Arduino with a GSM module that is connected to an outlet and a backup battery.
When the main power goes off I want the Arduino to feed with the backup battery and send a SMS to my number.
So far the SMS part is more or less clear but I have a doubt with the backup battery, the more I investigate it, more confused I am (far from being an expert on electronics....)
I can’t find it , but didn’t a similar query come up yesterday about detecting mains loss and batteries ?
Anyhow …
Easiest way to detect mains failure is to use a relay powered off the mains and use it’s contacts to detect supply loss .
Lipos are difficult to use for backup as it’s difficult to charge them whilst supplying a load ( google pass thro charger ).
Easiest is a small lead acid battery , which are cheap and very safe , connected to a constant voltage supply ( at the batteries float voltage -) and connected in turn to the Arduino, either direct or via a buck convertor to give the voltage you want.
Const voltage keeps the battery charged , no glitches on power failure as no switch over .
There are many other ways , probably worth getting some battery knowledge and how to charge them .
If you wanted to you could also monitor the battery voltage !
In parallel - I’ve only shown wot connects to wot , not the individual wires .
I think you need to look at some basic elastictrickery stuff , so you understand what you are doing and why .
Get someone to do the mains part and get that bit enclosed so you are safe if you are unsure