Sunday, November 30, 2014

Receive SMS when there's a GAS leakage using SIM900A GSM module and Arduino






If you want to receive information about gas leakage when you are at home or office, this project is for you. the above fritzing explains how to interface (connect) GSM module (SIM900A) to arduino, the program is really simple , when the sensor receives a gas emission , it sends input to the arduino and arduino push the code for sending message to SIM900A, which then send you stored message to the number given to the program.




Components Required

GSM shield
Arduino
Gas detection sensor module

_________________________________________________________________________________

Arduino Program:

int PIN = 7;// attach gas sensor to pin 7
int sensor = 0;

void setup()
{
pinMode (PIN,INPUT);
Serial.begin(9600); // gsm baud rate
delay(5000);
}
void loop()
{
sensor = digitalRead (PIN); // read whether gas is presented or not
if (sensor == HIGH){   // if gas is presented send a message
Serial.println("AT");
delay(1000);
Serial.println("AT+CMGF=1"); // send SMS in text mode
delay(1000);
Serial.println("AT+CMGS=\"+919962\""); //CHANGE TO Number , you'd like to receive message
delay(1000);
Serial.print("Gas Leakage at HOME (attention required)"); // content of the message
Serial.write(26); // ctrl+z ASCII code
delay(300000); // Wait for 5 minutes before next reading
}
}

_________________________________________________________________________________



5 comments :

Post a Comment