0% found this document useful (0 votes)
13 views21 pages

Control Systems DA - 1

The project report details the development of an Automated Water Level Control System using an Arduino UNO and ultrasonic sensor to monitor and control water levels in tanks. It aims to eliminate manual monitoring, prevent overflow, and provide user alerts through a buzzer when the tank is full. The system is designed for efficiency and ease of implementation, making it suitable for domestic, agricultural, and industrial applications.

Uploaded by

v3165440
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)
13 views21 pages

Control Systems DA - 1

The project report details the development of an Automated Water Level Control System using an Arduino UNO and ultrasonic sensor to monitor and control water levels in tanks. It aims to eliminate manual monitoring, prevent overflow, and provide user alerts through a buzzer when the tank is full. The system is designed for efficiency and ease of implementation, making it suitable for domestic, agricultural, and industrial applications.

Uploaded by

v3165440
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
You are on page 1/ 21

SCHOOL OF MECHANICAL ENGINEERING

Winter Semester 2024-25

BMEE330L – Control Systems

PROJECT REPORT

Automated Water Level Control System Using Ultrasonic


Sensor and Pump

Presented by:

Kaustuv Mazumder (22BME0414)

Vedant Chechani (22BME0562)


Contents

Sl. No. Title Page No.

1 Abstract 3

2 Introduction 4-5

3 Objectives 6

4 Components Used 7-8

5 Methodology 9-11

6 Closed Loop Control System 12-13

7 Circuit Diagram 14

8 Circuit Connections 15

9 Hardware Model 16

10 Code 17-18

11 Applications 19

12 Results 20

13 Conclusion 21

2
Abstract
Efficient water level monitoring and control are essential in a wide range of applications
including domestic water storage, irrigation, and industrial processes. Manual monitoring can
lead to inefficiencies such as water wastage, overflow, or dry running of pumps, which may
result in equipment damage. This project presents a low-cost and effective solution for
automated water level control using an Arduino UNO, ultrasonic sensor, relay module, miniature
water pump, and a buzzer for user alert.

The system employs an ultrasonic sensor mounted at the top of a water tank to continuously
measure the distance to the water surface. The Arduino processes this data to calculate the water
level in real-time. When the level reaches a predefined threshold (for example, 5 cm from the
top), it triggers the relay to permanently turn off the pump, even if the water level drops later due
to usage or sensor error. This logic prevents the pump from cycling on and off unnecessarily and
adds robustness to the system. A buzzer is activated to notify the user that the tank is full.

The relay module acts as an interface to control the pump, which operates at higher current levels
than the Arduino can handle directly. The circuit is built on a breadboard, and the Arduino is
powered via USB, while the pump can be powered using an external 5V power source or battery,
depending on its current requirements. Proper electrical isolation and grounding are maintained
to ensure safe operation.

This project demonstrates a practical embedded system that combines sensing, logic control, and
actuation. It is ideal for small-scale automation, school projects, and DIY enthusiasts interested
in home automation, providing a foundational understanding of sensor integration and control
using microcontrollers.

3
Introduction
Water is one of the most crucial resources for life and economic development. However, it is also
a finite and often mismanaged resource. In both domestic and industrial settings, water is
typically stored in overhead tanks for regular usage. Traditionally, people monitor the water level
in these tanks manually, which is not only inefficient but also prone to human error. This often
results in overflows, leading to unnecessary wastage of water and power. In some cases, dry
running of water pumps due to low water levels can even damage the pump motor.

With the advancement of embedded systems and microcontroller-based automation, it is now


possible to manage water usage more efficiently. This project presents a smart, automated system
designed to monitor and control the water level in a tank without human intervention. The
system is built around an Arduino UNO microcontroller and an HC-SR04 ultrasonic sensor,
which together detect the water level in real-time. A relay module is used to control the pump
motor, and a buzzer serves as an alert mechanism when the tank is full.

The system works on a simple principle: as the water level rises and reaches a pre-set threshold,
the ultrasonic sensor detects the reduced distance between the water surface and the sensor.

4
When the threshold is crossed, the Arduino processes this data and sends signals to stop the
pump and simultaneously activate the buzzer, alerting the user. This eliminates the need for
manual supervision and prevents water from overflowing.

One of the key advantages of this system is its affordability and ease of implementation, making
it suitable for households, small industries, and educational projects. Its modular nature allows
for upgrades, such as integrating Wi-Fi modules for remote monitoring or expanding the logic to
handle multiple tanks.

This project not only serves as a practical solution for day-to-day water management but also
encourages the adoption of simple automation techniques in everyday life. Through this project,
we aim to contribute towards resource conservation, operational efficiency, and technological
awareness.

5
Objectives
Goal 1: Automate Water Pump Control​
The primary objective of this project is to eliminate the need for manual intervention in operating
the water pump. Traditionally, users must monitor the water level visually and switch the pump
ON or OFF accordingly, which is not only inefficient but also prone to human negligence. This
system uses an ultrasonic sensor to continuously monitor the water level in the tank. When the
water level reaches a predetermined maximum threshold (indicating the tank is full), the system
automatically turns OFF the water pump using a relay module. Similarly, if the water level drops
below the threshold, the system can be programmed to turn the pump ON again. This level of
automation improves convenience, prevents motor wear caused by dry running, and ensures
optimal use of electricity and water.

Goal 2: Sound Alert Notification​


Another important goal is to provide a real-time alert mechanism through an audible buzzer.
When the tank is full and the pump is turned OFF, the buzzer is activated to notify the user. This
alert system is especially useful in scenarios where the user may not be in visual contact with the
water tank or pump. The buzzer acts as an immediate and noticeable signal, ensuring that users
are aware of the tank’s status and can respond accordingly if needed. This feature enhances user
awareness and serves as a backup notification system in case of any issues with the automatic
control.

Overall Impact:​
By successfully implementing these two goals, the system provides a reliable and cost-effective
method for managing water usage. It promotes efficient resource management, reduces the
chances of tank overflow and pump damage, and introduces basic automation into everyday
utility systems. The design is scalable and adaptable, making it suitable for various domestic and
industrial applications.

6
Components Used

Sl. Component Specifications Quantity


No. Name

1 Arduino UNO Microcontroller board based on ATmega328P, 14 digital 1


I/O pins, 6 analog inputs, USB interface, 5V operating
voltage

2 Ultrasonic Sensor HC-SR04 1

3 Relay Module 5V SPDT(Single Pole Double Throw) relay module 1

4 Buzzer 5V active buzzer 1

5 Breadboard Size: 830 tie points, standard 3.3-inch width, suitable for 1
prototyping circuits

6 Jumper Wires Male-to-male, male-to-female jumper wires 11

7 Power Supply 5V USB powered 1

Arduino Uno

7
Ultrasonic Sensor (HC-SR04)

5V Buzzer

5V Pump

Breadboard

5V SPDT Relay Module

8
Methodology
The methodology adopted for building the Water Level Detection and Alert System using
Arduino involved several key steps, which ensured systematic project development from
planning to execution. The major steps are detailed below:

1. Problem Identification and Objective Definition

●​ Recognized the need for automated water tank monitoring to prevent overflow and dry
running of pumps.​

●​ Defined clear objectives: water level detection, automated pump control, and user
alerting via buzzer.​

2. Component Selection

●​ Chose Arduino UNO as the main controller due to its ease of programming and wide
community support.​

●​ Selected the HC-SR04 ultrasonic sensor for its non-contact distance measurement
capability.​

●​ Used a relay module to control the electrical connection to the water pump.​

●​ Included a buzzer for audio alert notifications.​

●​ Utilized breadboard and jumper wires for easy circuit prototyping.​

9
3. Circuit Design

●​ Designed a simple circuit connecting the ultrasonic sensor, relay, and buzzer to the
Arduino.​

●​ Ensured correct pin assignments for input (sensor) and output (buzzer and relay).​

●​ Power requirements and safe current ratings were considered to prevent overloading the
board.​

4. Programming the Arduino

●​ Wrote Arduino sketch using C++ to:​

○​ Trigger and receive signals from the ultrasonic sensor.​

○​ Calculate the water level based on the measured distance.​

○​ Activate or deactivate the pump and buzzer based on water level thresholds.​

●​ Program was uploaded to the Arduino UNO using Arduino IDE.​

5. Assembly and Prototyping

●​ Assembled the components on a breadboard to test connectivity and logic flow.​

●​ Powered the system using a 5V adapter and tested the behavior of the pump and buzzer.​

●​ Verified that the system activates the buzzer and deactivates the pump once the tank is
full.​

10
6. Testing and Calibration

●​ Placed the sensor at different heights and measured various water levels to fine-tune the
threshold value.​

●​ Adjusted the code if false triggering or errors were observed during real-time operation.​

●​ Validated system behavior under different water tank conditions.​

7. Documentation and Final Integration

●​ Documented the component specifications, connections, and working process.​

●​ Created schematic diagrams, block diagrams, and photographs.​

●​ Compiled a full report and prepared video/photo evidence of the system in operation.

11
Closed-Loop Control System
A closed-loop control system is a type of control system where the output is continuously
monitored, compared to a desired setpoint, and any deviation from the setpoint leads to
corrective actions that adjust the system to maintain the desired outcome. This is also known as a
feedback control system because the system "feeds back" information about the output to adjust
the input.

Working of the Closed-Loop Control System in the Water Level Detection and Alert
System

In the context of the Water Level Detection and Alert System, the system continuously
monitors the water level in the tank using the HC-SR04 Ultrasonic Sensor. The information
provided by the sensor (the current water level) is used as feedback to control the operation of
the pump. Here's how it operates as a closed-loop control system:

1. Measurement (Sensing the Output)

The ultrasonic sensor constantly measures the distance between its transducer and the water
surface in the tank. This is done by emitting ultrasonic waves, which travel through the air, hit
the water surface, and then reflect back to the sensor. The time it takes for the sound waves to
return allows the system to calculate the distance to the water surface. This distance is then used
to infer the water level in the tank.

2. Comparison with Desired Setpoint (Threshold Water Level)

The Arduino microcontroller compares the measured water level (the actual output) with a
pre-set desired water level or threshold. The threshold represents the maximum desired water
level in the tank, beyond which the water should not rise. If the water level reaches or exceeds
this threshold, it indicates that the tank is full.

12
3. Error Detection (Deviation from Setpoint)

If the measured water level is greater than or equal to the setpoint, an error is detected, meaning
the system recognizes that the tank is full. The system continuously checks for any deviation
from the desired water level and adjusts the pump accordingly.

4. Corrective Action (Control Action)

Once the error is detected, the Arduino sends a signal to the relay module to deactivate the
pump. The relay interrupts the power supply to the pump, thereby stopping the water flow into
the tank. This action is taken to prevent the water from overflowing and to save both water and
electricity.

●​ If the water level is above the threshold (tank is full), the relay is turned OFF, stopping
the pump.​

●​ If the water level drops below the threshold (tank is not full), the relay is turned ON
again, activating the pump to fill the tank.​

5. Feedback (Alert System)

In addition to controlling the pump, the system also provides feedback to the user using a
buzzer. When the tank reaches the full water level, the Arduino activates the buzzer, alerting the
user to the tank’s status. This is another form of feedback, ensuring that the user is informed of
the system’s current condition, even if they are not physically near the tank.

6. Continuous Monitoring and Adjustment

The entire process of measuring, comparing, detecting errors, and correcting the system operates
in a continuous loop. The Arduino keeps running this loop, constantly checking the water level
and taking corrective actions to ensure that the tank never overflows or runs dry.

13
Circuit Diagram

14
Circuit Connections
Component Pin / Terminal Connects To

Arduino UNO GND Breadboard GND rail

USB Powered From PC

Ultrasonic Sensor VCC Arduino 5V

GND Arduino GND

TRIG Digital Pin 9

ECHO Digital Pin 8

Buzzer +ve Digital Pin 7

-ve Arduino GND

Relay Module VCC Breadboard 5V rail

GND Breadboard GND rail

IN Digital Pin 2 on Arduino

COM Breadboard 5V rail

NO (Normally Open) Pump +ve

Pump (2-wire) +ve (Red wire) Relay NO terminal

-ve (Black wire) Breadboard GND rail

Breadboard +5V Rail Connected to 5V Power Supply

GND Rail Connected to Power Supply GND

15
Hardware Model

16
Code
const int trigPin = 9;
const int echoPin = 8;
const int relayPin = 2;
const int buzzerPin = 7;

const int maxDistanceCm = 5;

bool pumpStopped = false;

void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(relayPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);

digitalWrite(relayPin, LOW);
digitalWrite(buzzerPin, LOW);

Serial.begin(9600);
}

void loop() {
long duration;
int distanceCm;

digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);


distanceCm = duration * 0.034 / 2;

17
Serial.print("Distance: ");
Serial.print(distanceCm);
Serial.println(" cm");

if (!pumpStopped) {
if (distanceCm <= maxDistanceCm) {
digitalWrite(relayPin, HIGH);
pumpStopped = true;
Serial.println("Pump stopped, start buzzer beep.");
} else {
digitalWrite(relayPin, LOW);
digitalWrite(buzzerPin, LOW);
}
}

if (pumpStopped) {
digitalWrite(buzzerPin, HIGH);
delay(200);
digitalWrite(buzzerPin, LOW);
delay(300);
} else {
delay(500);
}
}

18
Applications
●​ Domestic Water Tank Automation Systems​
Ensures automatic pump control and prevents water overflow in residential buildings,
reducing manual effort and water wastage.​

●​ Agricultural Irrigation Management​


Automates water delivery in farms based on water levels, helping conserve water while
maintaining soil moisture efficiently.​

●​ Industrial Process Water Control​


Monitors and controls water levels in tanks used in industrial processes, ensuring smooth
and uninterrupted operations.​

●​ Water Supply Systems in Apartments​


Automates and manages centralized water distribution systems across multiple
households, reducing disputes and wastage.​

●​ Smart Cities Infrastructure​


Forms part of smart city IoT ecosystems by integrating water level monitoring into urban
water management systems.​

●​ Rainwater Harvesting Systems​


Tracks storage tank levels in rainwater harvesting setups and controls overflow, making
rainwater utilization more effective.​

●​ Public Utility Water Tanks​


Helps municipal corporations manage overhead and underground water storage tanks
with reduced manpower.​

●​ Educational Projects and Demonstrations​


Serves as a hands-on learning project for students to understand embedded systems,
sensors, automation, and water conservation principles.

19
Results
The Water Level Detection and Alert System was successfully designed, assembled, and tested in
a controlled environment. The system effectively fulfilled its intended purpose: monitoring the
water level in a storage tank and automating the water pump operation while providing an
audible alert when the tank is full.

Functional Outcomes

●​ Real-Time Monitoring:​
The ultrasonic sensor accurately measured the water level by calculating the distance
between the sensor and the water surface. The measurements were consistent within an
error margin of ±1 cm.​

●​ Automated Pump Control:​


When the water level reached the predefined threshold (less than 10 cm from the sensor),
the Arduino sent a signal to the relay to switch OFF the water pump. When the water
level fell below this threshold, the system automatically reactivated the pump.​

●​ Alert Notification:​
The buzzer reliably activated when the tank was full, notifying the user with a
continuous beeping sound.​

●​ Serial Output Verification:​


Using the Serial Monitor in Arduino IDE, the distance readings were observed in real
time. The console consistently printed distance data, aiding in monitoring and debugging.

20
Conclusion
This project successfully demonstrates an automated water level monitoring and control system
using an Arduino Uno, ultrasonic sensor, relay module, and a DC pump. By accurately
measuring the water level in real time, the system ensures the pump is turned off when a
predefined water level is reached, thereby preventing overflow. The use of a relay module
enables safe and effective control of the pump, while the buzzer provides a simple auditory
indication of tank full condition.

The integration of components was achieved with proper electrical isolation and independent
power management, ensuring system stability and preventing damage to the microcontroller. The
circuit was tested and verified to function as intended, with the pump remaining off once the tank
is full, even if the water level drops slightly afterward.

This project serves as a practical and scalable solution for water management in households,
agriculture, or industrial settings, contributing towards resource conservation and automation.

21

You might also like