Nzioka Shadrack- 637057
Water Level Indicator- A project report
Digital Electronics- APT 2030
Dr Sylvester Namuye
USIU- Africa
Spring 2016
Contents
Contents ........................................................................................................................................................ 2
ABSTRACT ...................................................................................................... Error! Bookmark not defined.
INTRODUCTION ............................................................................................. Error! Bookmark not defined.
TOOL / APPARATUS ....................................................................................... Error! Bookmark not defined.
PROCEDURE ................................................................................................... Error! Bookmark not defined.
Fig 1. The circuit schematic using #fritzing. Open Source tool for circuit drawing................................... 5
OBSERVATION OF THE EXPERIMENT ............................................................ Error! Bookmark not defined.
Fig 2. This massage is displayed when the water level is at approx. 15% and the Green led Lights up ... 9
Fig3: This massage is displayed when the water level is at approx. 30-50 % and the blue led Lights up
................................................................................................................................................................ 12
Fig 4.This massage is displayed when the water level is at approx. 70-100 % and the red led Lights
upwhich in turn turns up the buzzer. ..................................................................................................... 14
DICUSSION AND ANALYSIS ............................................................................ Error! Bookmark not defined.
CONCLUSION ................................................................................................. Error! Bookmark not defined.
RECOMMENDATION. ..................................................................................... Error! Bookmark not defined.
Reference .................................................................................................................................................... 15
Abstract
This project is about water level indicator using raspberry pi. In this project we used led to
indicate the different levels and the raspberry pi to display were exactly the level is at in terms of
percentages. The simple water level indicator will activate an active buzzer which will make a
continuous noise when a certain level of water is reached (maximum).
Introduction
The project was conducted to show how to computers can interact with the outside world. That is
the circuit that is constructed and controlled with a raspberry pi. Raspberry Pi is a low cost,
credit-card sized computer that plugs into a computer monitor or TV, and uses a standard
keyboard and mouse. It is a capable little device that enables people of all ages to explore
computing, and to learn how to program in languages like Scratch and Python.
Tool/Apparatus
Raspberry Pi was the main tool in this project since it was the one to display the level of the water.
Code was written to display what the LED meant.
Wires for connections was need to connect the different apparatus used in the experiment. One
Buzzer to produce sound when the water level reaches the maximum level. (70-100% In our case)
Bread Board was to be like the base. It holds up all the equipment together by completing the circuit
GPIO Extension Board was used to connect the raspberry pi with the bread board.
3 LED (green, blue, red) this will be our indicator. The 3 LED will indicate 3 levels of the water
almost empty (15% of water available), the other one will be 30-50% of water is in the can and the
final one is the can is almost full 70-100% full.
A Water Can, Of Course is to portray a water tank. The can will be two, one with water and
the other without.
Procedure
The circuit was connect as shown in the diagram below.
Fig 1. The circuit schematic using #fritzing. Open Source tool for circuit drawing.
1. First the raspberry pi was connected and the software were updated
2. Then the raspberry pi and the bread board were connected using the GPIO extension
board.
3. GPIO pin’s 18,24, and 25 were to the LED that was on the bread broad as shown. This
GPIO were the out pins.
4. Then the GPIO pins 22, 6 and 26 were connected and the cable left hanging for the input
of the different LED’S
5. The buzzer is connected to the red LED so that it will produce sound when the water
level is reaches maximum level.
6. Two ground cable were connected from the GPIO pins. And one ground cable is
connected to the bread board. This cable will go in the base of the can so that when the
other cable is in the water the circuit is completed.
7. Simple python code is written to display the messages at different levels.
Observation of the experiment
In the observation they are four things involved:
The can
Raspberry
The water and
Wires connected to the breadboard
First of all the can should be empty before putting the wires in the can, then run the code in the
raspberry pi, which will show you that the can is totally empty
Fig1: This message is displayed when the can is empty and no LED is on.
Fig 2. This message is displayed when the water level is at approx. 15% and the Green LED
Lights up
Fig3: This message is displayed when the water level is at approx. 30-50 % and the blue led
Lights up
Fig5: This shows that the can is almost full and the buzzer turns on with a continuous beep.
Fig 4. This message is displayed when the water level is at approx. 70-100 % and the red led
Lights up which in turn turns up the buzzer.
Discussion and Analysis
In this experiment we used a simple python code that gets the input from the water through the
GPIO pins 6, 22 and 26and sends an output to the LED through the GPIO pins 18, 24 and 25.
The outputs are controlled by the raspberry pi in such a way that only one led will light up at
different points or levels in this case. If all the LEDS are lights up as the water level rise it will
be meaning less to do the project with the raspberry pi.
INPUT OUTPUT
GPIO 6 GPIO 22 GPIO 26 GPIO 18 GPIO 24 GPIO 25
0 0 0 0 0 0
1 0 0 1 0 0
1 1 0 0 1 0
1 1 1 0 0 1
Fig 4: the table above shows the result of the GPIO pins as the inputs is received. Since the input
cable form the GPIO 6, 22, 26 are in the can, the water will rise up to the different levels the
cables are placed at. This will give out the input 1 at level one triggering the output of the pin 18
only. Then pin 6 and 22 will be in the water as it rises up giving pin 24 output hence turning it
on. Then finally pin 6 18 and 26 will all be in water therefore giving inputs to all the 3 pins. So
the output pin 25 will be 1 and the red LED will turn on. The buzzer is connected to the red LED
and hence it goes off giving a continuous beep.
Conclusion
In conclusion the raspberry pi was able to give out an amazing result. The water level was
indicated and displayed on the monitor. The led indicated the different levels we had in the
experiment.
Recommendations
Now that we know how this water level works it is really helpful if the volume of the water was
calculated and displays the exact volume in the can or tank. Another recommendation is creating
an interface which will display the virtual level of water in the tank and how it is rising or
dropping. The virtual water should be able to indicate the volume of water in the tank and be
able to calculate the water usage rate.
References
1 http://hackaday.com/2013/06/16/water-tank-level-meter-prevents-overflow/