Você está na página 1de 8

16/12/2018 Water Level Indicator Using Arduino & Ultrasonic Sensor- Circuit, Program

Looking for Latest Electronics Project Kits? CLICK HERE (http://www.store.circuitstoday.com/)


(http://www.circuitstoday.com)

SPONSORED SEARCHES

Water Level Sensor RF Antenna Design Water Level Indicator Using Arduino

Receiver RF Transmitter PCB Design Software PCB Schematic

Water Level Indicator Using Arduino & Ultrasonic


Sensor (http://www.circuitstoday.com/water-level-
indicator-arduino-ultrasonic-sensor)
 john  February 17, 2018  10 Comments

Water Level Indicator Using Arduino


Wireless Water Level Indicator Using Ultrasonic sensor & Arduino is an amazing and very useful project. The objective of this project is to notify the user the amount
of water that is present in the overhead water tank. This project can be further enhanced to control the water level in the tank by turning it ON, when the water level
is LOW, and turning it OFF when the water level is HIGH. Thus, the Arduino water level indicator helps in preventing wastage of water in overhead tank. This project is
wireless so, it is easy to install and it can work up to 100 meters.

In this project two circuits are used: a transmitter circuit and a receiver circuit. The transmitter circuit makes use of an ultrasonic sensor to measure the water level in
terms of distance. This data is sent to the receiver circuit using RF communication. The water level is shown in terms of percentage on a 16×2 LCD module, which is
connected to receiver circuit.

Components Used
Search:
Show 10 entries

Components  Speci cation  Quantity 

Arduino Nano 2

Ultrasonic Sensor HC-SR04 1

RF Transmitter Receiver Pair ASK 433 1

LCD 16x2 1

Preset 10K 1

Switch DPDT (PCB Mount) 2

Battery 9 Volt 2

http://www.circuitstoday.com/water-level-indicator-arduino-ultrasonic-sensor 1/16
16/12/2018 Water Level Indicator Using Arduino & Ultrasonic Sensor- Circuit, Program

Components  Speci cation  Quantity 

Battery Holder 2

Showing 1 to 8 of 8 entries  Previous Next 

Working
In the project two circuits are used, First is the transmitter and second is the receiver. An Ultrasonic sensor is used in the transmitter circuit, which measures the
distance of water level from the upper point of the bottle or Tank. The distance is measured in centimeters and sent to receiver circuit using RF communication.

(http://www.circuitstoday.com/wp-content/uploads/2017/10/Arduino-Water-Level-Indicator-
e1508379134195.jpg)

Arduino Water Level Indicator

Receiver circuit receives the data from transmitter circuit and converts it in terms of the percentage and shows on LCD.

http://www.circuitstoday.com/water-level-indicator-arduino-ultrasonic-sensor 2/16
16/12/2018 Water Level Indicator Using Arduino & Ultrasonic Sensor- Circuit, Program

(http://www.circuitstoday.com/wp-content/uploads/2017/10/Water-Level-Indicator-Using-Arduino-
e1508379191927.jpg)

Water Level Indicator Using Arduino

Ultrasonic sensor has two openings, one is Trigger and the other is Echo. Trigger makes high frequency sound waves. These sound waves are passed through the tank
from top to bottom. The sound waves hit the water and are re ected back in the form of Echo waves. The Echo opening receives the Echo waves. The water level
sensor Arduino measures the time between Echo and Trigger. This traveled distance is directly proportional to the time.

(http://www.circuitstoday.com/wp-content/uploads/2017/10/Water-Level-Indicator-Using-Ultrasonic-
Sensor-e1508379382322.png)

http://www.circuitstoday.com/water-level-indicator-arduino-ultrasonic-sensor 3/16
16/12/2018 Water Level Indicator Using Arduino & Ultrasonic Sensor- Circuit, Program

Water Level Indicator Using Ultrasonic Sensor

Water Level Indicator Using Arduino – Video Demonstration

Water Level Indicator Using Arduino and Ultrasonic Sensor

Arduino Water Level Indicator Circuit


In this project two circuits are used

Transmitter Circuit –   Transmitter circuit is shown in the gure below. Fig1, in this circuit an Ultrasonic sensor is connected to pin D9 and D10 pin of Arduino.
Ultrasonic sensor is powered by Vcc and GND pin, these pins are connected to Vcc and GND pin of the Arduino. The measured data is transmitted by RF
transmitter. RF transmitter’s data pin is connected to D4 pin of Arduino Nano. RF transmitter’s Vcc and GND pins are connected to Vcc and GND pins of the
Arduino. In this transmitter circuit an Antenna is used which is connected to ANT pin of RF transmitter, whole circuit is powered by 9 volt battery. The battery is
connected to Vin and GND pin of Arduino.

(http://www.circuitstoday.com/wp-content/uploads/2017/10/Water-Level-Indicator-Using-Arduino-
Transmitter-Circuit-e1508376386177.bmp)

Water Level Indicator Using Arduino – Transmitter Circuit

Receiver Circuit – In the receiver Circuit, RF Receiver is used for receiving data from the transmitter. Data pin of RF Receiver is connected to D4 pin of Arduino.
Water level is shown on LCD and LCD is connected to Arduino from pin D4 to D9. LCD is powered by Vcc and GND pin using the Arduino, the contrast of LCD is
changed by moving the preset, which is connected to pin 3 of LCD. Receiver circuit is powered by a 9 Volt battery through a switch, which is connected between
Vcc and GND pin of the Arduino. Circuit is shown in the gure below.

http://www.circuitstoday.com/water-level-indicator-arduino-ultrasonic-sensor 4/16
16/12/2018 Water Level Indicator Using Arduino & Ultrasonic Sensor- Circuit, Program

(http://www.circuitstoday.com/wp-content/uploads/2017/10/Water-Level-Indicator-Using-Arduino-
Receiver-Circuit-e1508376904116.bmp)

Water Level Indicator Using Arduino – Receiver Circuit

The above shown circuit diagrams of transmitter and receiver circuits are more than enough to make one by yourself on a breadboard or Zero PCB.

If you are good in PCB Etching, you can use the images given below.

(http://www.circuitstoday.com/wp-content/uploads/2017/10/Water-Level-Indicator-Using-Arduino-PCB-Design-
e1508378013115.png)

Water Level Indicator Using Arduino – PCB Design

http://www.circuitstoday.com/water-level-indicator-arduino-ultrasonic-sensor 5/16
16/12/2018 Water Level Indicator Using Arduino & Ultrasonic Sensor- Circuit, Program

(http://www.circuitstoday.com/wp-content/uploads/2017/10/Water-Level-Indicator-Using-Arduino-PCB-
e1508378094470.png)

Water Level Indicator Using Arduino – PCB

(http://www.circuitstoday.com/wp-

content/uploads/2017/10/RF-Receiver.png)

RF Receiver

http://www.circuitstoday.com/water-level-indicator-arduino-ultrasonic-sensor 6/16
16/12/2018 Water Level Indicator Using Arduino & Ultrasonic Sensor- Circuit, Program

(http://www.circuitstoday.com/wp-

content/uploads/2017/10/Rf-Transmiitter.png)

RF Transmiitter

Program/Code
Download (http://www.circuitstoday.com/wp-content/uploads/ les/arduino/Arduino_Water_Level_Transmitter.rar) – Program for Water Level Controller
(Transmitter)

Download (http://www.circuitstoday.com/wp-content/uploads/ les/arduino/Arduino_Water_Level_Receiver.rar) – Program for Water Level Controller (Receiver)

In this project two circuits are used, both are powered by Arduino Nano (http://www.circuitstoday.com/arduino-nano-tutorial-pinout-schematics). RF module is used
for the communication between the Transmitter and the Receiver circuits.

How to Attach Library

1.  Download the library le from the link https://github.com/sui77/rc-switch.


2. Extract the le rc-switch-master.
3. Copy the folder inside rc-switch-master folder.
4. Paste the folder at location Documents> Arduino> library.
5. Close the Arduino IDE software (if opend).
6. Open the Arduino IDE.
7. Click on le >Example
8. If library is attached, you can see the rc-switch-master in Example list.

Transmitter
In the coding of the transmitter side, two header les are used. First is RCSwitch.h, which is used for RF transmitter and the second is Ultrasonic.h, which is used for
the ultrasonic sensor.

Now pins of ultrasonic sensor is declared by the name ultrasonic in line 4, pin11 is Trig and pin10 is Echo. In the line 5 RCSwitch is declared for the transmitter by name
“mySwitch”. In the line 7 an integer is declared by the name “i”.

In the void setup Transmitter is enabled by function “mySwitch.enableTransmit(4)”, where transmitter’s data pin is connected to pin D4 of the Arduino.

In the void loop, the distance is measured by function “ultrasonic.Ranging(CM)” and it is assigned in integer “I”, this distance is measured in centimeters.

In the line 15, the measured distance is transmitted by function “mySwitch.send(i, 24)”, where “i” is the distance and 24 is the bit format. After all “delay” of 100
milliseconds are used, which means Arduino sends the data after every 100 milliseconds.

Receiver
http://www.circuitstoday.com/water-level-indicator-arduino-ultrasonic-sensor 7/16
16/12/2018 Water Level Indicator Using Arduino & Ultrasonic Sensor- Circuit, Program

In the receiver side, two header les are used, The rst is “RCSwitch.h” which is used for RF communication between the Transmitter and the Receiver and the second
is “LiquidCrystal.h”, which is used for LCD display.

In the line 4, Arduino pins are declared, which are connected to LCD. Total 6 pins are connected to Arduino that are D4, D5, D6, D7, D8, D9. In the line 5, “RCSwitch” is
declared by the name “mySwitch”.

In the line 7, a oat is declared by the name “level”, which shows the water level and in the line 9 and 10 two integers are declared by name “Hval” and “Lval” where,
“Hval” is the upper value of water level (distance from ultrasonic sensor) and “Lval” is the Lower value of water level (distance from ultrasonic sensor). After all pin of
buzzer is declared by integer “BUZZER” where, 10 is the D10 PIN of Arduino.

In the void setup RF Receiver is enabled by function “mySwitch.enableReceiver(0)”, where 0 is the interrupt pin (INT0) which is D2 pin of Arduino.

In the line 16, LCD begins by function “lcd.begin(16, 2)”, and in line 17, “lcd.print” is used for showing “WATER LEVEL INDI” in the rst row of LCD.

In the line 19, “pinMode(BUZZER, OUTPUT)” declares the BUZZER pin as OUTPUT.

In the “void loop()” in the begening “if (mySwitch.available())” is used, that means if any data is received from RF Receiver, the program come in the loop. In the line 25,
data coming from RF Receiver is decoded by function “mySwitch.getRecivedValue” and saved in a oat “level”.

In the line 27 and 28 the “level” is processed and converted into the percentage, by using some mathematical expression. In line 30, “If” condition is used for limitation
of percentage.

In the line 32, 33, 34, 35 the level is print on the LCD and in the line 37 “mySwitch.reset.Available()” function is used for resetting the RF module.

In the end of the code, “If” condition is used for switching on the buzzer, if level become more then 99 percentage.

SPONSORED SEARCHES

Water Level Sensor Water Level Indicator Using Arduino

PCB Board Level Tank

Categories: Arduino (http://www.circuitstoday.com/category/arduino)

 Previous post (( Next post 


hh

tt

tt

pp

::

//
You may also like: //

ww
8 Best Arduino Starter Kit for Beginners (http://www.circuitstoday.com/best-arduino-starter-kit-beginner)
w
w
Arduino Nano Tutorial – Pinout & Schematics (http://www.circuitstoday.com/arduino-nano-tutorial-pinout-
schematics) w
w

..
Arduino Mega Tutorial – Pinout & Schematics (http://www.circuitstoday.com/arduino-mega-pinout-schematics)
cc

http://www.circuitstoday.com/water-level-indicator-arduino-ultrasonic-sensor 8/16

Você também pode gostar