ARDUINO FEED

I feed my arduino project with adapter and also with battery incase of power goes out.I want a sms from gsm module when power goes out and battery starts feeding.How can ı code that? ı did a search but couldn`t find a thing.Is there a library for that?

I feed my arduino project with adapter and also with battery incase of power goes out.

You want us to guess how you have the adapter and battery connected?

If you use the mains power to charge the battery continuously (with a suitable charger) and run the Arduino off the battery it won't stop if there is a power outage.

If you want the Arduino to detect a power outage (perhaps to send a warning message or to organize an orderly shut-down) put a diode in the supply from the charger to the battery so that the battery cannot back-feed the charger and measure the voltage on the charger side of the diode.

...R

Can't say much without a schematic but the arduino analogue pins can detect voltage. You can read voltage from the adapter to detect if it has stopped supplying power. Just be aware of an issue with the voltage reference of which there are a couple of topics on this forum. Depending on your circuit you may need diodes and voltage dividers etc but my understanding is limited and the range of possibilities is large

p.s. this is not really a programming question