Académique Documents
Professionnel Documents
Culture Documents
In this Smart Wireless water level Monitoring & Pump controlling System,We are going
to measure the water level by using ultrasonic sensors. Basic principal of ultrasonic
distance measurement is based on ECHO. When sound waves are transmitted in
environment then they return back to the origin as ECHO after striking on any obstacle.
So we have to only calculate its traveling time of both sounds means outgoing time and
returning time to origin after striking on any obstacle.
And after some calculation we can get a result that is the distance. This concept is used
in our water controller project where the water motor pump is automatically turned on
when water level in the tank becomes low. You can also check this simple water level
indicator circuit for a simpler version
1
CHAPTER-1
TANK LEVEL MANAGEMENT
1.1 INTRODUCTION
In everyday life, there must be some physical elements that need to be controlled in
order for them to perform their expected behaviours. A control system therefore can
be defined as a device, or set of devices, that manages, commands, directs or regulates
the behaviour of other device(s) or system(s). Consequently, automatic controlling
involves designing a control system to function with minimal or no human
interference.Today there search, designs, building of new smart technology used in
different domestic, commercial, industrial sectors are developing the applications of
smart monitoring day by day.
A smart monitoring and control, in general an electro- mechanical & computer
programming using power and control machinery device that can perform takes
automatically depending on sensors. This project is designed to build to maser a water
level in a Madhurima Santraet al., Smart Wireless water level Monitoring & Pump
controlling System 187 Journal Impact Factor (JIF): 2.712 www.ijasre.net tank, and
controlling the water pump by without human interfacing. An Arduino UnoR3 is used
to achieve the desired operation. Ultrasonic sensor is used to detect the level of water
and sends a command to the Arduino. ASK RF transmitter is used to send a command
to the RX for starting or stop the water pump of this project.
2
CHAPTER 2
EXISTING SYSTEMS
This section provides the brief overview of the existing systems in the operation today.
The design details of these systems are continuously evolving, with new systems
emerging the old ones going by the wayside.
A float switch includes a magnet within a float and a magnetic read switch. The float
moves with the change in liquid and will cause the read switch open or close
depending on if it is in air or liquid.
It non-powered, direct indication, relatively inexpensive, and capable of various
outputs. The applications of float switch are in water tanks, hydraulic fluids, and some
chemical fluids.
They used magnetic reed switches that would complete the circuit once the float
reaches its lowest point in the water (or when the storage tank is empty). The magnet
would disconnect once the water reaches the adequate level again, opening the circuit
back up. These old float switches didn’t have many operations and needed to be
replaced about every 3 years or so, making them expensive to keep up with. However,
new float switch manufacturers are producing water level control technology that is
getting rid of old float switches for good.
3
.
Float switches of the 21st century have come much further in the amount of
operations your float switch can perform. For example, Water Level Controls is a
float switch manufacturer that is revolutionizing the way float switches are used for
water level sensing. Water Level Control’s NEW Float switches work by using probes
(instead of floats) to detect or (sense) water levels in a storage tank (water, oil, gas,
etc).
The sensor probes actually act as their own sensors and do not pass electricity through
the probes which keeps them from fouling, degrading and deteriorating. Also, all of
the electronics are built into the head so you can connect directly to your control
panel. Once the water level is detected by one of the sensors, this causes one of six
alarms to be triggered (High Alarm, Low Alarm, Fill Start, Fill Stop, etc). Depending
on the type of float switch you have, there can be single point alarm or a multi point
alarm that is triggered. Different alarms control different start and stop mechanisms.
For example, if a low alarm was triggered in a water storage tank, that alarm could do
one of 2 things (or both in some setups). In a multi point float switch, a low alarm
could trigger the LED light to turn on and send a signal to turn on an automatic water
4
pump to refill the water back to the preprogrammed wa
In a multi point float switch, a low alarm could trigger the LED light to turn on and send
a signal to turn on an automatic water pump to refill the water back to the
preprogrammed water level.
Also, in a multi-point float switch, the process could go even further by programming
your automatic pump to stop after the water level has reached the Fill Stop probe. In the
most basic way to say it, float switches detect water levels and provide a signal to a
computer to tell it what to do once the water reaches different probe levels. If the water
level is too low, it will signal a low alarm and fill up the water, if the water level is too
high, it will send a signal high alarm signal and automatically drain the water etc. This
5
helps cooling tower operators keep their water levels at the adequate height
“automatically” without manually performing these operations manually themselves.
Almost any storage tank that uses float switches can use this technology and should.
These water levels controls last 5 times as long for only double the price of a typical
float switch.
The disadvantages of the float switch mechanism are:
6
In this arrangement, two dual-tip probes are employed which are helpful in indicating
the highest and lowest levels of fluid. As soon as the level of the liquid approaches the
upper probe, a switch gets operated to activate the discharge pump whereas when the
level drops below and approaches the lower probe, the switch gets deactivated and the
pump gets stopped.
The conductive probes operate by means of differences in the electrical resistance
between the reference electrode and the level control electrode. These sensors tend to
detect the electrical resistance when the level electrodes get submerged in the process
fluid. ”An electrically conductive tank wall can be used as the reference electrode. If the
tank is made of plastic, concrete, or any other nonconductive material, an additional
electrode is required as a reference.”[2]
7
2.3 How do optical level sensors work
If you’re looking for a durable, sophisticated device for industrial point level sensing,
an optical level sensor might be what you’re looking for. Using infrared light and no
moving parts whatsoever, optical sensors are ideal in environments where more
traditional float switches aren’t functional. Keep reading to learn more about how they
work, and decide if they’re right for your application.
Optical level sensors consist of two main parts: an infrared led coupled with a light
transistor, and a transparent prism tip in the front. The led projects an infrared light
outward; when the sensor tip is surrounded by air the light reacts by bouncing back
within the tip before returning to the transistor. When the sensor is immersed in liquid,
8
the light disperses throughout and less is returned to the transistor. The amount of
returned light to the transistor affects output levels, making point level sensing possible.
The main advantages of optical level sensors are their compact size, their lack of moving
parts, and their low cost. However, while extremely accurate for point level detection in
high-stress environments, they’re less useful for continuous level measurement. In
addition, optical level sensors are unsuited for applications where top mounting is
necessary; when top-mounted, the accuracy optical level sensors may be adversely
affected by moisture condensation.
If you think an optical level sensor is right for your application, consider one of these
two models from smd fluid controls.
The os950 miniature plastic optical level sensor is made from a polysulfone polymer,
and is well-suited for sterile applications like dialysis machines, washers, and other
medical appliances.
The os150 stainless steel model is designed for high pressure applications where
corrosion resistance is necessary, such as pressurized vessels, refrigeration units, or
hydraulic applications. Maximum psi is 2,500.
To learn more about optical and other level sensors, including custom and high-volume
orders in the united states and the united kingdom, contact smd fluid controls today.
9
CHAPTER 3
ESP8266 NodeMCU WiFi Devkit
The ESP8266 is the name of a micro controller designed by Espressif Systems. The ESP8266
itself is a self-contained WiFi networking solution offering as a bridge from existing micro
controller to WiFi and is also capable of running self-contained applications. This module
comes with a built in USB connector and a rich assortment of pin-outs. With a micro USB
cable, you can connect NodeMCU devkit to your laptop and flash it without any trouble, just
like Arduino. It is also immediately breadboard friendly.
3.1 Specification:
• Voltage:3.3V.
• Wi-Fi Direct (P2P), soft-AP.
• Current consumption: 10uA~170mA.
• Flash memory attachable: 16MB max (512K normal).
• Integrated TCP/IP protocol stack.
• Processor: Tensilica L106 32-bit.
• Processor speed: 80~160MHz.
• RAM: 32K + 80K. • GPIOs: 17 (multiplexed with other functions).
• Analog to Digital: 1 input with 1024 step resolution.
10
• +19.5dBm output power in 802.11b mode
• 802.11 support: b/g/n.
• Maximum concurrent TCP connections: 5.
3.2. Pin Definition:
11
3.2 Install the ESP8266 Board Package
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional
Board Manager URLs field in the Arduino v1.6.4+ preferences.
12
Scroll down to ‘ esp8266 by ESP8266 Community ’ and click “Install” button to install the
ESP8266 library package. Once installation completed, close and re-open Arduino IDE for
ESP8266 library to take effect.
3.5 Setup ESP8266 Support
When you've restarted Arduino IDE, select ‘Generic ESP8266 Module’ from the ‘Tools’ ->
‘Board:’ dropdown menu.
13
14
Go to your Windows ‘Device Manager’ to find out which Com Port ‘USB-Serial CH340’ is
assigned to. Select the matching COM/serial port for your CH340 USB-Serial interface.
15
Note: if this is your first time using CH340 “ USB-to-Serial ” interface, please install the
driver first before proceed the above Com Port setting. The CH340 driver can be download
from the below site:
https://github.com/nodemcu/nodemcu-devkit/tree/master/Drivers
3.6 Blink Test
Now you'll need to put the board into bootload mode. You'll have to do this before each
upload. There is no timeout for bootload mode, so you don't have to rush!
• Hold down the ‘Flash’ button.
• While holding down ‘ Flash’, press the ‘RST’ button.
• Release ‘RST’, then release ‘Flash
• When you release the ‘RST’ button, the blue indication will blink once, this means its ready
to bootload.
16
Once the ESP board is in bootload mode, upload the sketch via the IDE, Figure 3-2.
17
Figure 3.2: Uploading the sketch to ESP8266 NodeMCU module.
The sketch will start immediately - you'll see the LED blinking. Hooray!
3.7 Connecting via WiFi
OK once you've got the LED blinking, let’s go straight to the fun part, connecting to a
webserver. Create a new sketch with this code:
Don’t forget to update:
const char* ssid = "yourssid";
const char* password = "yourpassword";
to your WiFi access point and password, then upload the same way: get into bootload mode,
then upload code via IDE.
/*
* Simple HTTP get webclient test
*/
#include < ESP8266WiFi.h>
const char* ssid = "handson"; // key in your own SSID
const char* password = "abc1234"; // key in your own WiFi access point
18
const char* host = "www.handsontec.com";
void setup() {
Serial.begin(115200);
delay(100);
// We start by connecting to a WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
// Read all the lines of the reply from server and print them to Serial
while(client.available()){
String line = client.readStringUntil('\r');
Serial.print(line);
}
Serial.println();
Serial.println("closing connection");a
}
Open up the IDE serial console at 115200 baud to see the connection and webpage printout!
20
That's it, pretty easy right ! This section is just to get you started and test out your module.
21
CHAPTER 4
https://console.firebase.google.com/?pli=1
Figure
Click on Database now you will see the host name show in image
Copy that host name and past in Arduino code given below at line
#define FIREBASE_HOST "fir-app-example.firebaseio.com"
22
Step 3: Add Database Secrete Key to Arduino Sketch
Figure
Go to Setting>Project Setting>SERVICE ACCOUNTS>DATABASE Secretes.
Copy "Database Secrets" Shown in above image.
#include
#include
23
#define FIREBASE_HOST "fir-app-example.firebaseio.com"
#define FIREBASE_AUTH
"examplesd2asdasdasdasd2asd3asd2asd2as32das3d2as2da3"
#define LED 2
void setup() {
pinMode(LED,OUTPUT);
digitalWrite(LED,0);
Serial.begin(9600);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("connecting");
Serial.print(".");
delay(500);
Serial.println();
24
Serial.print("connected: ");
Serial.println(WiFi.localIP());
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.setInt("LEDStatus",0);
void loop() {
if(Firebase.getInt("LEDStatus"))
digitalWrite(LED,HIGH);
else
digitalWrite(LED,LOW);
Serial.println(Firebase.error());
25
return;
delay(1000);
}
Step 6: Restart ESP8266
After reseting ESP8266check serial terminal whether the ESP is get connected with your
router and got IP adress.
Goto https://console.firebase.google.com/project/fir-app-9adb8/database/data you can now
see the new variable created in database.
26
CHAPTER 5
ULTRASONIC SENSOR
INTRODUCTION
5.1 ULTRASONIC DEFINITION
The human ear can hear sound frequency around 20HZ ~ 20KHZ, and ultrasonic is
thesoundwave beyondthehuman ability of 20KHZ .
5.2 ULTRASONIC DISTANCE MEASUREMENT PRINCIPLE
Ultrasonic transmitter emitted an ultrasonic wave in one direction, and started timing when it
launched. Ultrasonic spread in the air, and would return immediately when it encountered
obstacles on the way. At last, the ultrasonic receiver would stop timing when it received the
reflected wave. As Ultrasonic spread velocity is 340m / s in the air, based on the timer record
t, we can calculate the distance (s) between the obstacle and transmitter, namely: s = 340t / 2,
which is so- called time difference distance measurement principle The principle of ultrasonic
distance measurement used the already-known air spreading velocity, measuring the time
from launch to reflection when it encountered obstacle, and then calculate the distance
between the transmitter and the obstacle according to the time and the velocity. Thus, the
principle of ultrasonic distance measurement is the same with radar. Distance Measurement
formula is expressed as: L = C X T In the formula, L is the measured distance, and C is the
ultrasonic spreading velocity in air, also, T represents time (T is half the time value from
transmitting to receiving ).
5.3 ULTRASONIC APPLICATION
Ultrasonic Application Technology is the thing which developed in recent decades. With the
ultrasonic advance, and the electronic technology development, especially as high-power
semiconductor device technology matures, the application of ultrasonic has become
increasingly widespread:
27
Ultrasonic machining, such as polishing, drilling;
Ultrasonic cleaning;
Ultrasonic welding;
Stable performance
Accurate distance measurement
High-density
Small blind
Robotics barrier
Object distance measurement
Level detection
Public security
Parking detection
28
5.7 Module pin definitions
Type Pin Symbol Pin Function Description
VCC 5V power supply
Trig Trigger pin
29
formular: test distance = (high level time * ultrasonic spreading velocity in air) / 2, you can
calculate the distance to the obstacle.
Note:You need to set the Freaduino UNO switch in 5V Side when use together with HC-
SR04 Module.
5.11 HCSR04 library function description
Long timing()
Function name: timing
Parameters: None
Return Value: the time of ultrasonic from the transmitter to the receiver
Float CalcDistance (long microsec,int metric)
Function name:CalcDistance
30
metric:Set the unit of the return value ( the value of 1 for cm, and the value of 0 for
in) Return Value: the measured distance
31