Project Document
Project Document
(AUTONOMOUS)
A Capstone Project Report on
Master of Technology
IN
CERTIFICATE
This is to certify that the Full Semester Project report entitled “WSN FOR WATER
PARAMETERS MONITORING USING SENSORS” is the bonafide work done by the
student A. SANDEEP KUMAR REDDY (23G21D5501), in partial fulfillment of the
requirements for the award of the degree of Master of Technology in Embedded system
in Electronics and Communication Engineering, from Jawaharlal Nehru Technological
University Anantapur, Anantapuramu, during the year 2024-2025.
ASCET, GUDUR - TIRUPATI(DT).
Project Guide
Dr. P. Janardhan Sai Kumar, Head of the Department
M.Tech, Ph.D., Prof. J. Amarendra, M.Tech, (Ph.D.,)
Professor, Associate Professor,
Department of ECE, Department of ECE,
ASCET, GUDUR - TIRUPATI(DT).
DECLARATION
I, A. SANDEEP KUMAR REDDY, hereby declare that the Project Work entitled –
WSN FOR WATER PARAMETERS MONITORING USING SENSORS done by us under
the esteemed Guidance of Dr. P. JANARDHAN SAI KUMAR, M. Tech, Ph.D., Professor,
Dept. Of ECE. The Full Semester Project report is submitted in partial fulfillment of the requirements
for the award of the master’s degree in Electronics and Communication Engineering.
Date:
Place:
We express our deepest gratitude to Dr. VANKI PENCHALAIAH, M.A., M.L., Ph.D.,,
Chairman of AUDISANKARA COLLEGE OF ENGINEERING AND TECHNOLOGY,
for providing us with an excellent academic environment and unwavering support throughout
our Project.
We extend our heartfelt thanks to Smt. VANKI ANUSHA, Vice Chairperson, for her
encouragement and continuous motivation, which have been instrumental in our academic
journey.
Our sincere gratitude goes to Prof. J. AMARENDRA, Associate Professor - ECE, Head of
the Department, ECE, for valuable insights, motivation, and support, which greatly
contributed to the successful completion of our Project.
We are thankful to Dr. A. IMMANUEL, Institute Project Coordinator, for his expert guidance
and coordination, which played a key role in shaping our Project.
We also extend our appreciation to Dr. P. JANARDHAN SAI KUMAR, M.Tech, Ph.D.,
Department Project Guide, for providing valuable feedback and ensuring the smooth progress
of our Project.
We express our gratitude to our department faculty for their constant encouragement, technical
guidance, and mentorship throughout this journey.
Our special thanks to the non-teaching faculty for their assistance and support in various
aspects of our Project work.
We would like to extend our heartfelt appreciation to our parents and friends, whose
encouragement, patience, and moral support have been our driving force in completing this
capstone Project successfully.
Finally, we acknowledge the collaborative efforts of our team members, whose dedication and
hard work made this Project possible.
1
conditions all play a role in floods. Prior to this, the majority of the
2
systems that have been developed only concentrated on a few areas. In addition, because
they lack information and data on the weather, the bulk of the population is unable to track
and is unaware of when a flood will occur. All the issues with the current system will be
resolved by using the IoT monitoring system. This is appropriate for urban and rural
locations. Additionally, if a member of the public has internet access, they can keep track of
events and foresee the possibility of a web server flood. Its design is affordable and upkeep
is simple. By doing so, the web server's water level will be updated and the system will
inform the public to evacuate so that quick, required action may be done. New low power
wide area network (LPWAN) methods are being used as part of the plans of Internet of
Things (IoT) systems, which has been a set of circumstances that is constantly evolving, for
monitoring systems and to prevent future risks with smaller and less unaffordable
structures. To provide the possibility to interface various types of sensors without
significantly altering the proposed node architecture's hardware, the entire system is created
from a modular perspective. The data is stored in a sensor and microcontroller equipped
device that is linked to LoRa wireless module for data transmission, after then it is analysed
as well as saved via a web application framework where the flood alert feature is
implemented. However, the system cannot solve flooding issues on its own. Public
institutions must operate in tandem with civil society, volunteers, organized volunteer work
organizations and community organisations. In order to decrease the danger of fatalities,
property damage and environmental degradation, this paper can provide information to the
relevant emergency services along with authorities.
One of the most frequent and dangerous natural disasters is flooding. A better response to
flood threats is required given the growing number of flood related deaths as well as
financial losses seen every year around the world. It's interesting that in the past ten years,
there have been numerous academic endeavors looking at how camera footage and wireless
sensor data from IoT networks could improve flood management. The presented work
sheds light on the potential for creating an alarm system to reduce the risk of flooding. It is
able to estimate how quickly the flood will occur by sending the user an alarm message
along with the timing and pace of the water rise. Additionally, it has undergone testing in a
controlled setting to gauge performance.
3
CHAPTER 2
LITERATURE SURVEY
As in [1], a novel architecture for the transceiver is proposed in order to increase the service
range of IEEE 802.11ah, which is necessary for the long-range IoT communication of
emergency messages in emergency situations. Experimental results show that the presented
architecture is suitable for the long-range IoT communication of emergency alert messages.
As in [2], a wireless sensor network system could remotely monitor the real time data of
water condition in the identified areas. To monitor the water conditions such as water level,
flow and precipitation level, a wireless sensor network system is developed.
As in [3], GRAB, designed for robust data delivery in face of unreliable nodes and failable
wireless link. GRAB forwards data along a band of interleaved mesh.
As in [4], in Wireless Sensor Networks (WSN) the user requirements are often desired to be
evolvable, whether driven by changes of the monitored parameters or WSN properties of
configuration, structure, communication capacities, node density and energy among many
others.
As in [5], the Functionality is supported by the reflective and component-based Grid Kit
middleware, which provides support for both WSN and Grid application domains.
As in [6], a distributed system is proposed using water level monitoring sensors named
Shonabondhu. The sensing nodes are distributed all across the country and the servers that
collect data from sensors are spread around various regions. The servers use a function of
rainfall and current water level that indicate a particular gradient to that sensor.
As in [9], the various remote sensing technologies used for the detection, monitoring, and
assessment of oil spills, emphasizing the crucial role these technologies play in effectively
managing oil spill incidents.
5
CHAPTER 3
EXISTING SYSTEM
An IoT early flood detection and alert system using the Arduino is thus a proposed solution
to this problem. The system consists of various sensors which are temperature, humidity,
water level, flow and ultrasonic sensors and also includes an Arduino controller, a GSM
Module, an LCD, an IoT remote server-based platform and an android application with
constructed user-friendly GUI relaying all the vital information involved in the picture in a
visual format. This model set up the GSM board near the dam and DHT sensor and
ultrasonic sensor, float sensors are connected to it. DHT sensor gives the Humidity and
Temperature in the air and Ultrasonic sensor gives the water level. Based on this and some
other parameters we may decide if the flood is going to occur or not. We connect them to
the cloud from where we connect this to the mobile application and we can see the output
in our application too.
Pollutants detected in water are increasingly leveraging the Internet of Things (IoT) to
enhance accuracy and efficiency. IoT-enabled sensors are deployed in various water
sources, continuously monitoring water quality in real-time. These sensors detect a range of
pollutants, such as heavy metals, chemicals, and microbial contaminants, by measuring
parameters like pH, turbidity, and conductivity. Data collected by these sensors is
transmitted wirelessly to cloud-based platforms, where it is analysed using advanced
algorithms.
This real-time data allows for immediate detection of pollution events, enabling swift
responses to contamination. Additionally, IoT systems facilitate remote monitoring of water
bodies, reducing the need for manual sampling and laboratory analysis. Smart sensors can
be integrated with automated treatment systems, which adjust processes based on detected
pollution levels, ensuring optimal water quality. IoT networks also provide valuable data
for long-term environmental monitoring and research, helping to identify pollution sources
and trends over time. water quality monitoring becomes more efficient, accurate, and
proactive, significantly improving the management of water resources and public health
protection.
6
CHAPTER 4
PROPOSED SYSTEM
⮚ Solar Panels and Batteries: These provide power to the remote station, ensuring it
ambient temperature and humidity. The sensor outputs a digital signal, making it
easy to interface with microcontrollers like the NodeMCU ESP8266.
7
⮚ Ultrasonic Sensor: Used for measuring the water level or detecting the presence of
an object.
from the sensors and sends the data to another NodeMCU present in the monitoring
station.
8
4.3 COMMUNICATION USING IOT
The data processed by the NODEMCU at the remote station is sent to the monitoring
station via IoT communication protocols. NodeMCU devices are used to enable real-time
data transfer for water quality monitoring via IoT. NodeMCU, equipped with sensors,
collects data and publishes it to an MQTT broker over a Wi-Fi network. Another
NodeMCU subscribes to the broker, receiving and processing the sensor data. This setup
ensures continuous, wireless monitoring of water pollutants, enhancing the efficiency and
accuracy of environmental management.
the data. The NodeMCU in monitoring station processes the received date and
transfer the data to 16*2 LCD displays.
⮚ I2C Module: Interfaces with other components for data display and alerts. I2C is a
⮚ 16*2 LCD: A 16*2 LCD modules consist of 16 characters per line and 2 lines.
⮚ Buzzer: Acts as an alarm system, which can be triggered if the pollutant levels
9
CHAPTER 5
HARDWARE DESCRIPTION
ESP8266EX offers a complete and self-contained Wi-Fi networking solution; it can be used
to host the application or to offload Wi-Fi networking functions from another application
processor. When ESP8266EX hosts the application, it boots up directly from an external
flash. ESP8266EX is among the most integrated Wi-Fi chip in the industry; it integrates the
antenna switches, RF balun, power amplifier, low noise receive amplifier, filters, power
management modules, it requires minimal external circuitry, and the entire solution,
including front-end module, is designed to occupy minimal PCB area.
10
Figure 5.1: NodeMCU (ESP8266-12E)
11
The ESP8266 has seen a wide adoption as a cost-effective solution for IOT and Wi-Fi-
capable devices. The ESP8266 was developed by Shangai-based Espressif systems, as a
Serial (UART) to Wi-Fi SoC (System on a Chip) based around a Tensilica Xtensa
LX3DPU. This tiny IC includes an RF front end, RAM, and (usually) an onboard TCP/IP
stack that allows it to connect to a nearby Access Point, to act as an Access Point itself, or
both.
Quickly after launch, a variety of breakout boards for the ESP8266 started becoming
available. The most popular ones have been the ESP-NN series, which typically integrate
the SOC along with Flash RAM, a crystal, and even an onboard antenna. The most salient
distinction between different ESP-NN models are the pins that are broken out from the
ESP8266
As the ESP8266 was developed as a Serial to Wi-Fi adapter, its firmware implemented an
interpreter for AT commands. Thus initial usage of the IC was limited to using either a
USB to Serial adapter, or a separate microcontroller (e.g., ATmega328) to issue AT
commands over the ESP8266's Serial UART interface. For this reason, the ESP-01 board
quickly became popular amongst the ESP8266 community because of its 2×4, 0.1in-pitch
connector that can be easily wired to a USB to Serial adapter.
The connector gave access to the pins used for serial communication, namely RX and TX,
as well as 4 control pins, GPIO0, GPIO2, CH_PD and RST (reset), along with VCC and
GND.
However, other ESP-NN boards offer access to a wider variety of pins, although their
packaging is of a custom Surface-Mount Device, with castellated pins as seen in the
documentation page linked above. From the different ESP-NN boards, we began to
experiment with the ESP-12E. The main reason is that this module was the one chosen by
the developers of the Node MCU Project for their hardware Dev Kit 1.0. Because the
ESP8266 provides a cost-effective solution to the rapidly growing market of internet-
connected Projects and devices (i.e., the so-called Internet of Things), it has become one of
the most popular development platforms over the past year and a half. In consequence,
12
A dedicated community has formed around the platform which has been focused on
improving its functionality.
For starters, different firmware options have been ported to run on the ESP8266, effectively
taking it from a simple Serial to Wi-Fi adapter into a fully functional microcontroller with
access to its GPIO and hardware-based functions like PWM, I2C, 1-Wire communication,
and ADC; all this, of course, in addition to maintaining its Wi- Fi capabilities.
5.1.2 Features
● 802.11 b/g/n
● Support Smart Link Function for both Android and IOS devices
● SDIO 2.0, (H) SPI, UART, I2C, I2S, IRDA, PWM, GPIO
● A-MPDU & A-MSDU aggregation and 0.4s guard interval Shenzhen Anxinke
Technology
13
∙ +20dBm output power in 802.11b mode
5.1.3 Applications
● Home automation
14
● Mesh network
● Baby monitors
● IP Cameras
● Sensor networks
● HVAC control
● Smart lighting
● Security ID tags
DHT11 digital temperature and humidity sensor is a calibrated digital signal output of the
temperature and humidity combined sensor. It uses a dedicated digital module capture
technology and the temperature and humidity sensor technology to ensure products with
high reliability and excellent long-term stability. Sensor includes a resistive element and a
sense of wet NTC temperature measurement devices and with a high-performance 8-bit
microcontroller connected.
16
Figure 5.2: DHT11 Temperature and Humidity Sensor
MODEL DHT11
Power supply 3-5.5V DC
Output signal digital signal via single-bus
Sensing element Polymer resistor
17
5.2.2 Dimensions: (unit mm)
5.2.3 Applications
● HVAC
● Dehumidifiers
● Consumer Goods
● Data Loggers
● Weather Stations
● Home Appliances
● Humidity Regulator
● Medical and
18
The proposed scope of work may result in up to 3% RH temporary drift of the signal.
Return to normal working conditions, the sensor calibration status will slowly recover. To
speed up the recovery process can be found in "recovery process." The use of the product
will accelerate the aging process for a long time under abnormal operating conditions.
Avoid placing components on a long-term condensation and dry conditions and the
following environments.
19
A. Smoke Acid or oxidizing gases such as sulfur dioxide, hydrochloric acid
Recommended
B. Storage Environment Temperature:10~40℃ Humidity:60% RH or less
5.2.5 Effects of exposure to chemical substances
Sensing a resistive humidity sensor will be disturbed chemical vapor layer, the diffusion
layer in the induction of chemicals may cause drift and measurement sensitivity. In a clean
environment, slowly release contaminants out. The recovery process described below to
accelerate the process. High concentrations of chemical pollution can cause damage to the
sensor sensing layer completely.
Placed under extreme operating conditions or chemical vapor sensors, through the
following process, you can return it to the state calibration. 45 ℃ and humidity under 70%
RH conditions were maintained for more than 5 hours. The calibration coefficients are
stored as programs in the OTP memory, which is the sensor's internal signal detecting
process.
Manual welding, at a temperature of 300 ℃ maximum contact time must be less than 10
seconds. The sensor communicates using a one wire protocol and provides data in a 40-bit
format. Its pinout includes VCC(Power supply), DATA(Digital output), NC(Not
20
Connected) and GND(Ground).
21
5.3 ULTRASONIC SENSOR
The ultrasonic sensor is a transducer which converts electrical energy into sound waves and
vice versa. These sound waves fall above the normal range of human hearing and hence it
is known as ultrasonic waves. These types of waves are above the frequency of about
18000 Hz.
An ultrasonic sensor transmits ultrasonic waves into the air and detects reflected waves
from an object. There are many applications for ultrasonic sensors, such as in intrusion
alarm systems, automatic door openers and backup sensors for automobiles. Accompanied
by the rapid development of information processing technology, new fields of application,
such as factory automation equipment and car electronics, are increasing and should
continue to do so.
Ultrasonic sensors are wonderful creatures. Blind from the eyes and yet a vision so precise
that could distinguish between a moth and a broken leaf even when flying at full speed. No
doubt the vision is sharper than ours and is much beyond human capabilities of seeing, but
is certainly not beyond our understanding. Ultrasonic ranging is the technique used by bats
and many other creatures of the animal kingdom for navigational purposes. In a bid to
imitate the ways of nature to obtain an edge over everything, we humans have not only
understood it but have successfully imitated some of these manifestations and harnessed
their potential to the greatest extent.
When ultrasonic waves are incident on an object, diffused reflection of the energy takes
place over a wide solid angle which might be as high as 180 degrees. Thus some fraction of
the incident energy is reflected back to the transducer in the form of echoes and is detected.
The distance to the object (L) can then be calculated through the speed of ultrasonic waves
(v) in the medium by the relation.
The frequency range of the human hearing sound is from 16Hz to 19KHz. The
conventional power ultrasound is from 20KHz to 100KHz and the extended range of the
sonochemistry is from 20KHz to 2MHz and the diagnostic ultrasound is from 5MHz to
10MHz.
Where ‘t’ is the time taken by the wave to reach back to the sensor and the angle between
the horizontal and the path taken as shown in the figure. If the object is in motion,
instruments based on Doppler shift are used.
23
Figure 5.6: Ultrasound reaches Object
5.3.1 Features of Ultrasonic Sensor
● High sensitivity
● High reliability
24
Figure 5.7: Ultrasonic Distance Sensor
The ultrasonic distance sensors measure distance using sonar; an ultrasonic (well above
human hearing) beat is transmitted from the unit and distance-to-target is determined by
measuring the time required for the echo return. Output from the ultrasonic sensor is a
variable-width beat that compares to the distance to the target.
25
As this sensor is used for distance measurement it is known as distance sensor.
• Piezoelectric crystals are used in the ultrasonic sensor construction due to the fact that
these crystals oscillate at a higher range of frequencies.
27
5.3.7 Ultrasonic transducer for water level detection
28
In the above circuit diagram the contactless liquid level controller in this diagram ultrasonic
sensor module is interfaced with the microcontroller. Whenever level distance measured in
cm falls down below a set point the pump starts by sensing the signal coming out and
receiving level coming to the ultrasonic transducer which is fed to the microcontroller.
When the microcontroller receives the signal from the ultrasonic transducer it activates the
relay through a MOSFET that operates the pump ON or OFF.
5.3.9 Features
5.3.10 Specifications
● Power supply: 5V DC
● Resolution: 0.3 cm
30
5.4 DS18B20 TEMPERATURE SENSOR
The DS18B20 Digital Thermometer provides 9 to 12-bit (configurable) temperature
readings which indicate the temperature of the device. Information is sent to/from the
DS18B20 over a 1-Wire interface, so that only one wire (and ground) needs to be
connected from a central microprocessor to a DS18B20. Power for reading, writing, and
performing temperature conversions can be derived from the data line itself with no need
for an external power source. Because each DS18B20 contains a unique silicon serial
number, multiple DS18B20s can exist on the same 1-Wire bus. This allows for placing
temperature sensors in many different places. Applications where this feature is useful
include HVAC environmental controls, sensing temperatures inside buildings, equipment
or machinery, and process monitoring and control.
The DS18B20 provides a digital temperature reading, eliminating the need for an analog to
digital converter (ADC). It offers an accuracy of ±0.5°C over a range of -10°C to +85°C,
making it reliable for most temperature measurement applications. It can measure
temperatures from -55°C to +125°C, suitable for a variety of environments. The DS18B20
is robust and suitable for harsh environments, especially when enclosed in a waterproof
31
casing.
32
5.4.1 Pin Assignment
GND - Ground
DQ - Data In/Out
No connect
33
5.4.2 DS18B20 Block Diagram
The block diagram of Figure shows the major components of the DS18B20. The DS18B20
has four main data components: 1) 64-bit layered ROM, 2) temperature sensor,
3) non-volatile temperature alarm triggers TH and TL, and 4) a configuration register. The
device derives its power from the 1-Wire communication line by storing energy on an
internal capacitor during periods of time when the signal line is high and continues to
operate off this power source during the low times of the 1-Wire line until it returns high to
replenish the parasite (capacitor) supply.
As an alternative, the DS18B20 may also be powered from an external 3 volt - volt supply.
Communication to the DS18B20 is via a 1-Wire port. With the 1-Wire port, the memory and
control functions will not be available before the ROM function protocol has been established.
The master must first provide one of five ROM function commands: 1) Read ROM, 2) Match
ROM, 3) Search ROM, 4) Skip ROM, or 5) Alarm Search.
These commands operate on the 64-bit layered ROM portion of each device and can single
out a specific device if many are present on the 1-Wire line as well as indicate to the bus
master how many and what types of devices are present. After a ROM function
34
sequence has been successfully executed, the memory and control functions are accessible
and the master may then provide any one of the six memory and control function
commands.
The scratchpad also contains a configuration byte to set the desired resolution of the
temperature to digital conversion. Writing TH, TL, and the configuration byte is done using
a memory function command. Read access to these registers is through the scratchpad. All
data is read and written at least a significant bit first.
● Unique 1-Wire® Interface Requires Only One Port Pin for Communication ƒ
● Each Device has a Unique 64-Bit Serial Code Stored in an On-Board ROM
● Can Be Powered from Data Line; Power Supply Range is 3.0V to 5.5V ƒ
● Available in 8-Pin SO (150 mils), 8-Pin μSOP, and 3-Pin TO-92 Packages ƒ
36
5.4.4 Applications
● Thermostatic Controls
● Industrial Systems
● Consumer Products
● Thermometers
The two wires, or lines are called Serial Clock (or SCL) and Serial Data (or SDA). The
SCL line is the clock signal which synchronizes the data transfer between the devices on
the I2C bus and it’s generated by the master device. The other line is the SDA line which
carries the data.
The two lines are “open-drain” which means that pull up resistors need to be attached to
them so that the lines are high because the devices on the I2C bus are active low.
Commonly used values for the resistors are from 2K for higher speeds at about 400 kbps, to
10K for lower speed at about 100 kbps.
37
Figure 5.16: Two wires Communication
38
5.6 LCD (LIQUID CRYSTAL DISPLAY)
A liquid crystal display or LCD draws its definition from its name itself. It is a combination
of two states of matter, the solid and the liquid. LCD uses a liquid crystal to produce a
visible image. Liquid crystal displays are super-thin technology display screens that are
generally used in laptop computer screens, TVs, cell phones and portable video games.
LCD’s technologies allow displays to be much thinner when compared to cathode ray tube
(CRT) technology.
Liquid crystal display is composed of several layers which include two polarized panel
filters and electrodes. LCD technology is used for displaying the image in notebook or
some other electronic devices like mini computers. Light is Projected from a lens on a layer
of liquid crystal. This combination of colored light with the grayscale image of the crystal
(formed as electric current flows through the crystal) forms the colored image. This image
is then displayed on the screen.
An LCD is either made up of an active matrix display grid or a passive display grid. Most
of the Smartphone’s with LCD display technology uses active matrix display, but some of
the older displays still make use of the passive display grid designs. Most of the electronic
devices mainly depend on liquid crystal display technology for their display. The liquid has
a unique advantage of having low power consumption than the LED or cathode ray tube.
39
Liquid crystal display screens work on the principle of blocking light rather than emitting
light. LCD’s require backlight as they do not emit light by them. We always use devices
which are made up of LCD’s displays which are replacing the use of cathode ray tubes.
Cathode ray tubes draw more power compared to LCD’s and are also heavier and bigger.
LCD (Liquid Crystal Display) screen is an electronic display module and finds a wide
range of applications. A 16x2 LCD display is a very basic module and is very commonly
used in various devices and circuits. These modules are preferred over seven segments and
other multi segment LEDs. The reasons being: LCDs are economical; easily programmable;
have no limitation of displaying special & even custom characters (unlike in seven
segments), animations and so on.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this
LCD each character is displayed in a 5x7 pixel matrix. This LCD has two registers, namely,
Command and Data. The command register stores the command instructions given to the
LCD. A command is an instruction given to LCD to do a predefined task like initializing it,
clearing its screen, setting the cursor position, controlling display etc. The data register
stores the data to be displayed on the LCD. The data is the ASCII value of the character to
be displayed on the LCD.
Probably this very post should have come before the number of other posts related to 8051
LCD interfacing, but it's never too late. This post will describe the pins of LCD normally
available in the market. It looks almost like the one shown below. As you guys can see,
there are 8 data pins along with 3 control pins. One ground and two power pins are also
there. Let's study about these pins of LCD.
41
Table 5.3: LCD Pin Description
P
Function Name
i
n
N
o
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable VEE
resistor
4 Selects command register when low; and data Regist
register when high er
Select
5 Low to write to the register; High to read from the Read/write
register
6 Sends data to data pins when a high to low pulse is Enable
given
7 DB0
8 DB1
9 DB2
10 8-bit data pins DB3
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-
● LCD’s are consist of some microwatts for display in comparison to some milli watts for
LED’s
● LCD’s are thinner and lighter when compared to cathode ray tube and LED
42
5.6.3 Disadvantages of an LCD
● Low reliability
43
5.6.4 Applications of Liquid Crystal Display
Liquid crystal technology has major applications in the field of science and engineering as
well on electronic devices.
● Optical imaging
● The liquid crystal display technique is also applicable in visualization of the radio
frequency waves in the waveguide
5.7 RF TRANSCEIVERS
Generally, an RF module is a small size electronic device that is used to transmit or receive
radio signals between two devices. The main application of the RF module is an embedded
system to communicate with another device wirelessly. This communication may be
accomplished through radio frequency communication. For various applications the
medium of choice is radio frequency since it does not need line of sight. The applications of
RF modules mainly involve low volume and medium volume products for consumer
applications like wireless alarm systems, garage door openers, smart sensor applications,
wireless home automation systems and industrial remote controls. This article discusses the
block diagram of the RF transceiver module and its applications.
44
applies to wireless communication devices like cellular telephones, handheld two- way
radios, cordless telephone sets, and mobile two-way radios. Sometimes the term is used in
reference to the transmitter or receiver devices in optical fibre systems or cables.
45
Figure 5.21: RF Transceiver Module
In general, the designer of wireless systems has two overriding limitations: it must work
over a convinced distance and transfer a convinced amount of information within a data
rate. The size of the RF modules is very small and have an extensive range of an operating
voltage that is 3V to 12V.
Basically, these modules are 433 MHz RF TX and RX modules. The transmitter (TX)
draws no power when transferring logic zero while fully destroying the carrier frequency,
thus consuming considerable low power in battery operation. When logic1 is sent the
carrier is fully on to about 4.5mA with a 3V power supply. The information is sent
46
serially from the transmitter (TX) which is received by the receiver. Transmitter (TX) and
the receiver (RX) are duly interfaced to two Microcontrollers for transferring the data.
RF modules can be applied for various types, sizes and shapes of electronic circuit boards.
It can also be useful for modules across a vast variety of capacity and functionality. These
modules typically include a PCB, TX circuit or RX circuit, antenna and serial interface for
communication to the main processor. The types of RF modules mainly include RF
transmitter module, RF receiver module, RF transceiver module and SOC module. There
are 3-types of signal modulation techniques commonly used in RF transmitter and receiver
modules such as ASK-amplitude shift keying, OOK-On-Off Keying and FSK-frequency
shift keying. An RF transceiver module includes both a transmitter and receiver. The circuit
of RF transceiver modules is typically designed for half-duplex operation and although full-
duplex modules are available, typically at a higher cost due to the added complexity.
5.7.2 RF Transmitter
An RF transmitter module is a small size PCB capable of transferring a radio wave and
modulating radio waves to carry data. RF transmitter modules are usually applied along
with a microcontroller, which will offer data to the module which can be transmitted.
5.7.3 RF Receiver
An RF receiver module takes the modulated RF signal to demodulate it. There are two
kinds of RF receiver modules, namely the super-regenerative receivers and super -
47
heterodyne receivers. Usually, super-regenerative modules are low power designs and low cost
using a series of amplifiers to remove modulated data from a carrier wave. These modules vary,
generally inaccurate as their operation of frequency significantly with power supply voltage and
temperature. The main advantage of Super heterodyne receiver modules is a high performance
over super-regenerative. They offer increased stability and accuracy over a large temperature and
voltage range. This stability comes from a stable crystal design which in turn leads to a relatively
more expensive product.
5.7.4.1 RF Transmitter
Pin
Function Name
No
1 Ground (0V) Ground
2 Serial data input pin Data
3 Supply voltage; 5V Vcc
4 Antenna output pin ANT
48
5.7.4.2 RF Receiver
Pin
Function Name
No
1 Ground (0V) Ground
2 Serial data output pin Data
3 Linear output pin; not connected NC
4 Supply voltage; 5V Vcc
5 Supply voltage; 5V Vcc
6 Ground (0V) Ground
7 Ground (0V) Ground
8 Antenna input pin ANT
RF transceiver module is used in a particular device where both the transmitter and receiver
are housed in a single module. Such devices transmit and receive RF signals, so that is
named as RF Transceiver. Mostly the position of RF Transceiver module is in between
Power amplifier/Low Noise Amplifier and Baseband MODEM in any wireless
communication system. Baseband Modem houses chip sets of several analog or digital
modulation techniques and analog to digital conversion or digital to analog conversion
chips.
5.7.5 Applications of RF Transceiver
● The main intention of this device is to alter IF frequency to RF frequency and vice
versa.
49
ITE networks.
50
5.8 BUZZER
A buzzer is an electromechanical device that produces a buzzing or beeping sound. It's
commonly used in various electronic devices, appliances, and systems to provide audible
alerts or notifications. The basic principle behind a buzzer is the conversion of electrical
energy into mechanical energy, which creates sound vibrations.
5.8.1 Electromechanical
The electric buzzer was invented in 1831 by Joseph Henry. They were mainly used in early
doorbells until they were phased out in the early 1930s in favour of musical chimes, which
had a softer tone.
The buzzer contains a coil of wire wrapped around a magnetic core. When an electric
current flows through this coil, it generates a magnetic field around the core, turning it into
an electromagnet. The contact is usually a small metal disc or strip that is attracted to the
electromagnet when current flows through the coil. When the contact is pulled towards the
electromagnet, it creates tension in the diaphragm, causing it to bend or vibrate.
51
5.8.2 Piezoelectric
Piezoelectric buzzers, or piezo buzzers, as they are sometimes called, were invented by
Japanese manufacturers and fitted into a wide array of products during the 1970s to 1980s.
This advancement mainly came about because of cooperative efforts by Japanese
manufacturing companies. In 1951, they established the Barium Titanate Application
Research Committee, which allowed the companies to be "competitively cooperative" and
bring about several piezoelectric innovations and inventions. These buzzers utilize the
piezoelectric effect, where certain materials generate an electric charge when subjected to
mechanical stress. When an electric current is applied to a piezoelectric element, it vibrates
and produces sound waves. Piezoelectric buzzers are known for their compact size and high
efficiency.
5.8.3 Mechanical
A joy buzzer is an example of a purely mechanical buzzer and they require drivers. Other
examples of them are doorbells. These buzzers typically consist of an electromagnet, a
vibrating diaphragm, and a contact. When an electric current passes through the coil of the
electromagnet, it generates a magnetic field that attracts the contact, causing the diaphragm
to vibrate and produce sound. Attached to the armature is a flexible diaphragm, often made
of metal or plastic. When the armature moves towards the electromagnet, it pushes or pulls
the diaphragm, causing it to vibrate.
5.8.4 Applications
● Security Systems
● Medical Equipment
● Industrial Machinery
● Home Appliances
52
● Educational Tools
● Consumer Electronics
53
CHAPTER 6
SOFTWARE DESCRIPTION
6.1 ARDUINO IDE
Over the years Arduino has been the brain of thousands of Projects, from everyday objects
to complex scientific instruments. A worldwide community of makers - students, hobbyists,
artists, programmers, and professionals - has gathered around this open-source platform,
their contributions have added up to an incredible amount of accessible knowledge that can
be of great help to novices and experts alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast
prototyping, aimed at students without a background in electronics and programming. As
soon as it reached a wider community, the Arduino board started changing to adapt to new
needs and challenges, differentiating its offer from simple 8-bit boards to products for IoT
applications, wearable, 3D printing, and embedded environments. All Arduino boards are
completely open-source, empowering users to build them independently and growing
through the contributions of users worldwide.
6.1.1 Hardware Specifications
● Microcontroller: ATmega328
● Operating Voltage: 5V
54
● Input Voltage (limits): 6- 20V
55
● Analog Input Pins: 6 • DC Current per I/O Pin: 40 mA
● SRAM: 2 KB (ATmega328)
● EEPROM: 1 KB (ATmega328)
Arduino boards also support various communication protocols, including UART, I2C, and
SPI, enabling them to interact with other microcontrollers, computers, and peripherals. This
capability is crucial for creating sophisticated Projects that require data exchange, such as
56
IoT applications where the board might send sensor data to a cloud server or receive
commands from a smartphone app.
57
Here is a list of different Arduino boards available.
58
Arduin 5V 16MH 14 6 6 1 FTDI
o Pro z Compatible
5V/16 Header
MH
z
59
Ardui 3.3V 8MHz 14 8 6 1 FTDI
no Compatibl
Fio e Header
main
board
LilyP 3.3V 8MHz 9 4 5 0 FTDI
ad Compatibl
Ardui e Header
no
simpl
y
board
60
6.1.3 Arduino Board Description
We will learn about the different components on the Arduino board. We will study the
Arduino UNO board because it is the most popular board in the Arduino board family. In
addition, it is the best board to get started with electronics and coding. Some boards look a
bit different from the one given below, but most Arduino’s have the majority of these
components in common.
● Power USB
An Arduino board can be powered by using the USB cable from your computer. All you
need to do is connect the USB cable to the USB connection (1).
61
● Power (Barrel Jack)
Arduino boards can be powered directly from the AC mains power supply by connecting it
to the Barrel Jack (2).
● Voltage Regulator
The function of the voltage regulator is to control the voltage given to the Arduino board
and stabilize the DC voltages used by the processor and other elements.
● Crystal Oscillator
The crystal oscillator helps Arduino in dealing with time issues. How does Arduino
calculate time? The answer is, by using the crystal oscillator. The number printed on top of
the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000 Hertz or 16
MHz
You can reset your Arduino board, i.e., start your program from the beginning. You can
reset the UNO board in two ways. First, by using the reset button (17) on the board.
Second, you can connect an external reset button to the Arduino pin labeled RESET (5).
● Most of the components used with Arduino boards work fine with 3.3 volt and 5 volt.
● GND (8)(Ground): There are several GND pins on the Arduino, any of which can
● Vin (9): This pin also can be used to power the Arduino board from an external
The Arduino UNO board has five analog input pins A0 through A5. These pins can read the
signal from an analog sensor like the humidity sensor or temperature sensor and convert it
into a digital value that can be read by the microprocessor.
Each Arduino board has its own microcontroller (11). You can assume it as the brain of
your board. The main IC (integrated circuit) on the Arduino is slightly different from board
to board. The microcontrollers are usually of the ATMEL Company. You must know what
IC your board has before loading up a new program from the Arduino IDE. This
information is available on the top of the IC. For more details about the IC construction and
functions, you can refer to the data sheet.
Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino consisting of
MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred to as an SPI (Serial
Peripheral Interface), which could be considered as an "expansion" of the output. Actually,
you are slaving the output device to the master of the SPI bus.
This LED should light up when you plug your Arduino into a power source to indicate that
your board is powered up correctly. If this light does not turn on, then there is something
wrong with the connection.
On your board, you will find two labels: TX (transmit) and RX (receive). They appear in
two places on the Arduino UNO board. First, at the digital pins 0 and 1, to indicate the pins
responsible for serial communication. Second, the TX and RX led (13). The TX led flashes
with different speeds while sending the serial data. The speed of flashing depends on the
baud rate used by the board. RX flashes during the receiving process.
63
15. Digital I / O
The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM (Pulse
Width Modulation) output. These pins can be configured to work as input digital pins to
read logic values (0 or 1) or as digital output pins to drive different modules like LEDs,
relays, etc. The pins labelled “~” can be used to generate PWM.
16. AREF
AREF stands for Analog Reference. It is sometimes used to set an external reference
voltage (between 0 and 5 Volts) as the upper limit for the analog input pins.
After learning about the main parts of the Arduino UNO board, we are ready to learn how
to set up the Arduino IDE. Once we learn this, we will be ready to upload our program on
the Arduino board. In this section, we will learn in easy steps how to set up the Arduino
IDE on our computer and prepare the board to receive the program via USB cable.
6.2.1 Step 1
First you must have your Arduino board (you can choose your favourite board) and a USB
cable. In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega 2560, or
Decimals, you will need a standard USB cable (A plug to B plug), the kind you would
connect to a USB printer as shown in the following image.
64
Figure 6.2: USB Cable
65
6.2.2 Step 2: Download Arduino IDE Software.
You can get different versions of Arduino IDE from the Download page on the Arduino
Official website. You must select your software, which is compatible with your operating
system (Windows, IOS, or Linux). After your file download is complete, unzip the file.
The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw power from
either the USB connection to the computer or an external power supply. If you are using an
Arduino Diecimila, you have to make sure that the board is configured to draw power from
the USB connection. The power source is selected with a jumper, a small piece of plastic
that fits onto two of the three pins between the USB and power jacks. Check that it is on the
two pins closest to the USB port. Connect the Arduino board to your computer using the
USB cable. The green power LED (labelled PWR) should glow.
66
6.2.4 Step 4: Launch Arduino IDE
After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the
folder, you can find the application icon with an infinity label (application.exe). Double-
click the icon to start the IDE.
67
● Open an existing Project example.
68
Figure 6.5: Open First Project
To open an existing Project example, select File -> Example -> Basics -> Blink.
69
Here, we are selecting just one of the examples with the name Blink. It turns the LED on
and off with some time delay. You can select any other example from the list.
70
6.2.6 Step 6: Select your Arduino board.
To avoid any error while uploading your program to the board, you must select the correct
Arduino board name, which matches with the board connected to your computer. Go to
Tools -> Board and select your board
Here, we have selected the Arduino Uno board according to our tutorial, but you must
71
select the name matching the board that you are using.
72
6.2.7 Step 7: Select your serial port.
Select the serial device of the Arduino board. Go to Tools -> Serial Port menu. This is
likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial
ports). To find out, you can disconnect your Arduino board and re-open the menu, the entry
that disappears should be of the Arduino board. Reconnect the board and select that serial
port.
73
6.2.8 Step 8: Upload the program to your board.
Before explaining how we can upload our program to the board, we must demonstrate the
function of each symbol appearing in the Arduino IDE toolbar.
Now, simply click the "Upload" button in the environment. Wait a few seconds; you will
see the RX and TX LEDs on the board, flashing. If the upload is successful, the message
"Done uploading" will appear in the status bar.
74
CHAPTER 7
BLYNK APP
7.1 BLYNK
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 cool things.
Blynk is a platform with iOS and Android apps to control Arduino, Raspberry Pi and the
likes over the Internet. It's a digital dashboard where you can build a graphic interface for
your Project by simply dragging and dropping widgets. It's really simple to set everything
up and you'll start tinkering in less than 5 mins. Blynk is not tied to some specific board or
shield. Instead, it's supporting hardware of your choice. Whether your Arduino or
Raspberry Pi is linked to the Internet over Wi-Fi, Ethernet or this new ESP8266 chip,
Blynk will get you online and ready for the Internet Of Your Things.
75
There are three major components in the platform:
● Blynk App - allows you to 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. Its
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 out coming commands.
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 cool things.
Now imagine: every time you press a Button in the Blynk app, the message travels to
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 of an eye.
76
Figure 7.2: Working of Blynk App
77
7.2 FEATURES
Similar API & UI for all supported hardware & devices Connection to the cloud using:
● Wifi
● Ethernet
● USB (Serial)
● GSM
79
CHAPTER 8
SOURCE CODE
8.1 TRANSMITTING SECTION CODE
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
float temp;
float Fahrenheit=0;
#define sensor_pin A0 //turbidity int
read_ADC;
int ntu;
80
SimpleTimer timer_2;
81
#define DHTPIN 5 // D1 to dht-11 sensor
// Uncomment whatever type you're using!
#define DHTTYPE DHT11 // DHT 11
//#define DHTTYPE DHT22 // DHT 22, AM2302, AM2321
//#define DHTTYPE DHT21 // DHT 21, AM2301
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!"); return;
}
Blynk.run();
Blynk.virtualWrite(V6, t);
Blynk.virtualWrite(V7, h);
}
void gettempData()
{
DS18B20.requestTemperatures();
temp = DS18B20.getTempCByIndex(0); // Celcius Fahrenheit =
DS18B20.toFahrenheit(temp); // Fahrenheit Serial.println(temp);
Serial.println(Fahrenheit);
82
Blynk.run();
Blynk.virtualWrite(V5,temp);
}
int count;
int modes=1;
count=0;
}
}
void setup()
{
Blynk.begin(auth, ssid, pass);
dht.begin();
DS18B20.begin();
Serial.begin(115200);
timer_2.setInterval(1000L, getSendData);
pinMode(sensor_pin, INPUT);
pinMode(D3,OUTPUT); //TRIGGER
pinMode(D5,INPUT); //ECHO
pinMode(D6,OUTPUT); //rf tx water
pinMode(D7,OUTPUT); //rf tx turbidity
pinMode(D8,OUTPUT); //buzzer
83
digitalWrite(D6,HIGH);
84
digitalWrite(D7,HIGH);
}
void loop()
{
timer_2.run();
switch(modes)
{
case 1: read_ADC = analogRead(sensor_pin);
float time, distance,level;
digitalWrite(D3,LOW);
delayMicroseconds(2);
digitalWrite(D3,HIGH);
delayMicroseconds(10);
digitalWrite(D3,LOW);
delayMicroseconds(2);
digitalWrite(D3,HIGH);
delayMicroseconds(10);
time=pulseIn(D5,HIGH);
distance=time*340/20000;
if(read_ADC>208)read_ADC=208; ntu =
map(read_ADC, 0, 208, 300, 0);
Blynk.run();
Blynk.virtualWrite(V3,distance);
Blynk.virtualWrite(V4,ntu); if(ntu>=70 )
{
digitalWrite(D6,LOW);
digitalWrite(D8,HIGH);
}
else if (distance<5)
break;
85
digitalWrite(D7,LOW); digitalWrite(D8,HIGH);
}
else
{
digitalWrite(D6,HIGH);
digitalWrite(D7,HIGH);
digitalWrite(D8,LOW);
}
case 2:
sendSensor();
Blynk.run(); modes++;
break;
case 3:
gettempData();
modes=1;
break;
}
}
86
8.2 RECEIVING SECTION CODE
#include<LiquidCrystal.h> #include
<LiquidCrystal_I2C.h>
LiquidCrystal_I2C Lcd(0x27,16,2);
#include <Wire.h>
void setup()
{
Serial.begin(115200);
pinMode (D5,INPUT); //RF RX 1
pinMode (D6,INPUT); //RF RX 2
pinMode (D7,OUTPUT); //BUZZER
Lcd.begin(); Lcd.setCursor(0,0);
Lcd.print(" WELCOME TO ");
Lcd.setCursor(0,1);
Lcd.print(" WSN FOR WATER ");
delay(3000);
digitalWrite(D7,HIGH);
delay(700);
digitalWrite(D7,LOW);
delay(700);
digitalWrite(D7,HIGH);
delay(700);
digitalWrite(D7,LOW);
delay(700);
digitalWrite(D7,HIGH);
delay(700);
digitalWrite(D7,LOW);
delay(700);
}
void loop() {
87
int S,V; S=digitalRead(D5);
V=digitalRead(D6); if(S==0)
{
digitalWrite(D7,HIGH);
Lcd.setCursor(0,0);
Lcd.print(" * RIVER WATER *");
Lcd.setCursor(0,1); Lcd.print("LEVEL
INCREASING");
delay(300);
}
else if(V==0)
{
digitalWrite(D7,HIGH);
Lcd.setCursor(0,0);
Lcd.print(" * RIVER WATER *");
Lcd.setCursor(0,1);
Lcd.print(" HAS HIGH DUST ");
delay(300);
}
else
{
digitalWrite(D7,LOW);
Lcd.setCursor(0,0);
Lcd.print(" WSN FOR WATER ");
Lcd.setCursor(0,1); Lcd.print("LEVEL
MONITORING");
delay(300);
}
Lcd.clear();
}
88
CHAPTER – 9
RESULTS AND DISCUSSION
The pollutant detection in aquatic environments using IOT the quality of water
continuously monitoring using IoT devices like Node MCU. In this system, varieties of
sensors are used to detect current physical conditions, and send the data to a microcontroller
(Node MCU ESP8266). This system makes use of a Water quality monitoring sensor, Node
MCU ESP8266, Temperature sensor, PH sensor, Turbidity sensors,16*2 LCD Display, Fast
alerts and Buzzer. This system has two stations, they are Remote station and Monitoring
station. In Remote station, the Node MCU ESP8266, Ph sensor, Turbidity sensor,
Ultrasonic sensor, RF Transmitter, Solar panel and Battery are integrated. These sensors are
used and send the status of those sensors to Node MCU. Then, the data will be processed by
Node MCU and transferred to the Monitoring station through Internet of things (IOT). The
Monitoring station consist of Node MCU ESP8266, RF Receiver, 16*2 LCD Display and
Buzzer. The Node MCU in the Monitoring station is similar to the remote station, it
receives and processes the data. The 16*2 LCD Displays the real-time data received from
the remote station. The buzzer acts as an alarm, which can be triggered if the pollutant
levels exceed predefined safe thresholds.
89
Figure 9.1: Overall view of the Project
90
Figure 9.2: Remote Station or Transmitting Section
91
Figure 9.3: Monitoring Station or Receiving Section
92
Here, the Blynk is used to display sensor data such as Water Level, Water Turbidity, Water
Temperature, Atmosphere Temperature and Atmosphere Humidity.
When we provide power supply for both the Transmitting section and Receiving section then
16*2 LCD displays as shown in the below figures.
93
Figure 9.5: 16*2 LCD Display
94
When the floods occur then the flow of water increases. so that, the level of water increases
then the distance between the water and ultrasonic sensors decreases. Then the Node MCU
in the Remote station send the data the Node MCU in the Monitoring station and 16*2 LCD
displays that “RIVER WATER LEVEL INCREASING”.
96
Figure 9.9: High Turbidity Alert Message
97
Here, the water temperature and atmospheric temperature are measured. The third gauge
displays a water temperature and the fourth gauge displays the atmospheric temperature.
When the pH meter is placed in the water, it measures the pH value of the water and displays it.
The future scope of pollutant detection in aquatic environments using IoT (Internet of
Things) holds great promise for environmental monitoring and sustainability. Here are
some key aspects:
The vast amounts of data collected by IoT sensors can be analyzed using advanced data
analytics and machine learning algorithms. This can help in:
100
3. Improved Decision-Making and Policy Development
IoT can facilitate the development of integrated water management systems that
optimize the use and conservation of water resources. These systems can include
smart irrigation, automated water treatment plants, and efficient wastewater
management, all driven by real-time data.
• [2] Z. Asif, Z. Chen, C. An, and J. Dong, ‘‘Environmental impacts and challenges
associated with oil spills on shorelines,’’ J. Mar. Sci. Eng., vol. 10, no. 6, p. 762, May
2022.
• [3] A.-L. Balogun, S. T. Yekeen, B. Pradhan, and K. B. W. Yusof, ‘‘Oil spill trajectory
modelling and environmental vulnerability mapping using GNOME model and GIS,’’
Environ. Pollut., vol. 268, Jan. 2021, Art. no. 115812.
• [13] A. Géron, Hands on Machine Learning With Scikit Learn Keras and TensorFlow,
2nd ed. O’Reilly Media, 2019.
• [14] L. Haulin, ‘‘A state-based method to model and analyze the power consumption of
embedded systems,’’ Tech. Rep., 2018.
103