It's very easy: if mains power fails, the GPRS module sends an alarm message with an SMS to my cell-phone.
Pin D2 of the Arduino is normally at HIGH level (see below: 4, 6V from the resistor divider R2/R1+R3). When mains power fails, it goes at LOW level and the GPRS module sends a message.
When the electric power returns, the GPRS module sends an "ok" message.
I used a solderable breadboard to build the circuit and headers & jumpers to connect the GPRS shield as indicated:
Connector 1 from Arduino D7 to GPRS TXD (UART)
Connector 2 from Arduino D8 to GPRS RXD (UART)
Connector 3 from Arduino D9 to GPRS D9 (board)
Arduino GND to GPRS GND (UART)
The 9V battery feeds Arduino and GPRS shield when electricity supply, normally given through the 12V jack, is off.
I tested it and works well with UNO, NANO and MINI with the same software.
Comments