You are on page 1of 40

KYAMBOGO UNIVERSITY

FACULTY OF ENGINEERING
DEPARTMENT OF ELECTRICAL AND ELECTRONICS
A GSM LIQUID LEVEL DETECTOR
Project Report in Partial Fulfillment of Requirement for Award of Bachelors
of Engineering in Telecommunications Engineering
GROUP PROJECT PRESENTATION, year3 May 2021
TETE 3206
GROUP PARTICIPANTS

NAMES REGISTRATION
NUMBERS

KIMERA NOBERT 17/U/9180/ETD/PD

MIREMBE 17/U/9226/ETE/PE
CATHERINE

KIDEGA ALDO 19/U/18423/ETD/GV

PROJECT SUPERVISOR: Mr. Imuko Joseph

Date of Submission:__________________
DECLARATION
I KIMERA NOBERT do hereby declare that to the best of my knowledge and belief this report
is my original work and has never been submitted to any other University, college, or Institution
of higher learning for the purpose of meeting any academic requirement. It is therefore authentic
and where any references or secondary information have been used, they have been given due
acknowledgement.
Signature …………………
KIMERA NOBERT
(Reporter)-17/U/9180/ETD/PD
Date ……………………….

i
APPROVAL
I Mr. Imuko Joseph certify that, I have supervised and guided the students in the project entitled
“A GSM LIQUID LEVEL DETECTOR” and that in my opinion, it confirms to accepted
standards of scholarly project in partial fulfillment for the award of Bachelor of
Telecommunications Engineering at KYAMBOGO UNIVERSITY.

Signature ……………………… Date …………………….


Mr. IMUKO JOSEPH
PROJECT SUPERVISOR

ii
DEDICATION
I dedicate this report to my family of Mr.& Mrs. Tumwebaze R Geoffrey which gave me the
courage, advice and financial support during my project implementation period. I also dedicate
it to all my colleagues with whom I struggled especially Mirembe Catherine and Kidega Aldo,
my project supervisor Mr. Imuko Joseph who helped me in cases of need in the project from
scratch to the end, thanks for the great work done.

iii
ACKNOWLEDGEMENT
First and foremost, I would love to thank the Almighty God for enabling me start and
successfully complete my project implementation. I thank Him for his unceasing protection,
guidance and life throughout my research.
God for life and knowledge, my family for all the support they provided. Colleagues for support
and group discussions. Supervisor, lecturer Mr. Imuko Joseph for insight into concepts of research
and project management as well as technical knowledge applied in the design of the system.

iv
Table of Contents
DECLARATION.......................................................................................................................................... i
APPROVAL ................................................................................................................................................ ii
ACKNOWLEDGEMENT ......................................................................................................................... iv
List of Figures............................................................................................................................................. vi
List of Acronyms ....................................................................................................................................... vii
ABSTRACT .............................................................................................................................................. viii
CHAPTER ONE ......................................................................................................................................... 1
1.0 BACKGROUND ............................................................................................................................... 1
1.1 PROBLEM STATEMENT .............................................................................................................. 1
1.2 OBJECTIVES ................................................................................................................................... 1
1.2.1 Main Objective. .......................................................................................................................... 1
1.2.2 Specific Objectives. .................................................................................................................... 1
1.3 JUSTIFICATION ............................................................................................................................. 2
1.4 SIGNIFICANCE ............................................................................................................................... 2
1.5 SCOPE ............................................................................................................................................... 2
CHAPTER 2 ................................................................................................................................................ 4
2.0 LITERATURE REVIEW ................................................................................................................ 4
2.1 Project methodology ......................................................................................................................... 4
2.2 Tools Used in Project. ....................................................................................................................... 5
2.3 Circuit configurations. ...................................................................................................................... 9
2.3.1 BLOCK DIAGRAM .................................................................................................................. 9
2.3.2 CIRCUIT DIAGRAM ............................................................................................................. 10
2.4 PROJECT CODE. .......................................................................................................................... 16
2.5 Budget .............................................................................................................................................. 28
CHAPTER 3 .............................................................................................................................................. 29
3.1 CHALLENGES FACED DURING PROJECT CONSTRUCTION .......................................... 29
3.2 RECOMMENDATIONS ................................................................................................................ 29
3.3 CONCLUSIONS ............................................................................................................................. 29
REFERENCES .......................................................................................................................................... 30

v
List of Figures
Figure 1 Circuit Block Diagram.................................................................................................................... 9
Figure 2 Simulated Circuit Diagram ........................................................................................................... 10
Figure 3 Power Supply Circuit Diagram..................................................................................................... 10
Figure 4 Input Circuit Control Block .......................................................................................................... 12
Figure 5 Microcontroller (Arduino NANO) ............................................................................................... 13
Figure 6 Circuit Flowchart .......................................................................................................................... 14
Figure 7 Circuit Output Block .................................................................................................................... 15
Figure 8 PHOTO OF HARDWARE CIRCUIT .......................................................................................... 28

vi
List of Acronyms
ac – Alternating Current

dc – Direct Current

LED – Light Emitting Diode

LCD – Liquid Crystal Display

GSM – Global System for Mobile Communications

PS – Power Supply

mc - Microcontroller

vii
ABSTRACT
Chapter 1, contains identifying the problem, hypothesis and observations made in arriving at the
solution of reducing water shortage and prevention of liquid overflows plus bursting of water
reservoirs. The various advantages of our project are also discussed in this chapter, the project
coverage is entailed.
Chapter 2, is basically the literature review of our project composed of procedures of design and
construction of the liquid level detector based on GSM communication.
Chapter 3, consists of challenges faced during project implementation, future expectations,
recommendations and conclusions.
Generally, this project presents design and construction of a liquid level and overflow detector in
a liquid reservoir. The project prevents danger and wastage caused by liquid overflow and bursting
of reservoir to our home’s equipment and property, by indicating real-time level of the liquid in
the reservoir.

The Ultra-sonic sensor sends a signal to surface of water which is then reflected back to sensor
and re-transmitted to microcontroller, which processes sensor data and outputs: real-time digital
numeral data via LCD, notification messages via GSM-module and an alarming alert via a buzzer,
based on rules in the flowchart.

viii
ix
CHAPTER ONE
1.0 BACKGROUND
Environmental degradation has become a common practice in Uganda which includes
destruction of many wetlands leading to scarcity of resources like water. Due to increased
urbanization and industrialization people no longer fetch water directly from water bodies
but rather use overhead and underground reservoirs.

It’s hard and difficult to manually control and monitor level of water in a large reservoir
that has a constant inlet, as a result, leakages and careless handling of reservoirs has ended
up bursting, overflowing and has led to wastage of scarce resources (water).

Therefore, this project presentation is about a developed control system which automates
the water level detection operations at the reservoir using microcontrollers and ultra-sonic
sensors while coordinating with the LCD, buzzer and GSM-module for notifications.

1.1 PROBLEM STATEMENT


The major challenges faced by the Ugandan National Water system is the increasing
overflows and bursting of water reservoirs causing wastage and damage. The existing
system also involves the manual operations by site keepers, based on the information
received from the control room. The human errors such as delay in informing the site
keeper about the overflows, failures to identify reduction of water, etc; all these lead to the
increased scarcity and wastage of water.

1.2 OBJECTIVES
1.2.1 Main Objective.
To design and construct a control system for monitoring and controlling the liquid level in
a liquid reservoir such as overhead and underground water tanks.

1.2.2 Specific Objectives.


• Studying more related literature about existing water level detection system.

• Identifying the components required in the design, and construction of project prototype.

1
• Simulating the system performance and make adjustments where need arises.

• Designing, constructing the project and make final documentation report on the project.

1.3 JUSTIFICATION
The system has the potential to monitor and prevent damages caused by overloading of
reservoirs leading to bursting or exploding of the reservoir causing wastage of liquid
resources. Also helps to reduce ‘shortage of water time’ due to failure of humans to easily
tell reduction below minimum level.

The system assist in both timely message notifications to users via GSM-module and
alarming sound via a buzzer to alert users close/open the inlet in-case of
maximum/minimum levels respectively thus solving above technical problems.

1.4 SIGNIFICANCE
The benefits of the project;

• The project aims at reducing deaths and accidents such as drowning, falling from heights
etc. that humans face in trying to manually monitor liquid levels in reservoirs.

• Its fast and quicker in action than a human, users are notified in time to allow preparations
and Safety of users is ensured.

• This system is automatic and reliable, saves on the costs of paying the site keepers.

• This system also is more accurate and efficient since if gives real-time information about
water level if needed any time.

• Property destruction due to overflowing is differentiated or reduced.

• Shortage time that affects industries’ cooling systems is reduced

1.5 SCOPE
This project proposes a system that can measure real-time quantity/levels of fluid content
in the reservoir via an ultrasonic sensing system placed above the reservoir.

2
The project entails an alerting system i.e. alarm, and a message notification system i.e.
GSM-module, when the liquid is at maximum or minimum level so that user turns OFF/ON
the inlet valve.

The system does not include an automatic control for inlet of water into the reservoir.

3
CHAPTER 2
2.0 LITERATURE REVIEW
Over 50 years ago Uganda as a country started to store water in tanks for both domestic and
industrial uses, and this enhanced manual operated controls of inlets to water tanks and water levels
in the tanks. In early 2000’s monitoring methods of determining level of petrol in reservoirs were
introduced suchas immersion detectors etc, this idea was later borrowed by water companies to
monitor levels in water tanks this could notify through alarming, LCD displays and LED lighting
for low, moderate and high levels in the tanks. This method of immersion detectors seemed untidy
because of risks of rusting, chemical reactions etc. thus poisoning water for human consumption.

In order to reduce risks of poisoning water for domestic uses, ultrasonic sensor based systems were
introduced. The ultrasonic sensor is placed on top of the tank and its echoing action of sending and
receiving the ultra-Sound waves helps it to determine the actual level of water based on the
dimensions of the water tank. This helps to reduce contamination of water for domestic and food
processing in industries.

The existing water level detection methods are less efficient and monitoring of water levels is still
lagging, therefore our research intends to reduce the lag by introducing a GSM module working
with the existing methods, for SMS notifications to the user for maximum or minimum level in
the reservoirs. Anytime the user can send text message to the GSM to be notified about the level
of water in the tank at that instant. This interactive feature aids in long distance monitoring of
water levels in the reservoirs, therefore is more efficient compared to the existing modes of level
detection.

2.1 Project methodology


Studying more related literature about existing water level detection system, which included
Internet research, Consultations from homes with water tanks in Banda Community. This resulted
in obtaining Knowledge related to existing liquid level detection systems.

Identifying the components required in the design, and construction of project prototype, that
involved Research on design of control systems, Component purchasing thus we were able to
Design of simple flowchart and Gather system components.

4
Simulating the system performance and make adjustments where need arose, that consisted of C++
program writing, Consultation from the project supervisor and Simulating the design with Arduino
software. As a result we modelled system block diagram and came up with Final design of system
flowchart to give accurate results.

Designing, constructing the project and make final documentation report on the project, procedures
to achieve this were Consultation from technical supervisor, Assembly and soldering, Internet
research. This in turn led to Software circuit diagram and Hardware circuit construction,
presentation to panelists and project report writing.

2.2 Tools Used in Project.


Bucket. This was used as the water reservoir while designing and implementing our sample
project. The sensing circuit was placed on top of the bucket for monitoring water levels and giving
us real-time notifications via LEDs (red, green and blue), LCD display, alarm (buzzer) and GSM
module. Water was poured manually and the bucket had an outlet (tap).

Connecting Wires. These acted as jumpers on our hardware circuit, connecting different
components for complete processing and communication.

Transformer. Was used for stepping down 240Vac to 12Vac with a turns ratio of 20:1, 12Vac
was converted to 12Vdc by the bridge rectifier for powering the GSM in parallel with a 7805
Voltage Regulator, that only allows 5Vdc to power other circuit components.

5
Capacitors. For filtering ac ripples from the dc Voltages to power up circuit components.

Resistors. For limiting current flowing through active circuit components such as diodes, relay
switch.

Transistor. Used to amplify power used to operate the buzzer.

Ultrasonic Sensor. Sends ultrasound signal to water surface using the trigger and the receiver
receives the reflected signal. The time taken by ultrasound signal to reach receiver is divided by
two, recorded and sent to the microcontroller for processing.

6
Microcontroller (Arduino Nano). This is the brain of the project i.e. buffer for storing,
processing, decision making and execution of commands (procedures and guidelines) for an
efficient output. All the programing for our group project is done here.

Buzzer (Alarm notification). Beeps (about 5seconds) when the water level is below minimum
level of the tank and also beeps (about 60seconds) when the water level is above the maximum
level.

LCD Display. We used a 2x16 line LCD Display which displays real-time information (Water-
Level, Water-Volume and Height) on the screen.

LED (Red, Green and Blue). Our project is designed to keep some water in the tank, so all LEDs
go OFF when the tank is empty. Red LED lights when water level is at/below minimum level,

7
Green LED lights when water level is between minimum and maximum levels, while Blue LED
lights when water level is at/above maximum level.

GSM-Module. A Global System for Mobile Communications module has a SIM800L for
receiving SMS alerts from microcontroller and sending SMS alerts to the user in real-time. If a
user sends a command ‘LEVEL’ to the GSM, its requests water level information from the
processor and in turn delivers real-time water level and volume to the user at that particular instant.

Breadboard. This is where the final hardware circuit was designed for effective processing and
communication of components in our group project implementation. A soldering gun enabled us
in assembling of the circuit.

8
2.3 Circuit configurations.
2.3.1 BLOCK DIAGRAM

Figure 1 Circuit Block Diagram

9
2.3.2 CIRCUIT DIAGRAM

Figure 2 Simulated Circuit Diagram

POWER SUPPLY

Figure 3 Power Supply Circuit Diagram

This block is used to supply electrical energy to all the components in the circuit.

Its composed of AC voltage source V1, transformer T1, diodes D1, D5, D6, D7; capacitors C3,
C4; and voltage regulator RG1.

10
V1 is the 240V AC mains from the national grid which is stepped down to 12V AC by T1. diodes
D1, D5, D6 and D7 form a full wave rectifier which converts the 12V AC into 12V DC. C3 and
C4 filter out the AC ripples in the DC voltage to form a constant 12V dc supply to the rest of the
components in the circuit.

RG1 is used to give a supply of 5V from 12V; to components that require 5v DC.

The capacitance value C3 for first filter capacitor is got from

C = I / (V x F);

C = 1.2 / (12 x 100)

C = 1000uF

I = current output to circuit load

V= voltage output from bridge rectifier;

F = DC ripple frequency from the bridge rectifier.

The capacitance value C4 for first filter capacitor is got from

C = I / (V x F);

C = 0.05 / (5 x 100)

C = 100uF

I = current output to circuit load

V= voltage output from regulator RG1;

F = DC ripple frequency from the bridge rectifier.

11
INPUT CONTROL BLOCK

Figure 4 Input Circuit Control Block

This block captures raw signals from input components which it sends to the microcontroller for
processing.

It's made up of GSM module, ultrasonic module, resistor R2 and switch SW1.

 GSM communication

The GSM module is a component that creates a path of communication between this system circuit
and a mobile telephone network via GSM band to the user’s mobile handset/phone.

Through the mobile phone, the user is able to send command signals to this system via the GSM
module which sends them to the microcontroller in the next stage to process them into meaningful
information.

 Water level sensing

This is used to detect the height of the water in the tank as a way of monitoring it.

The sensor used to detect the water height is an ultrasonic distance sensor which has got both the
ultrasonic waves transmitter and receiver such that the transmitter sends out ultrasonic waves
which when it meets the water surface are reflected back to the receiver. The receiver generates a
signal that’s proportional to how long it took the waves to be received back after it had been
transmitted. This signal is sent to the microcontroller in the next stage for processing.

12
 Alarm switch

Switch SW1 sends a signal to the microcontroller whenever pressed which makes the alarm to be
switched off.

When pressed, switch SW1 and resistor R2 form a potentiodivider that generates a digital signal
that is sent to the microcontroller for processing.

R2 also limits current through the switch when pressed to avoid its damage due to excess current
flowing through it and its value is got from;

From V = IR; V = 5v and I = 0.5mA

R = 5/0.0005
R = 10000 ohms

PROCESSING

Figure 5 Microcontroller (Arduino NANO)

This block made up of an Arduino Nano microcontroller; that is programmed using C++ language
to interpret the signals from the input components while deciding how to control the output
components in the next block depending on the program written into it.

Below is a flow chart of a program written for a microcontroller to execute.

13
Figure 6 Circuit Flowchart
14
OUTPUT BLOCK

Figure 7 Circuit Output Block

These block contains subsection components that are used majorly for responding to processed
signals from the microcontroller. These include;

 LCD display LCD1

This is used to display the water level value in the tank; and other notifications for the user to
read

 GSM communication

The GSM module is a component that creates a path of communication between this system circuit
and a mobile telephone network via GSM band to the user’s mobile handset/phone.

Through the GSM module, this system is able to wirelessly send processed information such as
the water level and other notifications to the user’s mobile handset/phone.

 LED indication

This is used for indicating the water levels in the tank by use of various colors of light emitting
diodes (LEDs).

It’s made up of resistors R1, R3, R5; LEDs D2, D3 and D4.

15
The LEDs D2, D3 and D4; the light up various colours; each for a certain level range of water
height i.e. low level, medium level or high/full level.

Resistors R1, R3 and R5 limit current flowing through LEDs D1, D3 and D4 respectively and their
value is got from

From V = IR; V = 5v and I = 0.0025mA


R= 5/0.0025
R= 2000 ohms

 Alarm notification

This is used to make an audio tone in case of any critical notification such as low water level,
full tank etc.
The audio tone is sounded by the buzzer BZ1 is turned on by a microcontroller signal via a
current limiting resistor R6 and transistor Q1.
The value of R6 is obtained from;
From V = IR; V = 5v and I = 0.0025mA
R= 5/0.0025
R= 2000 ohms

2.4 PROJECT CODE.

#include <SoftwareSerial.h>

SoftwareSerial SMS(2,5); // (Rx,Tx > Tx,Rx)

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);// Set the LCD address to 0x27 OR 0X37 for a 16 chars
and 2 line display

int ULTRASONIC_TRIGGER = 3;

16
int ULTRASONIC_ECO = 4;

int ALARM = 12;

int BLUE_LED = 10;

int RED_LED = 6;

int GREEN_LED = 8;

int SWITCH = 7;

float DURATION = 0;;

float WATER_SURFACE_DISTANCE = 0.00;

float AREA = 0.00;

float WATER_HEIGHT = 0.00;

float AVERAGE_RADIUS_OF_THE_TANK = 0.00;

float WATER_VOLUME = 0.00;

int WATER_PERCENTAGE = 0.00;

int X = 0;

int Y = 0;

int Z = 0;

char Message_Bytes;

String Message;

void setup(){

pinMode(ULTRASONIC_ECO, INPUT); // make the ULTRASONIC_ECO to be an input

pinMode(SWITCH, INPUT); // make the ULTRASONIC_ECO to be an input

pinMode(ULTRASONIC_TRIGGER, OUTPUT); // make the trigger pin to be an output.

17
pinMode(ALARM,OUTPUT); // make ALARM pin to be an output

pinMode(BLUE_LED,OUTPUT); // make ALARM pin to be an output

pinMode(RED_LED,OUTPUT); // make ALARM pin to be an output

pinMode(GREEN_LED,OUTPUT); // make ALARM pin to be an output

lcd.begin(); // tell the microcontroller which kind of lcd is connected to it ie for 16 columns
and 2 rows

Serial.begin(9600); //( baudrate) the rate at which information is sent to the serial monitor.

SMS.begin(9600); //( baudrate) the rate at which information is sent to the GSM module.

while(!SMS.available())

SMS.println("AT");

delay(2000);

Serial.println("Connecting...");

Serial.println("Connected!");

SMS.println("AT+CMGF=1"); //Set SMS to Text Mode

delay(2000); // ms

SMS.println("AT+CNMI=1,2,0,0,0"); //Procedure to handle newly arrived


messages(command name in text: new message indications to TE)

delay(2000);

SMS.println("AT+CMGL=\"REC UNREAD\""); // Read Unread Messages

delay (100);

18
}

void loop(){

//////section for water WATER_SURFACE_DISTANCE sensinsing using ultrasonic sensor.

digitalWrite(ULTRASONIC_TRIGGER, LOW); // turn off the trigger pin

delayMicroseconds(1); // wait for uS

digitalWrite(ULTRASONIC_TRIGGER, HIGH); // turn on the trigger pin

delayMicroseconds(1); // wait for 1uS

digitalWrite(ULTRASONIC_TRIGGER, LOW); // turn off the trigger pin

DURATION = pulseIn(ULTRASONIC_ECO, HIGH); // listen to get how float it takes to


recieve back the reflected sound wave

WATER_SURFACE_DISTANCE = (DURATION/2) / 29.1;


//WATER_SURFACE_DISTANCE is half the time taken divided by 29.1 uS/cm, the time
sound travels per centimeter

//Serial.println(WATER_SURFACE_DISTANCE);

AVERAGE_RADIUS_OF_THE_TANK = 14.00; //units in cm

AREA = 3.141592654 * 14.00 * 14.00; // A = PI * raduis squared and PI=3.141592654

WATER_HEIGHT = 33.00 - WATER_SURFACE_DISTANCE; // 33.00cm is the total


height of the tank

if (WATER_HEIGHT < 0.00) {

WATER_HEIGHT = 0.00;

WATER_VOLUME = WATER_HEIGHT * AREA / 1000; // divide by 1000 to convert


from cm3 to litres

19
WATER_PERCENTAGE = 100 * WATER_HEIGHT / 33;

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Volume= ");

lcd.print(WATER_VOLUME);

lcd.print("L");

lcd.setCursor(0,1);

lcd.print("Height= ");

lcd.print(WATER_HEIGHT);

lcd.print("cm");

delay (2000);

if ( WATER_PERCENTAGE <= 20) {

digitalWrite ( RED_LED , HIGH );

digitalWrite ( GREEN_LED , LOW );

digitalWrite ( BLUE_LED , LOW );

digitalWrite ( ALARM , HIGH )

delay (250);

digitalWrite ( ALARM , LOW );

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Volume= ");

lcd.print(WATER_VOLUME);

lcd.print("L");

20
lcd.setCursor(0,1);

lcd.print("Low water level");

delay (2000);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Volume= ");

lcd.print(WATER_VOLUME);

lcd.print("L");

lcd.setCursor(2,1);

lcd.print(WATER_PERCENTAGE);

lcd.print("% Available");

delay (2000)

if (( WATER_PERCENTAGE > 20) && ( WATER_PERCENTAGE <=70)) {

digitalWrite ( RED_LED , LOW );

digitalWrite ( GREEN_LED , HIGH );

digitalWrite ( BLUE_LED , LOW );

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Volume= ");

lcd.print(WATER_VOLUME);

lcd.print("L");

21
lcd.setCursor(2,1);

lcd.print(WATER_PERCENTAGE);

lcd.print("% Available");

delay (2000);

X = 1; // reset x

Y = 1; // reset x

// Z = 1; // reset x

if ( WATER_PERCENTAGE > 70) {

digitalWrite ( RED_LED , LOW );

digitalWrite ( GREEN_LED , LOW );

digitalWrite ( BLUE_LED , HIGH );

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Volume= ");

lcd.print(WATER_VOLUME);

lcd.print("L");

lcd.setCursor(2,1);

lcd.print(WATER_PERCENTAGE);

lcd.print("% Available");

delay (2000);

22
if ( WATER_PERCENTAGE > 95) // cm

//digitalWrite ( ALARM , HIGH );

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Volume= ");

lcd.print(WATER_VOLUME);

lcd.print("L");

lcd.setCursor(0,1);

lcd.print("Tank is full!");

//Serial.println (digitalRead(SWITCH));

if ( (digitalRead(SWITCH))== HIGH )// if switch is pressed

//if ( Z == 1 )

digitalWrite ( ALARM , LOW );

delay (500);

// Z = 0;

if ( WATER_PERCENTAGE < 5) // cm

if ( X == 1 ) // make it once

23
Serial.println("Sending message....."); // message to be sent

delay(100);

SMS.print("AT+CMGS=\"0701868654\"\r\n"); // phone number

delay(1000);

SMS.println("NOTICE!"); // message to be sent

SMS.println("The water level in the tank has completely gone low"); // message
to be sent

SMS.print(""); // message to be sent

SMS.print("Water volume = "); // message to be sent

SMS.print(WATER_VOLUME); // message to be sent

SMS.println("L"); // message to be sent

SMS.print("Water height = "); // message to be sent

SMS.print(WATER_HEIGHT); // message to be sent

SMS.println("cm"); // message to be sent

SMS.print("Water percentage = "); // message to be sent

SMS.print(WATER_PERCENTAGE); // message to be sent

SMS.println("%"); // message to be sent

SMS.println(""); // message to be sent

SMS.println("Please, turn on the water supply to fill the tank!"); // message to


be sent

delay(1000);

SMS.println((char)26); // message complete hence send it

delay(1000);

24
Serial.println("Message sent"); // message to be sent

X = 0;

if ( WATER_PERCENTAGE > 95) // cm

if ( Y == 1 ) // make it once

Serial.println("Sending message....."); // message to be sent

delay(100);

SMS.print("AT+CMGS=\"0701868654\"\r\n"); // phone number

delay(1000);

SMS.println("NOTICE!"); // message to be sent

SMS.println(""); // message to be sent

SMS.println("The tank is full. Please, turn off the water supply to the tank!");
// message to be sent

delay(1000);

SMS.println((char)26); // message complete hence send it

delay(1000);

Serial.println("Message sent"); // message to be sent

Y = 0;

digitalWrite ( ALARM , HIGH );

25
}

while (SMS.available()>0)// if any bits coming from the GSM to microcontroller are greater
than zero bytes,

delay(100);

// Serial Buffer

while(SMS.available())

Message_Bytes = SMS.read();

Message += Message_Bytes;

delay(1000);

Serial.println(Message);

Message.toUpperCase(); // Uppercase the Received Message

if (Message.indexOf("LEVEL") > -1)

Serial.println("Sending message....."); // message to be sent

delay(100);

SMS.print("AT+CMGS=\"0701868654\"\r\n"); // phone number

delay(1000);

SMS.println("Below is the information pertaining water in the Tank"); //


message to be sent

SMS.print(""); // message to be sent

26
SMS.print("Water volume = "); // message to be sent

SMS.print(WATER_VOLUME); // message to be sent

SMS.println("L"); // message to be sent

SMS.print("Water height = "); // message to be sent

SMS.print(WATER_HEIGHT); // message to be sent

SMS.println("cm"); // message to be sent

SMS.print("Water percentage = "); // message to be sent

SMS.print(WATER_PERCENTAGE); // message to be sent

SMS.println("%"); // message to be sent

delay(1000);

SMS.println((char)26); // message complete hence send it

delay(1000);

Serial.println("Message sent"); // message to be sent

delay(1000);

if (Message.indexOf("OK") == -1) //Delete Messages & Save Memory

delay(50);

SMS.println("AT+CMGDA=\"DEL ALL\"");

//SMS.println("AT+CMGD=1,4"); // delete all SMS

delay(1000);

27
//*/

// SMS.println("AT+CMGDA=\"DEL ALL\"");

Message = "";

delay (500);

Figure 8 PHOTO OF HARDWARE CIRCUIT

2.5 Budget
ITEMS AMOUNT (Ugx)
RESEARCH/CONSULTATIONS 100,000/=
COMPONENTS 250,000/=
TOOLS 100,000/=
STATIONERY 50,000/=
MISCELLENOUS 50,000/=
TOTAL 550,000/=

28
CHAPTER 3
3.1 CHALLENGES FACED DURING PROJECT CONSTRUCTION
The Pandemic COVID-19 greatly affected us because we as group members could not meet to
discuss due to the lockdown, facial interaction with the project supervisor was limited and also
increased prices of components and tools we used.
Financial challenge to facilitate the project up to the end.
Difficulty in using some equipment and tools such as the GSM module since it was our first time
to interact with such components.
3.2 RECOMMENDATIONS
• For this project to find effective application there is need for further development and
testing as it was only limited on a small range of data.

• More so, more research should be done on the control part to be embedded in the system

• The microcontroller with LCD and GSM makes it user friendly and can be embedded in a
single unit. The circuit has been implemented on bread board and tested for its functionality
by varying the distance between the transducer and the target. The target surface needs to
be perpendicular to the impinging ultrasound waves. The power level of the signal is too
low for long range measurement.

• Future Work, The range can be considerably increased by using high power drive circuit.

3.3 CONCLUSIONS
• Stated objectives have been achieved.

• The demonstration on how the circuit works is as presented to the panel of examiners.

• Through this project we also discovered that this approach would be a very effective way
of saving time, resource and management of liquid resources in reservoirs

29
REFERENCES
• [1] A. S. Morris, R. Langari, Measurement and instrumentation theory and application,
Elsevier, (2012).

• [2] W. Hongqi, L. Xia, Design of measurement and control system for oil level of wells,
2nd International Conference on Instrumentation & Measurement, (2012).

• [3] W. Zhang, Based on atmega 16 ultrasonic distance gauge, International Conference


Electrical and Control Engineering (2011).

• [4] H. Canbolat, A novel level measurement technique using three capacitive sensors for
liquids, The Instrumentation and Measurement 58 (2009) 3762-3768.

• [5] Advanced Control Engineering by Roland S. Burns 2001

30

You might also like