Professional Documents
Culture Documents
Tank Level Indication System REPORT
Tank Level Indication System REPORT
Indication
System
Vikas Complex Co-op Hsg Society
ACKNOWLEDGEMENT
We would like to thank the managing committee of Vikas Complex for allowing
us to implement this project in their premises. We would also express
gratitude towards our professors who helped us and solved our doubts in this
project.
Last but not the least, we would like to thank the DIY research community and
open source movement for the unstinted support by developing the modules
used in this project
TABLE OF CONTENTS
ACKNOWLEDGEMENT
BUILDING SPECIFICATION
ULTRASONIC TECHNOLOGY
MICROCONTROLLER:
10
Arduino
10
ESP8266
12
14
WIRELESS ROUTER
16
LCD MODULE
18
PROJECT MODULARITY
19
20
APPENDIX
21
21
23
25
29
30
BIBLIOGRAPHY
33
ABSTRACT
The main objectives satisfied by this project are:
To monitor and measure quantitatively the water content in overhead
tank placed on the terrace reducing wastage during periods of water
shortage as observed in recent years
To monitor the level of liquid, which is stored in a huge tank periodically,
and to indicate the empty level and overflow level with alarms
As the water might corrode electronic circuits, it is very difficult to
maintain the commonly used conduction/capacitance based systems,
which have direct contact with the liquid.
The main salient features of using ultrasonic sensor with wireless
transmission using wifi are:
Able to measure level without physical contact
No moving parts, so easy inspection and low maintenance cost.
Reliability of reading unaffected by changes in the composition or
density of water
Small and light, installation is easy
Precise to 1cm of water column
BUILDING SPECIFICATION
ULTRASONIC TECHNOLOGY
The human ear can hear sound frequency around 20HZ ~ 20KHZ, and ultrasonic
is the sound wave beyond the human ability of 20KHZ . 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 socalled 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 ).
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:
Ultrasonic measurement of distance, depth and thickness; Ultrasonic testing;
Ultrasound imaging; Ultrasonic machining, such as polishing, drilling;
Ultrasonic cleaning; Ultrasonic welding
Microcontroller:
Arduino
An Arduino board historically consists of an Atmel 8-, 16- or 32-bit
AVR microcontroller (although since 2015 other makers' microcontrollers have
been used) with complementary components that facilitate programming and
incorporation into other circuits. An important aspect of the Arduino is its
standard connectors, which let users connect the CPU board to a variety of
interchangeable add-on modules termed shields. Some shields communicate
with the Arduino board directly over various pins, but many shields are
individually addressable via an IC serial busso many shields can be stacked
and used in parallel. Before 2015, Official Arduinos had used the
Atmel megaAVR series of chips, specifically
the ATmega8, ATmega168, ATmega328, ATmega1280, and ATmega2560. In
2015, units by other producers were added. A handful of other processors
have also been used by Arduino compatible devices. Most boards include a 5
V linear regulator and a 16 MHz crystal oscillator (or ceramic resonator in some
variants), although some designs such as the LilyPad run at 8 MHz and
dispense with the onboard voltage regulator due to specific form-factor
restrictions. An Arduino's microcontroller is also pre-programmed with a boot
loader that simplifies uploading of programs to the on-chip flash memory,
compared with other devices that typically need an external programmer. This
makes using an Arduino more straightforward by allowing the use of an
ordinary computer as the programmer. Currently, optiboot bootloader is the
default bootloader installed on Arduino UNO.
At a conceptual level, when using the Arduino integrated development
environment, all boards are programmed over a serial connection. Its
implementation varies with the hardware version. Some serial Arduino boards
contain a level shifter circuit to convert between RS-232logic levels
and transistortransistor logic (TTL) level signals. Current Arduino boards are
programmed via Universal Serial Bus (USB), implemented using USB-to-serial
adapter chips such as the FTDI FT232. Some boards, such as later-model Uno
boards, substitute the FTDI chip with a separate AVR chip containing USB-to-
10
serial firmware, which is reprogrammable via its own ICSP header. Other
variants, such as the Arduino Mini and the unofficial Boarduino, use a
detachable USB-to-serial adapter board or cable,Bluetooth or other methods,
when used with traditional microcontroller tools instead of the Arduino IDE,
standard AVR in-system programming (ISP) programming is used. The Arduino
board exposes most of the microcontroller's I/O pins for use by other circuits.
The Diecimila, Duemilanove, and current Uno provide 14 digital I/O pins, six of
which can produce pulse-width modulated signals, and six analog inputs, which
can also be used as six digital I/O pins. These pins are on the top of the board,
via female 0.1-inch (2.54 mm) headers. Several plug-in application shields are
also commercially available. The Arduino Nano, and Arduino-compatible Bare
Bones Board and Boarduino boards may provide male header pins on the
underside of the board that can plug into solderless breadboards.
Many Arduino-compatible and Arduino-derived boards exist. Some are
functionally equivalent to an Arduino and can be used interchangeably. Many
enhance the basic Arduino by adding output drivers, often for use in schoollevel education, to simplify making buggies and small robots. Others are
electrically equivalent but change the form factor, sometimes retaining
compatibility with shields, sometimes not. Some variants use different
processors, of varying compatibility. Arduino Wifi Shields are costly. So we
interfaced arduino with ESP8266 wifi module.
11
ESP8266
ESP8266, in its default configuration, boots up into the serial modem mode. In
this mode you can communicate with it using a set of AT commands.
Features of ESP8266
Deep sleep power <10uA, Power down leakage current < 5uA
12
13
14
15
Wireless Router
A wireless router is a device that performs the functions of a router and also
includes the functions of a wireless access point. It is used to provide access to
the Internet or a private computer network. It can function in a wired LAN
(local area network), in a wireless-only LAN (WLAN), or in a mixed
wired/wireless network, depending on the manufacturer and model.
Features[edit]
Most current wireless routers have the following characteristics:
So far the PHY-Chips for the WNICs are generally distinct chips on
the PCB. Dependent on the mode the WNIC supports, i.e. 1T1R,
2T2R or 3T3R, one WNIC have up to 3 PHY-Chips connected to it.
Each PHY-Chip is connected to a Hirose U.FL-connector on the
PCB. A so-called pigtail cable connects the Hirose U.FL either to
a RF connector, in which case the antenna can be changed or
directly to the antenna, in which case it is integrated into the
casing. Common are single-band (i.e. only for 2.4 GHz or only for
5 GHz) and dual-band (i.e. for 2.4 and 5 GHz) antennas.
16
Some dual-band wireless routers operate the 2.4 GHz and 5 GHz bands
simultaneously.
Some high end dual-band wireless routers have data transfer rates of at
most 300 Mbit/s (For 2.4 GHz band) and 450 Mbit/s (For 5 GHz band).
17
LCD Module
A liquid crystal display is a special thin flat panel that can let light go through
it, or can block the light. (Unlike an LED it does not produce its own light). The
panel is made up of several blocks, and each block can be in any shape. Each
block is filled with liquid crystals that can be made clear or solid, by changing
the electric current to that block. Liquid crystal displays are often
abbreviated LCDs.
Liquid crystal displays are often used in battery-powered devices, such as
digital watches, because they use very little electricity. They are also used for
flat screen TV's. Many LCDs work well by themselves when there is other light
around (like in a lit room, or outside in daylight). For smartphones, computer
monitor, TV's and some other purposes, a back-light is built into the product.
18
PROJECT MODULARITY
Sensor and Transmitter module: Signal is measured and transmitted
with the help of an ultrasonic sensor coupled with an Arduino
Microcontroller connected to ESP8266 wifi module.
Wireless Communication Module: Signal is wirelessly transmitted with
the help of Wifi router.
Receiver LCD Display Module: With the assistance of microcontroller,
the data is displayed on the LCD screen in terms of level of water in tank.
19
20
APPENDIX
CODE TO INTERFACE ARDUINO AND ESP8266
1. #include <SoftwareSerial.h>
2.
3. SoftwareSerial esp8266(2,3); // make RX Arduino line is pin 2, make TX
Arduino line is pin 3.
4.
5.
6. void setup()
7. {
8. Serial.begin(9600);
9. esp8266.begin(9600); // your esp's baud rate might be different
10.}
11.
12.void loop()
13.{
14. if(esp8266.available()) // check if the esp is sending a message
15. {
16. while(esp8266.available())
17. {
18.
// The esp has data so display its output to the serial window
19.
21
20.
Serial.write(c);
21. }
22. }
23.
24.
25.
26. if(Serial.available())
27. {
28. // the following delay is required because otherwise the arduino will
read the first letter of the command but not the rest
29. // In other words without the delay if you use AT+RST, for example,
the Arduino will read the letter A send it, then read the rest and send it
30. // but we want to send everything at the same time.
31. delay(1000);
32.
33. String command="";
34.
35. while(Serial.available()) // read the command character by character
36. {
37.
38.
39. }
40. esp8266.println(command); // send the read character to the esp8266
41. }
22
42.}
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
void setup(void){
23
Serial.begin(115200);
Serial.println();
Serial.println("Booting Sketch...");
WiFi.mode(WIFI_AP_STA);
WiFi.begin(ssid, password);
while(WiFi.waitForConnectResult() != WL_CONNECTED){
WiFi.begin(ssid, password);
Serial.println("WiFi failed, retrying.");
}
MDNS.begin(host);
24
void loop(void){
httpServer.handleClient();
}
#include <ESP8266WiFi.h>
= "your-ssid";
void setup() {
Serial.begin(115200);
25
delay(10);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
int value = 0;
26
void loop() {
delay(5000);
++value;
Serial.print("connecting to ");
Serial.println(host);
27
// 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();
28
Serial.println("closing connection");}
29
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);}
This sketch prints "Hello World!" to the LCD and uses the
display() and noDisplay() functions to turn on and off
the display.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
30
http://www.arduino.cc/en/Tutorial/LiquidCrystalDisplay
*/
31
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// Turn off the display:
lcd.noDisplay();
delay(500);
// Turn on the display:
lcd.display();
delay(500);
}
32
BIBLIOGRAPHY
ESP8266 Datasheet
www.arduino.cc
www.wikipedia.org
HC-SR04 Datasheet
LCD Module datasheet
www.esp8266-arduino.com
www.github.com
www.stackoverflow.com/electronics
www.instructables.com
33