Power failure detection and Alert through SMS

Hello, respected members.

I want to build a system that will alert me via SMS when there is a power failure and once the power is restored. I have found a project at Arduino forums. The mentioned project satisfies most of my needs, but I want to make some adjustments to the system and have some queries. I tried contacting the author, but from the project comments, it seems that the author has not responded for nine months.

  1. How can I get an SMS alert when the power is restored? Sorry for this dumb question. It is not mentioned on the project page.
  2. Can I use a Power bank of 20000 mAh with the board? Any power source is fine, which can run the board for at most 10 hours at a stretch. In my locality, a power cut lasts for 4-5 hours and each month there are at least 5-6 cuts. ( Totaling 25-30 hours a month of power cut).
  3. How long will the board last on the mentioned power bank? I want the board to last at least 10 hours at a stretch when there is a power failure.
  4. Will the board be able to charge the power bank back when power is restored?

Please guide.

Mentioned Project link

Thank you.

With what load?

1 Like

I run an UNO, a NEO-6M and a 4 by 20 LCD on a 6000 mah powerbank. I thing it ran for some 48 hours.
Select a low power board. Using sleep mode, if possible, increases battery life.

1 Like

Yes, the Arduino will run quite happily on a power bank. How long it will run is going to depend on the load. 20,000mAH is a lot of power for an Arduino based system, so it should run for quite a while. for a comparison, my 20,000mAH battery will run my pixel 5 phone for over 12 hours, and that's with the cell data link, the screen, the GPS and a WiFi hotspot all in constant use. I've also used the same battery bank for running a Raspberry Pi 400 and a 7 inch display for 4+ hours without any problems.

The Arduino won't recharge the battery by itself. It has no charging capability. There are some battery banks that can accept a charge from a charger and supply power to a load at the same time. One of those fed from a charger plugged in to the mains would essentially provide an online UPS for the Arduino.

1 Like

Please check the mentioned link in the post for the load details. I'm new to this stuff. I cant exactly tell the amount of load.

Thank you for your reply. My objective is to provide a power source to the board, which will manage itself. I mean, I don't have to, again and again, look for and change or modify the source.

Sure. Can you please post it as a clickable link to make it easier for everyone to follow?

1 Like

Thank you for your suggestion. I have added a clickable link for the project.

Working on it.

I’ve used a SIM5320 on a more complex board, with a 7Ah SLA battery, and it runs easily for 4 days with occasional messages in and out.

1 Like

Looking at the technical data for the SIM900 module, it draws 1.5mA in standby, and 2A when transmitting. Assuming it is in standby 99% of the time, and transmitting for 1%, that's (0.012000)+(0.991.5) or about 21.5mA average current. The Arduino Nano draws about 19mA. This gives a total average current of about 40mA. The battery can supply this level of power for (20000/40) or about 500 hours. Even allowing a 50% safety margin, you've got enough power for over 10 days!

1 Like

Don't follow the schematic for that project. It will destroy the Arduino by applying 12V to the 5V pin.

1 Like

This looks promising.

What changes shall I make to the schematics or the battery?

If you are using a 5V USB battery, then no changes are required. just swap in the USB battery where the 9V battery is located.

If you are using a 12V battery, or any battery higher than 5V, do NOT connect the battery to the 5V terminal on the Arduino. Connect it to the Vin terminal instead. You would also need to add a separate regulator circuit to reduce the battery voltage down to 5V to connect to the cellular interface.

If your battery can charge and supply power to the Arduino at the same time, then things become very easy. Use a two port USB charger. One port connects to the battery to charge it, and connect the Arduino to the battery output to run the system. The 5V output from the other port on the charger can be connected to one of the Arduino pins. This pin will read high when mains power is present, and low when mains power is missing. (as usual, all the ground pins need to be connected together.)

1 Like

Wow, this sounds promising. I will right away order a Two port USB charger and I want to implement it. I have a few queries after reading your comment. I extension or circuit will need to use to attach the power bank to the board. Like in the case of 9V battery which is attached using a 9V Battery Clip.

I’m keen to help you with your project, but I’ll get a few things out of the way first.

There are a few obvious problems with the project in your link. https://create.arduino.cc/projecthub/mbraccagni/mains-failure-detector-7e8b2c?f=1&_gl=1*pdqsyi*_ga*MTcyMjI2Nzg4Mi4xNjQyMjYxOTU2*_ga_NEXN8H46L5*MTY2MDY2MjA0OS4xMzQuMC4xNjYwNjYyMDQ5LjYw

  • Most obvious is that he is applying 12V to the 5V pin of an atmega328P based Arduino Nano (running at 5V logic). The 5V pin goes straight to the atmega328P chip, which supplies it with power. The maximum voltage of this pin is about 5.5V. 12V on the 5v pin will destroy the Arduino. Instead, you can supply 12V to the VIN pin, which is the input to the 5V linear regulator; This supplies the chip with regulated 5V.
    • However, it appears after a quick google that there is a linear regulator on board the SMS shield, which supplies BOTH the SMS chip with power AND the Arduino with enough power.
  • Another potential problem is that there can be a lot of current drawn from the SMS module when transmitting (maximum of 2A). Maybe a 9V battery could handle that for a brief period, but I don't know whether it would be reliable. Can commercial 9v batteries deliver 2 amps? - Electrical Engineering Stack Exchange. However, that’s not your only source of current that you have to contend with. There are additional sources of waste heat, which are be produced through the linear regulator and the ORing diode's used to switch between the 2 power sources. You will need to ensure that both your primary and auxiliary sources of power will be able to handle the combination of that output current AND the waste heat. One way of reducing this waste heat would be to use a switching regulator, instead of a linear regulator to power both the Arduino and the SMS module.
1 Like

Does this mean I don't have to care about the pin in which the 12V is applied?

@kellygray mentioned the same as you did, but she suggested applying 12V to the Vin terminal instead.

I have planned to use a power bank as a backup power source for the project.

If you want an alert when the power fails and when it's restored, maintaining the system in-between is presumably not needed. So you need enough battery capacity to send a message when it fails, then you could switch off. Send a "power on" message when the system resets on power-up.

If you are referring to an LR61 type 9V battery then it is very unlikely it would supply 2A for very long at all, especially if operation at low temperature (~0C) is needed. Even LR6 ("AA" size) would struggle, LiPo, NiCad or NiMn type rechargeables are preferred, possibly as a power bank as I think you have concluded.

Do you need to use SMS over GSM? GSM networks won't be working for much longer. 4G supports special modes for very low power consumption and low peak current - have a look at this:

https://create.arduino.cc/projecthub/botletics/open-source-lte-cat-m-nb-iot-shield-for-arduino-8b73ab

Or maybe there is a LoRaWAN network operating where you are?

1 Like

@kellygray mentioned above that the GSM module will only be used once or twice, that too for a short period to send the SMS. Most of the time, it will be idle. After reading several comments on this post, I have understood that power must be sufficient. Neither more nor less than the required. The remaining part is how I can connect a rechargeable cell module if using a rechargeable cell or a specific module if I want to connect a power bank.

I wish could use this module, but it is not available in my country, and I need to import it which will attract a import duty thus getting out of my budget.