0% found this document useful (0 votes)
27 views25 pages

IOT Mini BODY

The document discusses the development of an IoT-based water level monitoring system. It aims to enable real-time monitoring of water levels in various locations to provide accurate data for water resource management and decision making. Key objectives include implementing an early warning system for floods/droughts and providing remote access to water level data through web/mobile applications.

Uploaded by

Vinod G Gowda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views25 pages

IOT Mini BODY

The document discusses the development of an IoT-based water level monitoring system. It aims to enable real-time monitoring of water levels in various locations to provide accurate data for water resource management and decision making. Key objectives include implementing an early warning system for floods/droughts and providing remote access to water level data through web/mobile applications.

Uploaded by

Vinod G Gowda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Water Level Monitoring System Page|1

CHAPTER 1
INTRODUCTION
1.1 Project Overview:
Due to exploitation of water resources and speeding of climate change due to human
activities, water becoming a luxury these days and keeping tab on water consumption is a
necessity now. We know that water conservation starts from a family and a person in a family
can easily track their water consumption either by observing day to day activities or checking
water level of their overhead tank every day. But for a municipal government who is
concerned about the areas they governing cannot track each and every family’s water
consumption by physically sending a person every day. Instead, they can check level of
municipal supply tanks where the level of water is direct reflection of water consumed by the
people in the area. Again, we have to deploy several people to take readings of tens of
municipal overhead tanks several times a day.
It is a human nature to get inert sometimes or many times and one could manipulate the
readings and could push the idea of water consumption of an area in wrong direction and this
could also delay the water supply because the actual water level could vary significantly from
the manipulated readings which could lead to unexpected shutdown of water supply. By
installing IoT based water level monitoring systems in all the important municipal water tanks
the local government can know the level of water in real time and they can fill the tank on
time and also can understand the consumption of water in the area. The collected data can be
sent to higher level governments where they can draw national level conclusions on water
consumption. IoT based water level monitoring system can also be installed on individual
houses / apartments so that one can check water level of their tank in real time from their own
comfort and also track their consumption overtime. Now you know why we are sending tank’s
water level data over internet.

1.2 Problem Description:


Imagine the usefulness of being able to switch on the air conditioner system ten
minutes before you get home on a hot afternoon. How about security system to detect smoke,
burglary attempts alerted to you. These imaginations build the idea of Water Level Monitoring
that has no end. The sophisticated Water Level Monitoring systems of course record the usage
of water. Technology nowadays has become an integrated part of people's lives. It has, and
continues to influence many aspects of daily life and has allowed better social interaction,
ease of transportation, the ability to indulge in entertainment and media and has helped in the
development in medicine. The creation of many devices such as mobile phones and computers
have caused many people to rely on technology to communicate with their friends, store
information such as pictures, movies, documents, and music. The internet has become a
common interface that many devices use in order to simplify the daily life of many people
giving the ability to search for information, store their own information in the cloud while
also giving them better ways of managing information. From the time of its introduction, the
number of people that use mobile phones and the internet to communicate with other people
has increased dramatically to become one of the major means of communication.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|2

People with the help of smartphones can now connect to the internet without He need for a
computer, while still offering the same functionality but through different means. With the
introduction of advanced software and hardware devices, smartphones are now powerful
devices and have become an important part of people’s daily lives. A major aspect is how the
Smartphone is able to connect and communicate with other devices.
A field that is recently gaining popularity is Water Level Monitoring which can also use
smartphones as information or functionality hubs.

1.3 Objectives:
The major objectives of the project include:
The main aim of this system is to monitor the water level at rural areas so that they help in
detecting the wastage of water and measures can be taken to avoid unnecessary overflowing
of water in the areas where monitoring is a difficult task.
1. Real-time Monitoring: Enable real-time monitoring of water levels in various locations
such as reservoirs, rivers, lakes, and dams.
2. Accuracy: Ensure accurate measurement of water levels to provide reliable data for
decision-making and resource management.
3. Early Warning System: Implement an early warning system to alert authorities and
stakeholders about potential floods or droughts based on the monitored water levels.
4. Remote Access: Provide remote access to the monitoring system, allowing users to
view water level data from anywhere using web or mobile applications.
5. Data Logging: Log historical water level data for analysis, trend identification, and
predictive modelling to better understand water patterns and behaviours over time.
6. Integration: Integrate with existing infrastructure and systems such as weather stations,
hydrological models, and emergency response systems to enhance overall
effectiveness and interoperability.
7. Scalability: Design the system to be scalable, allowing for the addition of more
monitoring points and sensors as needed to cover larger geographical areas or
expanding water management needs.
8. Power Efficiency: Implement power-efficient designs for sensors and communication
modules to prolong battery life and minimize maintenance requirements, especially in
remote or inaccessible locations.
9. Security: Ensure data security and integrity by employing encryption protocols, access
controls, and authentication mechanisms to prevent unauthorized access or tampering
of the system.
10. Cost-effectiveness: Strive to develop a cost-effective solution that maximizes the value
proposition by balancing performance, reliability, and affordability, considering the
budget constraints of stakeholders involved in water management.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|3

CHAPTER 2
LITERATURE SURVEY
2.1 Existing System:
AquaHive is an IoT-based water level monitoring system tailored for agricultural use,
employing wireless sensors in reservoirs to remotely monitor water levels and optimize
irrigation scheduling via a mobile or web application.
SmartRiver is a comprehensive IoT solution designed for monitoring river water levels
and flow rates, utilizing a network of sensors along riverbanks to continuously measure water
levels and transmit real-time data for flood prediction and water resource management.
HydroSentinel is an IoT-enabled water level monitoring system tailored for urban
drainage systems, employing ultrasonic sensors in stormwater drains to monitor water levels
during rainfall events and transmit data to a cloud platform for flood risk analysis and
infrastructure optimization.
AquaWatch is an IoT-based water level monitoring solution designed for coastal
areas, utilizing buoy-mounted sensors to measure water levels, wave heights, and tidal
fluctuations in real time, providing data for maritime planning, coastal management, and
weather monitoring.

2.2 Proposed System:


The proposed system aims to enable real-time monitoring of water levels in various bodies of
water such as reservoirs, rivers, and lakes, providing up-to-date information for decision-
making and resource management. With a focus on accuracy, the system seeks to ensure
precise measurement of water levels, ensuring reliability in data for informed decision-making
and effective water resource management strategies. Implementing an early warning system
is a key objective, intending to alert authorities and stakeholders about potential floods or
droughts based on monitored water levels, facilitating timely response and mitigation efforts.

2.3 Application:
Our project can be implemented in various fields they are:
1. Agriculture:
The proposed system can be utilized in agriculture to monitor water levels in irrigation
reservoirs and tanks, enabling farmers to optimize water usage, schedule irrigation, and
prevent overwatering or water shortages, ultimately improving crop yield and resource
efficiency.
2. Environmental Management:
Environmental agencies can utilize the system to monitor water levels in rivers, lakes, and
wetlands, facilitating better understanding of aquatic ecosystems, identifying habitat changes,
and supporting conservation efforts to protect biodiversity and natural resources.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|4

3. Urban Infrastructure:
Municipalities can employ the system for monitoring water levels in stormwater drains,
sewage systems, and reservoirs, aiding in flood prediction, urban drainage management, and
infrastructure planning to mitigate flood risks and enhance urban resilience to extreme
weather events.
4. Disaster Preparedness:
Emergency management agencies can utilize the system for early flood detection and
monitoring in vulnerable areas, enabling timely evacuation planning, deployment of
resources, and disaster response coordination to minimize human and property losses during
flood events.
5. Water Resource Management:
Water resource management agencies can employ the system for monitoring water levels in
reservoirs, aquifers, and groundwater wells, facilitating efficient water allocation, drought
management, and water conservation initiatives to sustainably manage water resources and
meet growing demands.

2.4 Tools and Technologies Used:


When we decide to make any water level indicator project the first thing that comes to our
mind is the electrodes that are we are going immerse in the water. Traditionally several
metallic electrodes are immersed in the water at different levels and some voltage is passed.
The problem with this method in a long run is that, no matter how the electrodes were refined
before installing, it will get corroded due to electrochemical reaction due to passing of electric
current through water which reacts with some minerals present in the water and it is a bad
idea to consume such contaminated water.
The resolution of the reading is limited to how many electrodes immersed in the water. The
ultrasonic based measurement overcomes all the disadvantages that arise due to utilizing
traditional electrode method. The accuracy of readings is +/- 3mm and can be used to tanks
that are up to 4 meter deep.

Fig 2.4.1: Water level indicator demo

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|5

NodeMCU ESP32 Board:


The NodeMCU ESP32 board is a compact and versatile development platform based
on the ESP32 microcontroller. It integrates Wi-Fi and Bluetooth connectivity, making it
suitable for IoT (Internet of Things) projects.

Fig 2.4.2 NodeMCU ESP32


The board features a dual-core processor, offering increased processing power and
efficiency for demanding applications. NodeMCU ESP32 supports a wide range of sensors
and peripherals, enabling rapid prototyping and development of IoT solutions. It is
programmable using popular development environments such as Arduino IDE and
MicroPython, providing flexibility for developers. With its small form factor and low power
consumption, NodeMCU ESP32 is ideal for battery-powered and embedded IoT applications.
The board includes GPIO pins for interfacing with external devices, expanding its capabilities
for custom projects and experiments. Overall, the NodeMCU ESP32 board is a cost-effective
and feature-rich solution for building connected devices and IoT applications. The NodeMCU
ESP32 board benefits from a large and active community of developers, makers, and
enthusiasts who contribute to its development, share projects, and provide support and
resources. This community-driven ecosystem ensures that users have access to a wealth of
documentation, tutorials, libraries, and forums for assistance and collaboration.
Ultrasonic Sensor:
An ultrasonic sensor is a type of sensor that emits ultrasonic sound waves (high-
frequency sound waves with a frequency above the range of human hearing) and then detects
the reflections of these sound waves off nearby objects.

Fig 2.4.3 Ultrasonic sensor.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|6

Ultrasonic sensors work based on the principle of echolocation, similar to how bats navigate.
They emit a burst of ultrasonic waves and then measure the time it takes for the waves to
bounce back after hitting an object. By knowing the speed of sound in air, the sensor can
calculate the distance to the object based on the time it takes for the sound waves to return.
Typical ultrasonic sensors consist of a transmitter, which generates ultrasonic waves, and a
receiver, which detects the waves after they bounce back. The sensor also contains electronic
circuitry for generating the ultrasonic pulses, timing the waves' travel time, and processing
the received signals to determine distance. Ultrasonic sensors are widely used in various
industries and applications, including distance measurement, object detection, obstacle
avoidance, level sensing, and presence detection. They are commonly found in robotics,
automotive parking systems, industrial automation, security systems, and home appliances.
5V Relay Module:
A 5V relay module is an electronic component used to control high-voltage devices
with low-voltage signals, typically from a microcontroller or a digital output pin of a
microcontroller board.

Fig 2.4.4 5V Relay Module.


The main function of a relay module is to act as an electrically controlled switch. It
uses a low-voltage signal, typically 5V, to control the switching of a separate high-voltage
circuit. When the relay coil is energized with the 5V signal, it mechanically switches the high-
voltage circuit on or off. A 5V relay module consists of several key components, including a
relay coil, relay contacts, driver circuitry, and connectors. The relay coil is energized by the
5V signal, while the relay contacts provide the switching capability for the high-voltage
circuit. The driver circuitry ensures proper operation of the relay coil and may include
protective components such as diodes. 5V relay modules are commonly used in various
applications where there is a need to control high-voltage devices or circuits using low-voltage
signals. They are widely used in home automation systems, industrial control systems,
robotics, automotive electronics, and electronic prototyping projects.
Water Pump:
A water pump is a mechanical device used to move water from one location to another
by creating a flow or pressure difference. The primary function of a water pump is to transport
water from a low-pressure source (such as a reservoir, well, or underground aquifer) to a
higher-pressure destination (such as a distribution system, irrigation system, or building
plumbing).

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|7

Fig 2.4.5 Water Pump.


There are various types of water pumps, each designed for specific applications and
operating conditions. Common types include centrifugal pumps, which use rotating impellers
to generate centrifugal force and push water outward, and positive displacement pumps, which
use mechanisms such as pistons, diaphragms, or gears to move water in discrete volumes.
Water pumps are used in a wide range of applications across different industries and
sectors. Some common applications include:
• Domestic water supply: Providing water for residential homes, apartments, and
buildings.
• Agriculture: Irrigation systems for crop watering and livestock farming.
• Industrial processes: Cooling systems, wastewater treatment, and manufacturing
processes.
• Construction: Dewatering excavations, pumping concrete, and supplying water to
construction sites.
• Municipal utilities: Supplying water to communities, firefighting, and wastewater
management.
LCD and I2C Module:
An LCD display with an I2C module is a type of liquid crystal display (LCD) that
incorporates an I2C (Inter-Integrated Circuit) communication interface for easy interfacing
with microcontrollers and other digital devices.

Fig 2.4.6 LCD & I2C Module

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|8

The primary function of an LCD display with an I2C module is to provide visual
output for displaying text, numbers, symbols, and graphical information. The I2C module
facilitates communication between the LCD display and a microcontroller or other host
device, allowing for easy control and manipulation of the display content. LCD displays
utilize liquid crystal cells that can change their optical properties in response to an electric
field. When voltage is applied, the liquid crystal molecules align to allow light to pass through,
creating visible characters or images on the display. LCDs are commonly used for their low
power consumption, high contrast, and readability in various lighting conditions.
The I2C interface on the LCD module allows for serial communication between the
display and the host device using only two wires (SDA for data and SCL for clock). This
simplifies wiring and reduces the number of digital pins required on the host device, making
it convenient for projects with limited I/O resources. The I2C module typically includes an
integrated circuit (IC) that acts as an interface between the LCD display and the I2C bus. This
IC handles communication protocols, address decoding, and signal conditioning, abstracting
the complexity of low-level communication protocols from the user
LED and 180Ω Resistor:
LEDs (Light Emitting Diodes) and 180ohm resistors are commonly used together in
electronic circuits to limit the current flowing through the LED and protect it from damage
due to excessive current.

Fig 2.4.7 LED & 180Ω Resistor.


LEDs are semiconductor devices that emit light when current flows through them in
the forward direction. They are widely used for indicators, displays, illumination, and various
lighting applications due to their efficiency, durability, and low power consumption.
Resistors are passive electronic components that resist the flow of electric current.
They are used to control the amount of current flowing through a circuit and to protect other
components from excessive current. The resistance of a resistor is measured in ohms (Ω).
When an LED is connected directly to a voltage source (such as a power supply or a
microcontroller pin), it can draw excessive current, potentially damaging the LED. To prevent
this, a resistor is connected in series with the LED to limit the current to a safe level. The
value of the resistor is chosen based on the desired current and the forward voltage drop of
the LED.
When designing circuits with LEDs and resistors, it's important to ensure that the
chosen resistor value limits the current within the safe operating range of the LED. Excessive
current can lead to overheating and premature failure of the LED.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|9

Li-ion Battery and Holder:


A Li-ion (Lithium-ion) battery holder is a device used to securely hold and connect
Li-ion batteries in electronic circuits or devices.

Fig 2.4.8 Li-ion Battery & Holder.


Li-ion batteries are rechargeable batteries that use lithium ions as the charge carrier. They are
widely used in portable electronics, power tools, electric vehicles, and many other
applications due to their high energy density, long cycle life, and relatively low self-discharge
rate. Battery holders provide a convenient means of connecting the batteries to external
circuits or devices. They typically include metal contacts or terminals that make electrical
contact with the battery terminals, allowing current to flow between the battery and the
connected circuit.
Bread Board and Jumper wires:
A breadboard and jumper wires are fundamental components used in electronics
prototyping and circuit design.

Fig 2.4.9 Breadboard & Jumper wires


A breadboard is a rectangular plastic board with a grid of holes arranged in rows and
columns. The holes are connected internally in a specific pattern, allowing for the temporary
connection of electronic components without the need for soldering. Breadboards come in
various sizes and configurations, including full-size, half-size, and mini breadboards. The
holes on a breadboard are arranged in rows and columns, with each row typically connected
internally along the length of the breadboard. The columns are typically not connected
internally, allowing components to be placed across the gap to create connections or breaks
in the circuit as needed.
Jumper wires are flexible wires with connectors at each end, typically with male pins
or alligator clips. They are used to create electrical connections between components on the
bread board by plugging one end into a hole and the other end into another hole.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|10

CHAPTER 3
REQUIREMENTS SPECIFICATION
3.1 Functional Requirements:
Functional requirements are crucial aspects of software development and system
design. functional requirements specify what a system should do.
1. Functional requirements describe specific behaviours and functionalities that a system
or software must perform to meet the needs of its users or stakeholders.
2. These requirements typically outline the features, capabilities, and interactions that
users expect from the system, such as user authentication, data processing, or report
generation.
3. Functional requirements are expressed in terms of input actions, output results, and
system behaviours, providing a clear understanding of how the system should behave
under different conditions.
4. For example, a functional requirement for an e-commerce website might include the
ability for users to browse products, add items to a shopping cart, and complete a
purchase transaction.
5. Scope Definition: Functional requirements help define the scope of a software project
by outlining the specific features and functionalities that the system should deliver to
its users.
6. User Interaction: These requirements describe how users interact with the system,
including user interfaces, input methods, navigation flows, and expected system
responses to user actions.
7. Use Cases and Scenarios: Functional requirements often include detailed use cases or
scenarios that illustrate how the system will be used in real-world situations, helping
stakeholders understand the system's intended behaviour.
8. Prioritization: Functional requirements can be prioritized based on their importance to
users or stakeholders, helping development teams focus on implementing the most
critical features first.

3.2 Non-Functional requirements:


Non-functional requirements are crucial aspects of software development and system
design. non-functional requirements define how it should do it and what quality attributes it
must possess.
1. Non-functional requirements specify the qualities, characteristics, and constraints that
govern how a system operates rather than what it does.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|11

2. These requirements focus on aspects such as performance, reliability, security,


usability, scalability, and maintainability, which are essential for ensuring the overall
effectiveness and quality of the system.
3. Non-functional requirements often define constraints and criteria that must be met,
such as response time targets, uptime requirements, or compliance with regulatory
standards.
4. For example, a non-functional requirement for a web application might include a
maximum response time of two seconds for page loads or the ability to support a certain
number of concurrent users without performance degradation.
5. Quality Attributes: Non-functional requirements focus on the quality attributes of the
system, such as performance, reliability, security, usability, maintainability, and
scalability.
6. Performance: These requirements specify the performance characteristics of the
system, including response times, throughput, latency, and resource utilization, to
ensure that the system meets performance expectations.
Functional requirements specify what a system should do, while non-functional
requirements define how it should do it and what quality attributes it must possess. Both types
of requirements are essential for guiding the design, implementation, and evaluation of
software systems to ensure they meet the needs and expectations of users and stakeholders.

3.3 Software and Hardware Requirements:


This section describes the software and hardware requirements of the system.

3.3.1 Hardware Requirement:


• ESP32 board x 1
• ESP32 adapter x 1
• Ultrasonic sensor x 1
• LCD screen x
• I2C module x
• Relay module x
• LED x 4
• 180 ohm Resistor x 4
• Breadboard x 1
• Jumper wires
• Mini Water pump and pipe
• Li-ion battery x 2
• Battery holder x 1

3.3.2 Software requirement:

• Embedded C
• Arduino Suit or IDE

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|12

CHAPTER 4
SYSTEM DESIGN
4.1 Use Case Diagram:
Use case diagram is the diagram who reflection of the globe. This diagram gives more
specification who is and what is uses on the system for this case according where user interacts
with system and perform tasks.

Fig 4.1.1 Use Case diagram

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|13

4.2 Block Diagram:


A block diagram is a visual representation of a system or process using blocks to
represent components or stages, and lines or arrows to indicate the flow of information or
signals between them. Here's an example of a block diagram. Arrows indicate the flow of data
or information between the blocks, showing how input data is processed to produce output
data. Each block represents a specific function, component, or stage in the overall system or
process.

Input Data Data Processing Output


data

Pre-processing Core Computation Post-processing

Fig 4.2.1 Block Diagram of whole process.

In this block diagram:


• Water Level Sensor (Ultrasonic): Measures the water level and sends the data to the
microcontroller.
• Microcontroller (MCU): Receives data from the sensor, processes it, and controls the
LCD display.
• LCD Display with I2C Module: Displays the water level information received from
the microcontroller.
• Data Processing: Involves any additional processing of the water level data, such as
logging it for analysis or transmitting it wirelessly.
• Output Interface: Provides the processed data to an external system or device, such as
a computer, smartphone, or cloud platform, for further analysis, monitoring, or control.

This block diagram illustrates the flow of data and control within the water level monitoring
system, from the sensor to the output interface. Each component plays a specific role in the
overall functionality of the system, contributing to the monitoring and management of water
levels in a given environment.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|14

4.3 Circuit Diagram:


This simplified circuit diagram illustrates the basic connections between the water level
sensor, microcontroller (MCU) such as an Arduino, and the LCD display with an I2C
module.
• The water level sensor connects to the MCU's analogue or digital pins for data
transmission.
• The MCU communicates with the LCD display using the I2C protocol, typically via
the SDA (data) and SCL (clock) lines.
• Both the MCU and the LCD display are powered using the appropriate power supply
(VCC) and connected to a common ground (GND).

Fig 4.3.1 Circuit Diagram for Water Level Monitoring System.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|15

CHAPTER 5
IMPLEMENTATION

5.1 Coding Used in this Project:

//Include the library files


#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

#define LED1 2
#define LED2 4
#define LED3 5
#define LED4 18
#define trig 12
#define echo 13
#define relay 14

//Enter your tank max value(CM)


int MaxLevel = 13;

int Level1 = (MaxLevel * 75) / 100;


int Level2 = (MaxLevel * 65) / 100;
int Level3 = (MaxLevel * 55) / 100;
int Level4 = (MaxLevel * 35) / 100;

//Initialize the LCD display


LiquidCrystal_I2C lcd(0x27, 16, 2);

BlynkTimer timer;

// Enter your Auth token


char auth[] = "**********************";

//Enter your WIFI SSID and password


char ssid[] = "**********";
char pass[] = "**********";

void setup() {
// Debug console
Serial.begin(115200);
Blynk.begin(auth, ssid, pass,"blynk.cloud", 80);
lcd.init();
lcd.backlight();
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
pinMode(relay, OUTPUT);
digitalWrite(relay, HIGH);

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|16

lcd.setCursor(0, 0);
lcd.print("System");
lcd.setCursor(4, 1);
lcd.print("Loading..");
delay(4000);
lcd.clear();
}

//Get the ultrasonic sensor values


void ultrasonic() {
digitalWrite(trig, LOW);
delayMicroseconds(4);
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);
long t = pulseIn(echo, HIGH);
int distance = t / 29 / 2;

Serial.println(distance);

int blynkDistance = (distance - MaxLevel) * -1;


if (distance <= MaxLevel) {
Blynk.virtualWrite(V0, blynkDistance);
} else {
Blynk.virtualWrite(V0, 0);
}
lcd.setCursor(0, 0);
lcd.print("WLevel:");

if (Level1 <= distance) {


lcd.setCursor(8, 0);
lcd.print("Very Low");
digitalWrite(LED1, HIGH);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
} else if (Level2 <= distance && Level1 > distance) {
lcd.setCursor(8, 0);
lcd.print("Low");
lcd.print(" ");
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
} else if (Level3 <= distance && Level2 > distance) {
lcd.setCursor(8, 0);
lcd.print("Medium");
lcd.print(" ");
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
digitalWrite(LED4, LOW);
} else if (Level4 <= distance && Level3 > distance) {
lcd.setCursor(8, 0);
lcd.print("Full");
lcd.print(" ");
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|17

digitalWrite(LED3, HIGH);
digitalWrite(LED4, HIGH);
}
}

//Get the button value


BLYNK_WRITE(V1) {
bool Relay = param.asInt();
if (Relay == 1) {
digitalWrite(relay, LOW);
lcd.setCursor(0, 1);
lcd.print("Motor is ON ");
} else {
digitalWrite(relay, HIGH);
lcd.setCursor(0, 1);
lcd.print("Motor is OFF");
}
}

void loop() {
ultrasonic();
Blynk.run();//Run the Blynk library
}

5.2 Blynk IOT App:

Blynk is a popular platform for building Internet of Things (IoT) applications that allows users
to easily create interfaces and control various hardware devices remotely using a mobile app.

Fig 5.2.1 Blynk App Setup-1

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|18

Fig 5.2.2 Blynk App Setup-2

1. Platform Overview: Blynk provides a cloud-based platform and a mobile app that
enables users to connect their hardware projects to the internet and control them
remotely. It offers a drag-and-drop interface for creating custom user interfaces (UI)
and widgets to interact with connected devices.
2. Mobile App: The Blynk mobile app is available for both iOS and Android devices. It
allows users to create and configure projects, add widgets, and monitor and control
their connected devices from anywhere with an internet connection.
3. Widgets: Blynk provides a variety of widgets that users can add to their projects to
interact with their hardware devices. These widgets include buttons, sliders, gauges,
LEDs, graphs, and displays, among others. Users can customize the appearance and
behaviour of these widgets to suit their specific needs.
4. Cloud Server: Blynk's cloud server acts as a bridge between the mobile app and the
hardware devices. It facilitates communication and data exchange between the app and
the connected devices, allowing users to send commands, receive data, and update the
UI in real-time.
5. Device Libraries: Blynk provides libraries and SDKs for popular hardware platforms
and microcontrollers, including Arduino, Raspberry Pi, ESP8266, ESP32, and more.
These libraries simplify the process of connecting hardware devices to the Blynk
platform and implementing the necessary communication protocols.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|19

5.3 Results:

Fig 5.3.1 Circuit Connections and readings-1

Fig 5.3.2 Circuit Connections and readings-2

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|20

CHAPTER 6
SOFTWARE TESTING

IOT testing involves executing QA tests to check IoT devices’ functionality, security, and
performance. It is crucial to ensure that your IoT devices can transmit sensitive information
wirelessly before going to market because every IoT device sends and receives data over the
Internet. Because of this, many IoT businesses rely on IoT automation, penetration, and
performance testing tools to detect defects before reaching consumers.

6.1 Levels of Testing:


Software testing for a project involving Blynk IoT app:
1. Unit Testing:
• Test individual functions and modules of your codebase to ensure they work as
expected.
• Mock Blynk API calls and responses to simulate interactions with the Blynk
cloud server.
• Verify that each function behaves correctly under different conditions and edge
cases.
2. Integration Testing:
• Test the interaction between different components of your system, such as the
microcontroller code, Blynk library, and Blynk mobile app.
• Verify that the hardware devices can successfully communicate with the Blynk
cloud server and respond to commands from the mobile app.
3. User Interface (UI) Testing:
• Test the user interface of the Blynk mobile app to ensure it is intuitive,
responsive, and visually appealing.
• Verify that all widgets and controls function correctly and display the expected
information.
• Test various screen resolutions, orientations, and device types to ensure
compatibility.
4. End-to-End Testing:
• Perform end-to-end testing to verify that the entire system works as expected
from the user's perspective.
• Test common user scenarios, such as connecting to the Blynk cloud server,
controlling hardware devices, and receiving real-time updates.
• Verify that data synchronization between the mobile app and hardware devices
is reliable and accurate.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|21

6.2 Test cases:


1. Unit Test Case - Sensor Reading:
• Objective: Ensure that the sensor readings are accurately received and
processed by the microcontroller.
• Steps:
1. Connect the sensor to the microcontroller.
2. Trigger the sensor to simulate different water level readings.
3. Verify that the microcontroller receives and processes the sensor
readings correctly.
• Expected Result: Sensor readings are accurately captured and processed by the
microcontroller.
2. Integration Test Case - Device Connection:
• Objective: Verify that the microcontroller can successfully connect to the
Blynk cloud server.
• Steps:
1. Power on the microcontroller and ensure it is connected to the internet.
2. Launch the Blynk mobile app and attempt to connect to the
microcontroller.
3. Verify that the microcontroller establishes a connection with the Blynk
cloud server.
• Expected Result: Microcontroller successfully connects to the Blynk cloud
server, indicating a stable connection.
3. UI Test Case - Widget Functionality:
• Objective: Ensure that the widgets on the Blynk mobile app interface function
correctly.
• Steps:
1. Launch the Blynk mobile app and navigate to the project interface.
2. Interact with each widget (e.g., buttons, sliders) to trigger actions.
3. Verify that the widgets respond as expected and control the connected
hardware devices.
• Expected Result: Widgets on the Blynk mobile app interface respond
accurately and control the hardware devices as intended.
4. End-to-End Test Case - Remote Control:
• Objective: Verify that users can remotely monitor and control the hardware
devices using the Blynk mobile app.
• Steps:

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|22

1. Launch the Blynk mobile app and access the project interface.
2. Monitor the real-time status of the hardware devices (e.g., water level).
3. Use the app to send commands (e.g., turn on/off) to the hardware
devices.
• Expected Result: Users can remotely monitor the hardware devices and
successfully control them using the Blynk mobile app.
5. Security Test Case - Authentication:
• Objective: Ensure that user authentication mechanisms are robust and secure.
• Steps:
1. Attempt to access the Blynk project without proper authentication
credentials.
2. Verify that unauthorized access is denied, and users are prompted to
enter valid credentials.
• Expected Result: Unauthorized access to the Blynk project is prevented, and
users are required to authenticate with valid credentials.
6. Performance Test Case - Data Synchronization:
• Objective: Test the performance of data synchronization between the Blynk
mobile app and the hardware devices.
• Steps:
1. Monitor the time taken for sensor readings to update on the Blynk
mobile app after changes in the environment.
2. Analyze the latency in data synchronization under varying network
conditions (e.g., Wi-Fi vs. cellular).
• Expected Result: Sensor readings update promptly on the Blynk mobile app,
with minimal latency in data synchronization.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|23

CHAPTER 7
CONCLUSION

In conclusion, the Blynk IoT water level monitoring project offers a robust solution for remote
monitoring and control of water levels in various environments. By leveraging the Blynk
platform, users can easily connect their hardware devices to the internet and access real-time
data and control functionalities through the Blynk mobile app.
Throughout the project development, thorough software testing ensured the reliability,
security, and performance of the system. Unit testing verified the functionality of individual
components such as sensor readings and microcontroller operations. Integration testing
confirmed seamless communication between the microcontroller and the Blynk cloud server.
UI testing ensured a user-friendly interface on the Blynk mobile app, while end-to-end testing
validated remote monitoring and control capabilities.
Security testing addressed potential vulnerabilities in user authentication mechanisms, while
performance testing assessed data synchronization and latency under varying network
conditions. Compatibility testing ensured the project's functionality across different devices
and platforms, enhancing its accessibility and usability. Overall, the Blynk IoT water level
monitoring project demonstrates the effectiveness of IoT technologies in providing remote
monitoring and control solutions for various applications. Its ease of use, versatility, and
reliability make it suitable for a wide range of environments, from home automation to
industrial monitoring. With continuous refinement and enhancements, the project can further
optimize its functionality and meet the evolving needs of users and stakeholders in water
management and beyond.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|24

CHAPTER 8
FUTURE ENHANCEMENT

• Multi-Sensor Support: Integrate support for multiple water level sensors to monitor
levels in different locations or containers simultaneously. This enhancement can
provide a comprehensive overview of water levels across various areas.
• Alerting Mechanisms: Implement alerting mechanisms such as push notifications or
SMS alerts to notify users when water levels exceed or fall below specified thresholds.
This feature enhances the project's utility by enabling proactive monitoring and timely
response to critical situations.
• Data Analytics and Visualization: Incorporate data analytics and visualization tools to
analyse historical water level data trends, identify patterns, and gain insights into usage
patterns or potential issues. Visualizing data trends can aid in decision-making and
resource management.
• Remote Configuration: Enable remote configuration of system parameters and
thresholds through the Blynk mobile app, allowing users to adjust settings and
customize their monitoring setup without physical access to the hardware.
• Integration with External Systems: Integrate the project with external systems or
services such as weather APIs or water quality sensors to enhance its functionality and
provide additional context for water level monitoring.
• Energy Efficiency Optimization: Implement power-saving features and optimizations
to enhance the energy efficiency of the monitoring system, prolonging battery life in
battery-powered deployments and reducing energy consumption in general.
• Geolocation Integration: Incorporate geolocation capabilities to track the location of
monitoring points and provide location-based services or alerts. Geolocation data can
also be useful for mapping water level data spatially.

East West Institute of Technology Department of MCA 2023-2024


Water Level Monitoring System Page|25

BIBLIOGRAPHY

• Blynk. (n.d.). Blynk IoT Platform. Retrieved from https://blynk.io/

• Arduino. (n.d.). Arduino - Home. Retrieved from https://www.arduino.cc/

• Open AI. (n.d.). Open AI - Research. Retrieved from https://openai.com/research/

• Tutorials Point. (n.d.). Software Testing - Quick Guide. Retrieved from


https://www.tutorialspoint.com/software_testing/index.htm

• IEEE Computer Society. (n.d.). IEEE Xplore Digital Library. Retrieved from
https://ieeexplore.ieee.org/Xplore/home.jsp

• Blynk Community. (n.d.). Blynk Community Forums. Retrieved from


https://community.blynk.cc/
.

East West Institute of Technology Department of MCA 2023-2024

You might also like