Introduction: Water Level Monitoring Using BoltIoT

Generally, in every house, there is a problem with a water tank. leaking of water if we forget that we put ON the motor, So I made a project which will give info about the water level in the tank and we can control the motor(ON and OFF).

We will get the msg if the tank is empty and can make it on through our mobile app using Bolt device which has an integrated wifi chip(ESP8266) it helps to connect to the Internet.

And we will control the motor using the Internet.

Step 1: Components Used :

1)Bolt Unit

2)Arduino UNO

3)Battery's (4v)

4)UltraSonic Sensor

5)Jumper Wires

6)Relay

7)Switch

Step 2: Bolt Unit

Bolt is an electronic device which has an inbuilt nature of connecting to the internet using ESP8266 and It works on a 5v power supply.

The device will connect to the near wifi router or mobile hotspot to access the internet.

We can make it connect to the specific wifi using
"Boltiot app" it is available in both the play store and app store.

By that, we can control this device remotely using the Internet.

Step 3: Arduino UNO and Battery Cnnection

Here we connect 4v battery in Series and from the +ve wire we will connect to the switch and from the other end of the switch we will connect it to the "+ve" terminal of the Arduino UNO

And from -ve sign of the battery we will directly connect it to the Arduino -ve terminal. Then we can supply the power using a switch.

Step 4: Connecting UltraSonic Sensor With Arduino UNO

An Ultrasonic sensor is a device that can measure the distance to an object by using sound waves. It measures distance by sending out a sound wave at a specific frequency and listening for that sound wave to bounce back.

UltraSonic Sensor - Arduino Uno

1)VCC pin - 5v pin

2)GND pin -GND pin

3)Trig pin - 9 pin'

4)ECHO pin - 8 pin

Programming Arduino UNO:

This program will control the Relay by receiving the commands from the Bolt device and by the UltraSonic Sensor to the Arduino Uno.

In this project, we will send commands from bolt to ArduinoUno using UART communication.

We have to change the distance limits in the program as per our utility.

DUMP the below program in Arduino UNO.

Step 5: Relay to Arduino UNO

A relay is an electromagnetic switch operated by a relatively small electric current that can turn on or off a much larger electric current. The heart of a relay is an electromagnet.

Now in this project, we use a relay to power on the motor with Arduino Uno.

How relay works

Arduino UNO - Relay Board

5v - Vcc

Gnd pin - GND pin

2 pin - IN1 pin

Relay info

Step 6: Relay Connection With Motor

By seeing the above pic the bulb is controlled through the bolt device

In this project, we will control it through Arduino UNO.

In the above pic, the IN1 pin is connected to A0 pin

same way in this project we will connect the IN1 pin to 2 pin of the Arduino Uno.

Step 7: Connecting Bolt and Arduino UNO

BOLT UNIT - Arduino UNO

1)5v pin - 5v

2)GND - GND pin

3) TX pin - 0 pin

4) RX pin - 1 pin

Bolt Starting Serial communication with Arduino UNO using the link

http://cloud.boltiot.com/remote/YourapiKey/serialBegin?baud=9600&deviceName=BOLTxxxxxx

YourapiKey ---- give your device API key, You can get it from "Developer Console"

deviceName = give your device name, You can get it from "BOLTIOT app" in Google store or app store

keep baud rate to 9600.

Step 8: Getting Message When the Water Tank Is Empty

To get a message we will use VPS(Virtual private server) we will get it from digitalOcean

https://m.do.co/c/c0d7bb6489f4

Use the above link to create your account this will give credit 10$ in your digital ocean account.

To know

How to create Click Here.

Then create Twilio account and getting the message, To know how Click Here.

Run below program in your server

from twilio.rest import TwilioRestClient
from credentials import account_sid, auth_token, my_cell, my_mobile import requests,json,time

client = TwilioRestClient(account_sid, auth_token)

def send_msg(sensor_data):

my_msg = "Water Tank is Empty" message = client.messages.create(to=my_cell, from_=my_mobile, body=my_msg)

while True:

r = requests.get('http://cloud.boltiot.com/remote/api_key/analogRead?pin=A0&deviceName=BOLTXXXXXX') data = json.loads(r.text)

print data['value']

try:

sensor_value = int(data['value'])

print sensor_value

if sensor_value == 0:

send_msg(str(sensor_value))

except Exception as e:

print "Error",e

time.sleep(5)

Step 9: Creating Your App to Monitor

Go to MIT app inventor WEBSITE

Then sign in with your Google account.

Then "START NEW PROJECT " give name and drag and drop the components in screen 1

You can see the components in the image and we can change their properties ,

And after, go to "blocks" and connect the blocks as shown in the above image.

In "level button" block give the URL

"http://cloud.boltiot.com/remote/YourapiKey/serialRead?till=10&deviceName=BOLTxxxxxx"

In "turnoff button" block give the URL

"http://cloud.boltiot.com/remote/YourapiKey/serialWrite?data=f&deviceName=BOLTxxxxxx"

In "turnon button" block give the URL

"http://cloud.boltiot.com/remote/YourapiKey/serialWrite?data=n&deviceName=BOLTxxxxxx"

NOTE :

At

YourapiKey ---- give your device API key, You can get it from "Developer Console"

deviceName = give your device name, You can get it from "BOLTIOT app" in Google store or app store.

Invention Challenge 2017

Participated in the
Invention Challenge 2017