loading

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

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

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

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

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!

<p>can you check this code for me please</p>
Code is correct...
<p>where did u specified values for a,b,c,d</p>
<blockquote><strong>Specify the values of a,b,c,d globally above the void setup as 0;</strong></blockquote><p><strong><em>int a=0;</em></strong></p><p><strong><em>int b=0;</em></strong></p><p><strong><em>int c=0;</em></strong></p><p><strong><em>int d=0;</em></strong></p><p>void setup() {</p>
<p>what is the use of these a b c d </p><p>what is operation performed by them</p>
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.
<p>can help me with my code whether it works or not.......</p><p>/*declare some constants*/</p><p>int r=0;</p><p>int s=0;</p><p>int t=0;</p><p>int u=0;</p><p>int v=0;</p><p>int w=0;</p><p>int x=10;</p><p>int a=0,b=0,c=0,d=0,e=0,f=0;</p><p>float h1,m1,s1,h2,m2,s2,h3,m3,s3;</p><p>unsigned long flow,over,ove,ov;</p><p>unsigned long time1,time2,time3;</p><p>unsigned long p1,p2,p3,q1,q2,q3;</p><p>//-----------------------------------------------------------</p><p>/*define the pin numbers*/</p><p>#define s11 3</p><p>#define s12 4</p><p>#define s13 5</p><p>#define s21 6</p><p>#define s22 7</p><p>#define s23 8</p><p>#define buz 9</p><p>#define buz1 10</p><p>#define led 13</p><p>//------------------------------------------------------------</p><p>/*start the setup program*/</p><p>void setup()</p><p>{</p><p>//------------------------------------------------------------</p><p>pinMode(s11, INPUT);</p><p>pinMode(s12, INPUT);</p><p>pinMode(s13, INPUT);</p><p>pinMode(s21, INPUT);</p><p>pinMode(s22, INPUT);</p><p>pinMode(s23, INPUT);</p><p>pinMode(buz, OUTPUT);</p><p>pinMode(led, OUTPUT);</p><p>//-----------------------------------------------------------</p><p>Serial.begin(9600);</p><p>Serial.println(&quot;started working&quot;);</p><p>}</p><p>//-----------------------------------------------------------</p><p>void alert()</p><p>{</p><p> digitalWrite(buz,HIGH);</p><p> digitalWrite(led,HIGH);</p><p>}</p><p>void displayresult()</p><p>{</p><p>/*start the artmetic code for sensor 1*/</p><p>time1=q1-p1;</p><p>h1 = int(time1/3600000);</p><p>over = time1%3600000;</p><p>m1 = int(over/60000);</p><p>over = over%60000;</p><p>s1 = int(over/1000);</p><p>flow = (x/time1);</p><p>//-----------------------------------------------------------</p><p>/*initializze the serial communication*/</p><p>Serial.begin(9600);</p><p>Serial.println(&quot;started working&quot;);</p><p>Serial.print(&quot;flow of the water is&quot;);</p><p>Serial.println(flow);</p><p>Serial.print(&quot;minimun time taken to reach destination is &quot;);</p><p>Serial.println(time1);</p><p>Serial.print(&quot;Elapsed time: &quot;);</p><p>Serial.print(h1,0);</p><p>Serial.print(&quot;h &quot;);</p><p>Serial.print(m1,0);</p><p>Serial.print(&quot;m &quot;);</p><p>Serial.print(s1,0);</p><p>Serial.print(&quot;s &quot;);</p><p>Serial.println();</p><p>}</p><p>void displayresult1()</p><p>{</p><p>//------------------------------------------------------------</p><p>/*start the artmetic code for sensor 1*/</p><p>time2=q2-p2;</p><p>h2 = int(time2/3600000);</p><p>ove = time2%3600000;</p><p>m2 = int(ove/60000);</p><p>ove = ove%60000;</p><p>s2 = int(ove/1000);</p><p>flow = (x/time2);</p><p>//-----------------------------------------------------------</p><p>/*initializze the serial communication*/</p><p>Serial.begin(9600);</p><p>Serial.println(&quot;started working&quot;);</p><p>Serial.print(&quot;flow of the water is&quot;);</p><p>Serial.println(flow);</p><p>Serial.print(&quot;minimun time taken to reach destination is &quot;);</p><p>Serial.println(time1);</p><p>Serial.print(&quot;Elapsed time: &quot;);</p><p>Serial.print(h2,0);</p><p>Serial.print(&quot;h &quot;);</p><p>Serial.print(m2,0);</p><p>Serial.print(&quot;m &quot;);</p><p>Serial.print(s2,0);</p><p>Serial.print(&quot;s &quot;);</p><p>Serial.println();</p><p>}</p><p>void displayresult2()</p><p>{</p><p>//------------------------------------------------------------</p><p>/*start the artmetic code for sensor 1*/</p><p>time3=q3-p3;</p><p>h3 = int(time3/3600000);</p><p>ov = time3%3600000;</p><p>m3 = int(ov/60000);</p><p>ov = ov%60000;</p><p>s3 = int(ov/1000);</p><p>flow = (x/time3);</p><p>//-----------------------------------------------------------</p><p>/*initializze the serial communication*/</p><p>Serial.begin(9600);</p><p>Serial.println(&quot;started working&quot;);</p><p>Serial.print(&quot;flow of the water is&quot;);</p><p>Serial.println(flow);</p><p>Serial.print(&quot;minimun time taken to reach destination is &quot;);</p><p>Serial.println(time3);</p><p>Serial.print(&quot;Elapsed time: &quot;);</p><p>Serial.print(h3,0);</p><p>Serial.print(&quot;h &quot;);</p><p>Serial.print(m3,0);</p><p>Serial.print(&quot;m &quot;);</p><p>Serial.print(s3,0);</p><p>Serial.print(&quot;s &quot;);</p><p>Serial.println();</p><p>//------------------------------------------------------------</p><p>}</p><p>void loop() </p><p>{</p><p>//-------------------------------------------------------------</p><p>/*read the values into the constants declared*/</p><p>a= digitalRead(s11);</p><p>b= digitalRead(s12);</p><p>c= digitalRead(s13);</p><p>d= digitalRead(s21);</p><p>e= digitalRead(s22);</p><p>f= digitalRead(s23);</p><p>//-----------------------------------------------------------</p><p>/*now start writing the loop for the sensors to work*/</p><p>{</p><p>if(a==HIGH &amp;&amp; b==LOW &amp;&amp; c==LOW &amp;&amp; d==LOW &amp;&amp; e==LOW &amp;&amp; f==LOW)</p><p>{</p><p> if(r==0)</p><p> {</p><p> Serial.println(&quot;AT+CMGF=1&quot;);</p><p> delay(500);</p><p> Serial.println(&quot;AT+CMGS=\&quot;your no.\&quot;&quot;);//Change the receiver phone number </p><p> delay(500);</p><p> Serial.print(&quot;warning1 at location1&quot;); //the message you want to send</p><p> delay(500);</p><p> Serial.write(26);</p><p> delay(500);</p><p> r++; s=0; t=0; u=0; v=0; w=0;</p><p> p1 = millis();</p><p> delay(1000);</p><p> alert();</p><p> }</p><p>}</p><p>if(a==HIGH &amp;&amp; b==HIGH &amp;&amp; c==LOW &amp;&amp; d==LOW &amp;&amp; e==LOW &amp;&amp; f==LOW)</p><p>{</p><p> if(s==0)</p><p> {</p><p> Serial.println(&quot;AT+CMGF=1&quot;);</p><p> delay(500);</p><p> Serial.println(&quot;AT+CMGS=\&quot;your no.\&quot;&quot;);//Change the receiver phone number </p><p> delay(500);</p><p> Serial.print(&quot;warning2 at location 1 &quot;); //the message you want to send</p><p> delay(500);</p><p> Serial.write(26);</p><p> delay(500);</p><p> s++; r=0; t=0; u=0; v=0; w=0;</p><p> p2 = millis();</p><p> delay(1000);</p><p> alert();</p><p> }</p><p>}</p><p>if(a==HIGH &amp;&amp; b==HIGH &amp;&amp; c==HIGH &amp;&amp; d==LOW &amp;&amp; e==LOW &amp;&amp; f==LOW)</p><p>{</p><p> if(t==0)</p><p> {</p><p> Serial.println(&quot;AT+CMGF=1&quot;);</p><p> delay(500);</p><p> Serial.println(&quot;AT+CMGS=\&quot;your no.\&quot;&quot;);//Change the receiver phone number </p><p> delay(500);</p><p> Serial.print(&quot;warning3 at location 1 &quot;); //the message you want to send</p><p> delay(500);</p><p> Serial.write(26);</p><p> delay(500);</p><p> t++; s=0; r=0; u=0; v=0; w=0;</p><p> p3 = millis();</p><p> delay(1000);</p><p> alert();</p><p> }</p><p>}</p><p>if(a==HIGH &amp;&amp; b==HIGH &amp;&amp; c==HIGH &amp;&amp; d==HIGH &amp;&amp; e==LOW &amp;&amp; f==LOW)</p><p>{</p><p> if(u==0)</p><p> {</p><p> Serial.println(&quot;AT+CMGF=1&quot;);</p><p> delay(500);</p><p> Serial.println(&quot;AT+CMGS=\&quot;your no.\&quot;&quot;);//Change the receiver phone number </p><p> delay(500);</p><p> Serial.print(&quot;warning1 at location 2 &quot;); //the message you want to send</p><p> delay(500);</p><p> Serial.write(26);</p><p> delay(500);</p><p> u++; s=0; t=0; r=0; v=0; w=0;</p><p> q1 = millis();</p><p> delay(1000);</p><p> alert();</p><p> }</p><p>displayresult();</p><p>}</p><p>if(a==HIGH &amp;&amp; b==HIGH &amp;&amp; c==HIGH &amp;&amp; d==HIGH &amp;&amp; e==HIGH &amp;&amp; f==LOW)</p><p>{</p><p> if(v==0)</p><p> {</p><p> Serial.println(&quot;AT+CMGF=1&quot;);</p><p> delay(500);</p><p> Serial.println(&quot;AT+CMGS=\&quot;your no.\&quot;&quot;);//Change the receiver phone number </p><p> delay(500);</p><p> Serial.print(&quot;warning2 at location 2 &quot;); //the message you want to send</p><p> delay(500);</p><p> Serial.write(26);</p><p> delay(500);</p><p> v++; s=0; t=0; u=0; r=0; w=0;</p><p> q2 = millis();</p><p> delay(1000);</p><p> alert();</p><p> }</p><p> displayresult1();</p><p>}</p><p>if(a==HIGH &amp;&amp; b==HIGH &amp;&amp; c==HIGH &amp;&amp; d==HIGH &amp;&amp; e==HIGH &amp;&amp; f==HIGH)</p><p>{</p><p> if(w==0)</p><p> {</p><p> Serial.println(&quot;AT+CMGF=1&quot;);</p><p> delay(500);</p><p> Serial.println(&quot;AT+CMGS=\&quot;your no.\&quot;&quot;);//Change the receiver phone number </p><p> delay(500);</p><p> Serial.print(&quot;warning 3 at location 2 &quot;); //the message you want to send</p><p> delay(500);</p><p> Serial.write(26);</p><p> delay(500);</p><p> w++; s=0; t=0; u=0; v=0; r=0;</p><p> q3 = millis();</p><p> delay(1000);</p><p> alert();</p><p> }</p><p> displayresult2();</p><p>}</p><p>}</p><p>}</p>
<p>where do you declared rx and tx</p>
no need to declare rx &amp; tx ... pin 0 &amp; 1 are default for rx &amp; tx....
<p>i am working on a project to estimate the time to full a tank by calculating activation times of levels..</p><p>counting bits from level 1 to 2 and have to say estimation to level 3</p><p>if you know any thing about this please suggest me</p>
No I don't know about this.
<p>with the code</p>
<p>Good implementation - I am planning to make a similar project using ESP8266. </p>
I'm also working for the same.

About This Instructable

2,770views

24favorites

License:

More by RishabhL:Simple Home Automation With Blynk Nodemcu With OLED Display, PIR & DHT11 8 Player Quizz Buzzer System Using Arduino 
Add instructable to: