21report Final
21report Final
Submitted by
DEEPAK. N (U24AN21S0267)
MADHU. N (U24AN21S0851)
KAUSHIK. M (U24AN21S0281)
MARUTHI. US (U24AN21S0328)
ACKNOWLEDGEMENT
It is our great fortune that we have got opportunity to carry out this project work under
the supervision of Mr. Thippe Rudra Swami in the Department of Electronics ,
Nrupatunga University (NU), Nrupathunga Road, KR Circle, Bengaluru 560001. We
express our sincere thanks and deepest sense of gratitude to our guide for his constant
support, unparalleled guidance and limitless encouragement.
We would also like to convey our gratitude to all the faculty members and staffs of the
Department of Electronics , Nrupatunga University (NU),for their whole hearted
cooperation to make this work turn into reality.
We are very thankful to our Department and to the authority of NU for providing all
kinds of infrastructural facility towards the research work.
MADHU N (U24AN21S0851)
DEEPAK N (U24AN21S0267)
KAUSHIK M (U24AN21S0281)
MARUTHI U S (U24AN21S0328)
Department of Electronics
NRUPATHUNGA UNIVERSITY , BENGALURU -01
PHONE : 080-2221-2024
WebSite : https://nublr.karnataka.gov.in/en
CERTIFICATE
To whom it may concern
This is to certify that the project work entitled “IOT BASED WATER LEVEL
MONITORING SYSTEM “ is the bonafide work carried out by Madhu N
(U24AN21S0851) , Deepak N (U24AN21S0267) , KAUSHIK M (U24AN21S0281) ,
MARUTHI U S (U24AN21S0328), the students of B.Sc in the Department of
Electronics , Nrupathunga University (NU), Nrupathunga Road , KR circle ,
Bengaluru-560001 , during the academic year 2023- 24, in partial fulfillment of
the requirements for the degree of Bachelor of Science in Electronics and that
this project has not submitted previously for the award of any other degree,
diploma and fellowship.
Respected Sir,
In accordance with the requirements of the degree of Bachelor of Science in the Department of
Electronics, Nrupathunga University, We present the following thesis entitled “ IoT Based
Water Level Monitoring System”. This work was performed under the valuable guidance of Mr.
Thippe Rudra Swami, Assistant Professor in the Dept. of Electronics.
We declare that the thesis submitted is our own, expected as acknowledge in the test and reference
and has not been previously submitted for a degree in any other Institution.
Yours Sincerely,
MADHU N (U24AN21S0851)
DEEPAK N (U24AN21S0267)
KAUSHIK M (U24AN21S0281)
MARUTHI U S (U24AN21S0328)
3.1.5 IoT- Technology and Protocols 17
3.1.6 IoT common uses 18
3.2 NodeMCU 19
3.2.1 Pin Configuration ofNodeMCU Dev Board 19
3.2.2 Installation ofNode MCU and coding 20
3.2.3 Interfacing ofNodeMCU with Arduino IDE 21
3.3 Ultrasonic Module HC-SR04 23
Wireless Water Level Monitoring & Control Using Ultrasonic sensor &
ESP32 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 is further enhanced to control the
water level in the tank by turning the water pump ON, when the water
level is LOW, and turning the pump OFF when the water level is HIGH.
Thus, the ESP32 water level indicator& control helps in
preventing wastage of water in overhead tank. This project wirelessly
send the data to the user mobile using Blynk IoT app.It is easy to install,
cost effective and it can work from anywhere in the world.
8
3.2 ESP32
ESP32 is an open source IoT platform. It includes firmware which runson the
ESP32 from Espressif, and hardware which is based on the ESP12 module. by default
refers to the firmware rather than the dev kits. The firmware uses the Lua scripting
language. It is based on the eLua project, and built on the Espressif Non-OS SDK for ESP32 It uses
many open source projects, such as lua-cjson,and spiffs.
It was created shortly after theESP32 came out. On December 30, 2013,Espressiv system
beganproduction of the ESP8266. The ESP32 is a Wi-Fi Sc Cintegrated with a TensilicaXtensa
LXl 06 core,widely used in IoT applications
The ES P32 is a low-cost Wi-Fi microchip with full TCP/IP stack and microcontroller capability
produced by Shanghai-based Chinese manufacturer, Espressif Systems.
19
Table 1: ESP32 index-gpio mapping
ESP32
IOindex IOindex ESP32pin
6pin
0 [*] GPIO16 7 GPIO13
1 GPIO5 8 GPIO15
2 GPIO4 9 GPIO3
3 GPIO0 10 GPIO1
4 GPIO2 11 GPIO9
5 GPIO14 12 GPIO10
6 GPIO12
[*] D0(GPIO16) can only be used as GPIO read/write. No support for open-drain/interrupt/pwm/i2c
USER WAKE
FLASII
I sv POWE� I TXD1
Ei+l·ii·M
I I
GPIO ------ IISPI.C,LK
l<SPI.Q
UART
I HSPX/SPJ: I lilSPICS
KEY
I SYSTEM I TI(l)6
I RESEcRVED I
Figure 5: ESP 32 pin configuration
20
l.J SB d evi ce: n o t reco g n i2e:d
Reco·m mendation
TJY recomnec:ting t.he device. If l\i'indows s:lill does. not recognize fl, your
device may not be working IJ)'r0perl'(.
• Ii is a Amica is a ESP32 wifi Module based development board. It has got Micro USB
slot that can be directly connected to the computer or other USB host devices. It has got
15X2 Header pins and a Micro USB slot, the headers can be mounted on breadboard and
the micro USB slot is for connection to USB host device that may be a computer. It has
got CP2102 USB to serial converter.
• In order to install CP340 (USB to Serial Converter), user will need to download the
driver for the same.
• Once user downloaded drivers as per the proper operating system; the syste has got
connected with the ESP32
• From the device manager of the computer note down the COM port allocated to the
newly connected USB device i.e. the ESP32 Amcia. T his com port number will be
required while using ESP32 Amica.
CP340 Driver
21
Preferences X
Ske tchbo ok location:
�lc_ :\JJ_s
_ er _ s_ \j_
_ ay
_ a_ku_ma_ r_ \p_
_ oc um_ e_n_ _ _ d_u_n_ o_
_ __ ts \o.r , �I ----------------------------------� [ Browse
Edi tor.langua ge:· [system Defa ult
_ _____________ 3 {requiresrestart of .Arduino)
E ditor font size: �
Show verbose ,outputdurfng� D compilation D upload
Co mp li er warnings: l�one vI
D Di splay line numbers
0 Enable Code Folding
E2] Verify code after uplo a d
D Use external e ditor
E2] Check fur up da tes on startup
E2] U pda te ske tch files to new extensi on on save (,pde -> .ino)
0 Save when verifyng
i or uploading
re,
, ...... .1 ... .... !""!•111
l\u-lo I ol"rn t
a■ic r■r"C' �- ■=be:.,_
•a.i.a J.a-apif
pu. � A,_f,o.::1,:,J.sfilCI Uf._
AnCIU.t■" l='i..a
A,r-dlu 1n.a- D'T
L I ly,. al
■
..::.,_, dut •-.a V�tt
I llyP ..... tAl'a.•■.-IF�•i
After completing the above steps , go to Tools and board, and then select board Manager
22
X
WC::
+---------------------------------------�
Navigate to esp32 by esp32 community and install the software for Arduino.
Once all the above process had been completed we are ready to program our esp32 with Arduino
IDE.
(:)0
A �DUINIO
By measuring the time required for the echo to reach to the receiver, we can calculate the distance.
This is the basic working principle of Ultrasonic module to me �sure distance.
23
Figure 14: Interfacing HC SR 04 with ESP32
------------------------::::::::;.
.;•;•;.
Once the unique ID is generated the next step is to include that key in the coding which is
written in embedded C for communication between the NODE MCU and Blynk server. The
process is described below.
26
The NODE MCU should be connected through
wifi
27
4.4 Components required
SI.
Component Qtn
No.
1. HC SP 04 1
2. E SP 32 1
3. Static Relay (5 volt) 1
4. Water Pump 1
5. BC547 1
6. lk Resistor 1
7. 5mmLed 1
8. Relay terminals 3
9. Single strand wire 1
10. IC base ( 14 pin) 2m
11. Female PCB Header Connector 1
12. IC 7432 1
13. Latch Switch 1
1
5. Hardware connection
1. Relay Driver interfacing with microcontroller
I ·.· ..
I
©@
1
U1
RL1
12\1
Load OFF
The ULN2003A is a active high relay driver. 7 relays are controlled by this relay driver. Pin 1-7
are for controlling the relays which are connected to pin 10-16. For a 'O' from microcontroller
the corresponding relay is turned off and a '1' from microcontroller is turned on the relay.
32
4.5.2 HC SR 04 interfacing with NODE MCU
Hcsr04 ultrasonic sensor is composed of ultrasonic transmitter, ultrasonic receiver and a control
circuit. Hscr04 ultrasonic transmitter transmits ultrasound waves at 40,000 Hz. Transmitted
waves bounce back if they hit any flat surface/object in their path. Bounced back waves reach
the ultrasonic receiver. Ultrasonic receiver receives the bounced back waves and notifies the
control circuit about it. Control circuit than calculates the time taken by waves to reach back
after transmission. Time is than manipulated to approximate the distance travelled by waves or
what is the distance between the sensor and the object? from which ultrasound waves bounced
back.
Hcsr04 can measure distance between an active range of 2 cm to 4 meters. Hcsr04 requires 5
volts and 15 mA of power for operation. Hcsr04 has four pins. Two are power pins. Vee is +ve
pin apply 5v to this pin and Gnd is ground pin connect -ve of 5v power source with it. The
other two pins are Trigger and Echo.
33
34
1. Advantages of the ESP32
• Low cog; The Node MCU is less costlier than any other IOT b ased Devices.Because the
wifi module which is used in it is oflowest cost.
• Hardware Part; It has Arduino Like hardware I/O.It is becoming very popular in these days
that Arduino IDE has extended their software to work in the field of ESP 8266 Field module
versmn.
2. Disadvantages
• The operation of the circuit depends on the working internet connection. If the working
internet connection is not available then it will not run.
• It also depends on the free server provided by the third party, if the free server is not
working then it will not run.
• ESP 32 has less resourcesofofficial documentation
37
Figure 25: Blynk working principle
38
39
Chanter&
1tltkn
41