Introduction: Water Level Indicator With SMS

Picture of Water Level Indicator With SMS

Today I am going to talk about a very useful project . It is called the Water Level Indicator with SMS notification. Everybody has overhead tank at their homes. The problem is that there is no system to track the water in the tank. Then there come a secondary problem that is when their water pump is started they have no idea when it gets filled up and sometimes there are situation where the pump keeps on pumping water to the tank and the water starts spilling out from the tank. There is wastage of energy as well as wastage of water. So this system is very useful to detect the water level. It is also useful for tall buildings where it is not possible to check the water level.

Let's get started.

Step 1: Components

Picture of Components

1. Atmega328

2. Arduino Uno

3. Switch x1

4. Crystal Oscillator x1

5. 10uf capacitor x2

6. BC547 npn transistor x4

7. Resistor 1k x5

8. Resistor 100 x8

9. PCB x1

10. LM7805 5volt regulator

11. LM7812 12volt regulator

12. Capacitor 22uf x2

13. Solar Pannel 20v

14. Heat Sink x1

15. Wires

16. GSM modem 800H or 900A

Step 2: Connections & Making PCB

Picture of Connections & Making PCB

Make the connections of transistors with Resistors on the breadboard as shown in the ckt diagram check the output. Output will be greater than 3 volt to send the logic HIGH to the arduino.

Mount the resistors and transistors on the pcb.

Mount the 28 pin ic socket on pcb.

We are making standalone arduino.

Solder the crystal oscillator along with 22uf capacitors.

Connect outputs of the transistors to the analog pins o the IC refer to the pin diagram of the ic.

Make connection of the voltage regulator properly with capacitors.

Heat sink must be attached to the 7812 voltage regulator as the GSM modem draws more current from it.

Solar pannel connected to the input of the 7812 ic.

Solder all the components as in the ckt diagram on pcb. Check the connections.

Step 3: Programming

Picture of Programming

Connect your arduino UNO to your PC wiyh ic atmega328 in it.

Burn the following Code into your arduino.

int a=0;
int b=0;

int c=0;

int d=0;

void setup()

{ pinMode(A1,INPUT);

pinMode(A0,INPUT);

pinMode(A2,INPUT);

pinMode(A4,INPUT);

Serial.begin(9600);

}

void loop()

{ int r=digitalRead(A4);

int s=digitalRead(A0);

int t=digitalRead(A1);

int u=digitalRead(A2);

if(r==HIGH && s==LOW && t==LOW && u==LOW)

{ if(a==0)

{ Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number delay(500);

Serial.print("Level 1 Turn on the Motor "); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

a++; b=0; c=0; d=0;

}

}

if(r==HIGH && s==HIGH && t==LOW && u==LOW)

{ if(b==0)

{ Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number

delay(500);

Serial.print("Water at Level 2 ");

//the message you want to send

delay(500);

Serial.write(26);

delay(500);

b++; a=0; c=0; d=0;

} }

if(r==HIGH && s==HIGH && t==HIGH && u==LOW) { if(c==0)

{ Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number delay(500);

Serial.print("Water at Level 3 "); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

c++; b=0; d=0; a=0; } }

if(r==HIGH && s==HIGH && t==HIGH && u==HIGH)

{ if(d==0) { Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number

delay(500);

Serial.print("Tank Full Switch off Motor "); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

d++; c=0; b=0; a=0;

} }

else

{ Serial.print("Circuit Not Connected");

}

}



Now Remove the ic & install it into the pcb.

Step 4: Assembling & Test

Picture of Assembling & Test

Take a PVC pipe having height equal to your water tank.

Stick the wires from the ckt at different levels of the tank.

Note that the Vcc wire always dipped into water.

Make all the Connections.

Connect Rx of ic which is on pin 2 to the Tx of the GSM modem.

Connect Tx of ic which is on pin 3 to the Rx of the GSM modem.

Connect the solar pannel to input of 7812 ic.

Check all Connections And the Project is ready.

Make shed for the system to protect it from rain.

Test It!

When you conserve water, you conserve life!

Water = Life, Conservation = Future!

Comments

thisisshennah (author)2017-10-04

What is the purpose of the switch? Is it needed in A6 GSM?

RishabhL (author)thisisshennah2017-10-04

Its on you, you can use on not no problem. Switch is just to turn on n off circuit.

thisisshennah (author)2017-09-29

Can i use A6 GSM?

RishabhL (author)thisisshennah2017-09-30

Yes you can use A6 GSM..

thisisshennah (author)RishabhL2017-10-01

Still 20 volts?

RishabhL (author)thisisshennah2017-10-01

yes I uses 20 volt solar pannel

thisisshennah (author)RishabhL2017-10-01

Can i use 20 V battery?

thisisshennah (author)2017-10-01

The schematic is blurred sir, can I have clear photo?

RishabhL (author)thisisshennah2017-10-01

this is water level circuit .. other circuit is of standalone atmega328 and voltage regulator for 12v and 5volts from solar pannel input of 19v

OngO2 (author)2017-09-14

can I have a clear picture of the final Stripboard design, (I need it urgently)

RishabhL (author)OngO22017-10-01

transistor circuit

thisisshennah (author)2017-09-29

How much voltage does the circuit need?

RishabhL (author)thisisshennah2017-09-30

GSM need 12v 1amp and circuit board need 5v

DaveP148 (author)2017-08-14

Can i include an alarm on this device? and where can i input my alarm?? any idea..

RishabhL (author)DaveP1482017-08-14

Yes we can include alarm to it... Connect a buzzer to any of digital pin and add code according in the sketch.

DaveP148 (author)RishabhL2017-08-15

but how? any idea? or diagram on it thank you!!!!!

DaveP148 (author)RishabhL2017-08-15

example of coding in the buzzer?

DaveP148 (author)RishabhL2017-08-15

where pin? can you specify it? thank you and coding the thank your for your response!!!

DaveP148 (author)RishabhL2017-08-15

can i have a example? where i connect the buzzer? and the code? thank you for your response.

danieldennis (author)2017-07-01

please can I get the circuit diagram, I need it urgently please thank you

danieldennis (author)2017-06-30

please can I get the circuit diagram for the project.

please I need it urgently thank you

vamsibond made it! (author)2017-02-09

can you check this code for me please

RishabhL (author)vamsibond2017-02-10

Code is correct...

vamsibond (author)2017-01-05

where did u specified values for a,b,c,d

RishabhL (author)vamsibond2017-01-05
Specify the values of a,b,c,d globally above the void setup as 0;

int a=0;

int b=0;

int c=0;

int d=0;

void setup() {

vamsibond (author)RishabhL2017-01-17

what is the use of these a b c d

what is operation performed by them

RishabhL (author)vamsibond2017-01-17

a b c d are used to discontinue the loop. Our sms should be send once at every water level, loop continuous send sms so to break or to stop the loop a b c d are used.

vamsibond (author)RishabhL2017-02-09

can help me with my code whether it works or not.......

/*declare some constants*/

int r=0;

int s=0;

int t=0;

int u=0;

int v=0;

int w=0;

int x=10;

int a=0,b=0,c=0,d=0,e=0,f=0;

float h1,m1,s1,h2,m2,s2,h3,m3,s3;

unsigned long flow,over,ove,ov;

unsigned long time1,time2,time3;

unsigned long p1,p2,p3,q1,q2,q3;

//-----------------------------------------------------------

/*define the pin numbers*/

#define s11 3

#define s12 4

#define s13 5

#define s21 6

#define s22 7

#define s23 8

#define buz 9

#define buz1 10

#define led 13

//------------------------------------------------------------

/*start the setup program*/

void setup()

{

//------------------------------------------------------------

pinMode(s11, INPUT);

pinMode(s12, INPUT);

pinMode(s13, INPUT);

pinMode(s21, INPUT);

pinMode(s22, INPUT);

pinMode(s23, INPUT);

pinMode(buz, OUTPUT);

pinMode(led, OUTPUT);

//-----------------------------------------------------------

Serial.begin(9600);

Serial.println("started working");

}

//-----------------------------------------------------------

void alert()

{

digitalWrite(buz,HIGH);

digitalWrite(led,HIGH);

}

void displayresult()

{

/*start the artmetic code for sensor 1*/

time1=q1-p1;

h1 = int(time1/3600000);

over = time1%3600000;

m1 = int(over/60000);

over = over%60000;

s1 = int(over/1000);

flow = (x/time1);

//-----------------------------------------------------------

/*initializze the serial communication*/

Serial.begin(9600);

Serial.println("started working");

Serial.print("flow of the water is");

Serial.println(flow);

Serial.print("minimun time taken to reach destination is ");

Serial.println(time1);

Serial.print("Elapsed time: ");

Serial.print(h1,0);

Serial.print("h ");

Serial.print(m1,0);

Serial.print("m ");

Serial.print(s1,0);

Serial.print("s ");

Serial.println();

}

void displayresult1()

{

//------------------------------------------------------------

/*start the artmetic code for sensor 1*/

time2=q2-p2;

h2 = int(time2/3600000);

ove = time2%3600000;

m2 = int(ove/60000);

ove = ove%60000;

s2 = int(ove/1000);

flow = (x/time2);

//-----------------------------------------------------------

/*initializze the serial communication*/

Serial.begin(9600);

Serial.println("started working");

Serial.print("flow of the water is");

Serial.println(flow);

Serial.print("minimun time taken to reach destination is ");

Serial.println(time1);

Serial.print("Elapsed time: ");

Serial.print(h2,0);

Serial.print("h ");

Serial.print(m2,0);

Serial.print("m ");

Serial.print(s2,0);

Serial.print("s ");

Serial.println();

}

void displayresult2()

{

//------------------------------------------------------------

/*start the artmetic code for sensor 1*/

time3=q3-p3;

h3 = int(time3/3600000);

ov = time3%3600000;

m3 = int(ov/60000);

ov = ov%60000;

s3 = int(ov/1000);

flow = (x/time3);

//-----------------------------------------------------------

/*initializze the serial communication*/

Serial.begin(9600);

Serial.println("started working");

Serial.print("flow of the water is");

Serial.println(flow);

Serial.print("minimun time taken to reach destination is ");

Serial.println(time3);

Serial.print("Elapsed time: ");

Serial.print(h3,0);

Serial.print("h ");

Serial.print(m3,0);

Serial.print("m ");

Serial.print(s3,0);

Serial.print("s ");

Serial.println();

//------------------------------------------------------------

}

void loop()

{

//-------------------------------------------------------------

/*read the values into the constants declared*/

a= digitalRead(s11);

b= digitalRead(s12);

c= digitalRead(s13);

d= digitalRead(s21);

e= digitalRead(s22);

f= digitalRead(s23);

//-----------------------------------------------------------

/*now start writing the loop for the sensors to work*/

{

if(a==HIGH && b==LOW && c==LOW && d==LOW && e==LOW && f==LOW)

{

if(r==0)

{

Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number

delay(500);

Serial.print("warning1 at location1"); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

r++; s=0; t=0; u=0; v=0; w=0;

p1 = millis();

delay(1000);

alert();

}

}

if(a==HIGH && b==HIGH && c==LOW && d==LOW && e==LOW && f==LOW)

{

if(s==0)

{

Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number

delay(500);

Serial.print("warning2 at location 1 "); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

s++; r=0; t=0; u=0; v=0; w=0;

p2 = millis();

delay(1000);

alert();

}

}

if(a==HIGH && b==HIGH && c==HIGH && d==LOW && e==LOW && f==LOW)

{

if(t==0)

{

Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number

delay(500);

Serial.print("warning3 at location 1 "); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

t++; s=0; r=0; u=0; v=0; w=0;

p3 = millis();

delay(1000);

alert();

}

}

if(a==HIGH && b==HIGH && c==HIGH && d==HIGH && e==LOW && f==LOW)

{

if(u==0)

{

Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number

delay(500);

Serial.print("warning1 at location 2 "); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

u++; s=0; t=0; r=0; v=0; w=0;

q1 = millis();

delay(1000);

alert();

}

displayresult();

}

if(a==HIGH && b==HIGH && c==HIGH && d==HIGH && e==HIGH && f==LOW)

{

if(v==0)

{

Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number

delay(500);

Serial.print("warning2 at location 2 "); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

v++; s=0; t=0; u=0; r=0; w=0;

q2 = millis();

delay(1000);

alert();

}

displayresult1();

}

if(a==HIGH && b==HIGH && c==HIGH && d==HIGH && e==HIGH && f==HIGH)

{

if(w==0)

{

Serial.println("AT+CMGF=1");

delay(500);

Serial.println("AT+CMGS=\"your no.\"");//Change the receiver phone number

delay(500);

Serial.print("warning 3 at location 2 "); //the message you want to send

delay(500);

Serial.write(26);

delay(500);

w++; s=0; t=0; u=0; v=0; r=0;

q3 = millis();

delay(1000);

alert();

}

displayresult2();

}

}

}

vamsibond (author)2017-01-17

where do you declared rx and tx

RishabhL (author)vamsibond2017-01-17

no need to declare rx & tx ... pin 0 & 1 are default for rx & tx....

vamsibond (author)RishabhL2017-02-05

i am working on a project to estimate the time to full a tank by calculating activation times of levels..

counting bits from level 1 to 2 and have to say estimation to level 3

if you know any thing about this please suggest me

RishabhL (author)vamsibond2017-02-05

No I don't know about this.

vamsibond (author)vamsibond2017-02-05

with the code

heymohit (author)2016-09-15

Good implementation - I am planning to make a similar project using ESP8266.

RishabhL (author)heymohit2016-09-16

I'm also working for the same.