-- With member under same supervisor
FLOOD MONITORING SYSTEM USING GSM
Wednesday, 14 November 2012
UPDATED FOR FLOW CHART AND BLOCK DIAGRAM
-- New flow Chat and block diagram
flow chart
flow chart
Block Diagram
From this block diagram, we can look the operation
of flood monitoring system, in this project, we use battery as a main supply to
all component to operate. Sensor 1, sensor 2 and sensor 3 are water level
sensor to give the signal arduino atmega 328P and atmega 328P that have been
program send the data to GSM. GSM send the data to the number in the program.
SYSTEM PROTOTYPE
-- This system will install near the river or the place are high risk to flood, below the example this system will place:
Experiment Setup
overall view
circuit view
Result
message for level 1 ( First warning)
message for level 2 ( Second warning)
message for level 3 ( Last or third warning)
Sending at serial monitor
- the progress also can see at serial monitor in arduino software
SYSTEM PROGRAMMING FOR FLOOD MONITORING SYSTEM USING GSM
#include <GSM_Shield.h>
# define LED 13
# define BUTTON 7
# define BUTTON1 6
# define BUTTON2 12
//**************************************************************************
char number[]="+60194253272"; //Destination number
char text1[]="FIRST WARNING-level 1-!!!!!!!!"; //SMS to send
char text2[]="SECOND WARNING-level 2-!!!!!!!!"; //SMS to send
char text3[]="LAST WARNING-level 3-!!!!!!!!"; //SMS to send
//**************************************************************************
GSM gsm;
int error;
int sensor1 = 0;
int sensor2 = 0;
int sensor3 = 0;
int state_new = 0;
int state_old = 0;
void setup()
{
pinMode (LED, OUTPUT);
pinMode(BUTTON, INPUT);
pinMode(BUTTON1, INPUT);
pinMode(BUTTON2, INPUT);
Serial.begin(9600);
Serial.println("system startup");
Serial.println("waiting");
gsm.TurnOn(9600); //module power on
gsm.InitParam(PARAM_SET_1);//configure the module
gsm.Echo(0); //enable AT echo
}
void loop()
{
Serial.println("ready to sent sms");
status_update:
if (state_new - state_old == 0)// no update in sensor status
{
goto update_sensor;
}
else if (state_new - state_old < 0 || state_new - state_old > 0) // changes in status
{
goto texting;
}
status_update1:
if (state_new - state_old == 0)// no update in sensor status
{
goto update_sensor;
}
else if (state_new - state_old < 0 || state_new - state_old > 0) // changes in status
{
goto texting2;
}
status_update2:
if (state_new - state_old == 0)// no update in sensor status
{
goto update_sensor;
}
else if (state_new - state_old < 0 || state_new - state_old > 0) // changes in status
{
goto texting3;
}
update_sensor:
sensor1 = digitalRead (BUTTON); //sensor1
sensor2 = digitalRead (BUTTON1); //sensor2
sensor3 = digitalRead (BUTTON2); //sensor3
if (sensor1 == LOW)
{
if (sensor2 == LOW)
{
if (sensor3 == LOW)
{
text3;
state_new = 3;
goto status_update2;
}
text2;
state_new = 2;
goto status_update1;
}
text1;
state_new = 1;
goto status_update;
}
else
{
state_new = 0;
}
goto update_sensor;
texting:
digitalWrite(LED, HIGH);
Serial.print("Send SMS to ");
Serial.println(number);
error=gsm.SendSMS(number,text1);
Serial.println("SMS sent \n");
state_old = state_new;
goto update_sensor;
texting2:
digitalWrite(LED, HIGH);
Serial.print("Send SMS to ");
Serial.println(number);
error=gsm.SendSMS(number,text2);
Serial.println("SMS sent \n");
state_old = state_new;
goto update_sensor;
texting3:
digitalWrite(LED, HIGH);
Serial.print("Send SMS to ");
Serial.println(number);
error=gsm.SendSMS(number,text3);
Serial.println("SMS sent \n");
state_old = state_new;
goto update_sensor;
}
-- below the program in arduino software
}
Subscribe to:
Posts (Atom)