0% found this document useful (0 votes)
14 views

21report Final

Uploaded by

laptopuser197
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

21report Final

Uploaded by

laptopuser197
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

NRUPATHUNGA ROAD, BENGALURU KARNATAKA 560001

IOT BASED WATER LEVEL MONITORING


SYSTEM
A Project report submi ed in par al fulfilment
of the requirements for the degree of Bachelor of Science in Electronics

Submitted by

DEEPAK. N (U24AN21S0267)
MADHU. N (U24AN21S0851)
KAUSHIK. M (U24AN21S0281)
MARUTHI. US (U24AN21S0328)

From: III B.Sc. ECs


(Electronics & Computer Science)

Under the supervision of:

Mr. Thippe Rudra swami (TRS)


Assistant Professor
Department of Electronics
NRUPATHUNGA UNIVERSITY
]

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.

Thanks to the fellow members of our group for working as a team.

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.

(Thippe Rudra Swami)


Assistant Professor
Department of Electronics
NRUPATHUNGA UNIVERSITY
Counter signed by

(Dr J Ravi Kolarkar)


(External Examiner)
Head of the Department
Department of Electronics
NRUPATHUNGA UNIVERSITY
To

The Head of the Department


Department of Electronics
Nrupathunga University (NU)
KR Circle , Bengaluru 560001

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

3.3.1 HC-SR04 Ultrasonic Module Timing Diagram 24


3.3.2 Distance Calculation using HC-SR04 25
3.3.3 Interfacing the Ultrasonic Sensor The µC 25
3.4 Overview of the projects 26
3.5 Circuit Diagram 27

Chapter 4 (Hardware Modeling)


4.1 Main Features of the Prototype 30
4.2 Photographs of the prototype 30
4.3 Step by step operation of the prototype 31
4.4 Components Required 32
4.5 Hardware Interfacing 32
4.5.1 Relay Driver Interfacing with µC 32
4.5.2 HC-SR04 Interfacing with NodeMCU 33

Chapter 5 (Logic & Operation)


5.1 Introduction 36
5.2 Flow chart 36
5.3 Principle & operations 36
5.3.1 Advantages ofNodeMCU 37
5.3.2 Disadvantages of Node MCU 37
5.4 Blynk App 37
5.5 HC-SR04 Ultrasonic Sensors features 38
5.6 Cost estimation of the project 38
5.7 Photographs of the prototype 39
Chapter 6 (Conclusion & Future scope)
6.1 Conclusion 42
6.2 Results 42
6.3 Future works 42
List of Figures
SI. No. Figure numbers Page No.
1 Ultrasonic Working Principle 4
2 Ultrasonic Module Timing Diagram 4
3 NODE MCU Development board 19
4 NODE MCU with inbuilt Wi-Fi module 19
5 NODE MCU pin configuration 20
6 Snapshot of the installation process ofNODE MCU 21
7 Driver Installation for NODE MCU 21
8 Arduino IDE preferences 22
9 Arduino IDE board manager installation 22
10 ESP 8266 board installation in Arduino 23
11 Node MCU interfacing with Arduino 23
12 Ultrasonic Working Principle 24
13 Ultrasonic Module timing diagram 25
14 Interfacing HC SR 04 with Node MCU 26
15 Account creation and generation of unique ID in Blynk 26
16 Working process ofthe water level control device 27
17 Connection diagram of project 27
18 Blynk app user interface 28
19 Main Controller with relay & OLED display module 30
20 UNL2003A interfacing with µC 32
21 interface HC SR 04 with Node MCU 33
22 128X64 I2C based OLED module 34
23 Interfacing OLED with Node MCU 34
24 Flow chart of the Program 36
25 Blynk working Principle 38
26 Main Controller Board 39
27 The whole prototype 40
28 The Blynk app user Interface 40
ABSTRACT

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.

In this project a transmitter circuit consists of an ultrasonic sensor to


measure the water level in terms of distance. This data is sent to the
microcontroller is there to monitor the water level all time. The
controller is attached with a relay driver which further controls the
water pump. The controller decides when the pump should be ON and
OFF according the level of the water present in the overhead tank. It
simultaneously sends the data to the Blynk clouds using internet.
User can monitor the water level in a smart phone using Blynk app.
Chapter 6 concludes the work performed so far. The possible limitations in proceeding
research towards this work are discussed. The future work that can be done in improving the
current scenario is mentioned. The future potential along the lines of this work is also
discussed.

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.

Figure 3: ESP 32 Development board

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.

Figure 4: ESP 32 with inbuilt wi:fi module

3.2.1 Pin configuration of ESP32 development board


This module provides access to the GPIO (General Purpose Input/Output) subsystem.All access is
based on the I/0 index number on the NodeMCU dev kits, not the internal GPIO pin. For example,
the DO pin on the dev kit is mapped to the internal GPIO pin 16.
Please refer to the below GPIO pin maps for the index-gpio mapping.

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

3.2.2 Installation of ESP32 & Coding


Mostly these days devices download and install drivers on their own, automatically. Windows
doesn't know how to talk to the USB driver on the Node MCU so it can't figure out that the
board is a Node MCU and proceed normally.

20
l.J SB d evi ce: n o t reco g n i2e:d

The 1-ast U.S B device you cor.inec:ted to this computermalfunctioned.


and Windows does not rec 0gni ze- it.

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'(.

Figure 6: Snapshot of the installation process of ESP32

• 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

Figure 7: Driver Installation for ESP32

3.2.3 Interfacing of ESP32 with ardui � IDE


Firstly open the Arduino IDE. Go to files and click on the preference in the Arduino IDE

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

Additional B o ards Mana ger URLs :. Ihttp://arduino.esp8266.com/sbble/p ackage esP8266com_jndex.json

More preferences can b e edited dire ctly ln the, file


C:\Users\jayakum ar\;',ppDa ta \R-o amlng\Ardulno 1.5\preferences.txt
(edit onlv when ArdU1no is no trurm1ng)
� \ Cancel

Figure 8: Arduino IDE preferences

copy the below code in the Additional boards Manager


http://arduino.esp.com/stable/package esp32com index.json click
OK to close the preference Tab

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._

AP-ch:.i 1na- p u.mi1 ■n a-Ye or DI ac:tml>I ■


.n..r.,.11 ,r■r, ..... ..,. ....
Tc:t-Qr•.mt""'ar Atf Uci ■ " M.,.-.JA u M-� �
!'■l•1•""'•!' A Jl"dLUn,a ,......,. illl AO
.a-, rQ!u w,,a Lc::;on-air-cla

Ardlu fta C■p •


Ar"dLIH'la-M-4 I,

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

A ..al11,1Jnu> �a.b-£:".� ,,_..il:li'C.c1 I!'


Ard ... tn,a, O-..:aa1TT1■

Figure 9: Arduino IDE board manager installation

After completing the above steps , go to Tools and board, and then select board Manager

22
X

WC::

Int-cH686 D=,J,, by In:bcl


am. '" ru ed ,,. th ?ii� !l I

:I Ull:I.-Todi !lone!,; by AHil c:hn<;il<>gy


eoa1ds ln I uded ff1 lh g e:
S .,_rtf,,i rythlng Fox.

.... pa2.ii6 br E§PD2.66 Commu.□i� s·""'3ion 2.0,0 If-lSTA.U.:CO


-!fAi lnclu i<d I :hr-i; 51.ic 9111
Geenel'.i ESP<l266 r.lod'ul!!:, Olimei< OD·Wufl•l§!j,!'6126'6{• EV), N,:,cl.,MCU 0.9c (ESP• 2 �l!I>!), r{ CU 1.0 [ffi l.2e Modu!e},
P,B;! I 1�). S?�•l<,Fq11 l,;J g, s,...,.., · -1 (;S�:210, Y,,o.M= 01, WoMai. 01 .rn:lnl-

+---------------------------------------�

Figure 10: ESP32 board installation in Arduino

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

Figure 11: ESP32 interfacing with Arduino

3.3 Ultrasonic Module HC-SR04


The ultrasonic sersor works on the principle of SONAR and RADAR system which is used to
determine the distance to an object.
An ultrasonic sensor generates the high-frequency sound (ultrasound) waves. When this ultrasound
hits the object, it reflects as echo which is sensed by the receiver as shown in below figure 1.

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

3.4 Overview of the project


The following process describes how to create an account in Blynk and generate a unique ID
against a particular device. The ID is the identifier for the particular device in the Blynk server.

Download the E lynk app from pla) store


:: : ::::�
-- - - - - - - - - - - - - - - -----��i��:�:�;�:-· �
� .,�.·

------------------------::::::::;.
.;•;•;.

·',!• ... .. . .. ......,..�. �

An unique ID is generated by the aip under


new project for fach particular device

Figure 15: Account creation and generation of unique ID in Blynk server

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

In �ert the vertical level display and the Button in


thtdashboard with proper GPIO mentioned in the
coodin
Cretat and event to control the water level if it
reaches the limits and a control button to control
the um manuall

Figure 16: working process of the water level control device

3.5 Circuit Diagram

Fif ure 17: Connection diagram of the project

27
4.4 Components required

Table 2: Component listing

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

Figure 20: ULN2003A interfacing with microcontroller

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.

• Trigger pin is triggered by external controller to out burst an ultrasound wave.


• Echo pin notifies external controller when receiver receives back the bounced back wave.

Figure 21: Interfacing HC SR 04 witH ESP32

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.

• Network APT; ESP 32 has easily configurable networkAPI.


• Tnteuqted ITT.fl Module; ESP32 is incorporated in It 1s an easily accessible wifi
module.

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

5.4 Blynk app


Blynk was designed for the Internet of Things. It can control hardware remotely, it can display
sensor data, it can store data, visualize it and do many other things.
There are three major components in the platform:
• Blynk App - allows to you create amazing interfaces for your projects using various widgets
we provide.
• Blynk Server - responsible for all the communications between the smartphone and
hardware. You can use our Blynk Cloud or run your private Blynk server locally. It's open­
source, could easily handle thousands of devices and can even be launched on a Raspberry
Pi.
• Blynk Libraries - for all the popular hardware platforms - enable communication with the
server and process all the incoming and outgoing commands.
Now imagine: every time you press a Button in the Blynk app, the message travels to space the
Blynk Cloud, where it magically finds its way to your hardware. It works the same in the opposite
direction and everything happens in a blynk ofan eye.

37
Figure 25: Blynk working principle

5. HC SR04 Ultrasonic sensors features


• Input Voltage: 5V
• Current Draw: 20mA (Max)
• Digital Output: 5V
• Digital Output: 0V (Low)
• Working Temperature: -l5°C to 70°C
• Sensing Angle: 30° Cone
• Angle of Effect: 15° Cone
• Ultrasonic Frequency: 40kHz
• Range: 2cm - 400cm
• Dimensions
• Length: 43mm
• Width: 20mm
• Height (with transmitters): 15mm
• Centre screw hole distance: 40mm x 15mm
• Screw hole diameter: 1mm (Ml)
• Transmitter diameter: 8mm

38
39
Chanter&
1tltkn
41

You might also like