Design and Fabrication of A Prototype Digital Water Level Controller using Ultrasonic Sensor Interfaced with Microcontroller

Reader Impact Factor Score
[Total: 1 Average: 5]

Published on International Journal of Engineering & Industry
Publication Date: June, 2020

Sylvester Emeka Abonyi, Paul C. Okolie, Anthony A. Okafor & Chinagorom Makutus Nawdike
Department of Mechanical Engineering, Nnamdi Azikiwe University Awka
Anambra State, Nigeria

Journal Full Text PDF: Design and Fabrication of A Prototype Digital Water Level Controller using Ultrasonic Sensor Interfaced with Microcontroller.

Abstract
This work designed and fabricated a prototype digital water level controller using ultrasonic sensor interfaced with microcontroller. The supply and overhead tanks were designed and fabricated with fiber glass of thickness 5mm. The electric pump was selected based on the capacity of the overhead tanks and its distance from the supply source. Polyvinyl Chloride (PVC) pipes were selected based on it’s a low carbon content, low cost, chemical resistance and ease of joining. The electronic circuit was designed and built using ultrasonic sensor, microcontroller, transistors and relays. Result obtained on testing shows that the controller regulates the ON and OFF of the pump depending on the different water levels in the overhead tank, and at a lower pump discharge, it takes longer time to fill the tank, while at high discharge the time taken to fill the overhead tanks is reduced.

Keywords: Ultrasonic sensor, microcontroller, electric pumping machine.

1. INTRODUCTION
1.1 Background of Study
Regulation of water pumped into a reservoir is very important to every home, offices and industries. Extraction of underground water to meet the unlimited demand for water is prevalent in recent time. To achieve this, there is need for an overhead tank or reservoir to store the water extracted from the underground water. Also an electric pumping machine that pumps water into the overhead tank is also needed. This process which is normally operated manually most often lead to overflow of water from the tank leading to waste of water due to lack of attention. The spillage from the overflow constitute breeding space for microbes and also causes erosion in locations that have permeable soil.
The introduction of digital level water controller will eliminate or reduce the problems associated with manually operated water pumping system and the integration of sensors to monitor and control the water tank refilling system will drastically reduce human contact and interactions with the operating system hence eliminate human error. Thus, this work was designed with an ultrasonic monitoring sensor to make the system a stand-alone unit that regulates the water pumping system into the reservoir.

1.2 Literature Review
Water is absolutely necessary element of life. The availability of water has played a key role in the development of all civilizations. In the ancient times, water scarcity prevented the development of settlements areas [1] (Starvous et al, 2015). Lack of available water contributes to search for water, conveying it over long distances, water saving and water lifting solutions (Antoniou et al, 2014).
Scarborough (2003) and Ortloff (2009) show how water management affected social structures and organization, with typical example in the Eastern and Western hemispheres, covering the whole ancient world. Then water transport over long distances was based on gravity. Securing water availability in region of high altitude required the expenditure of energy and that made the process inefficient.
(Mays, 2010) developed manually operated mechanical devices driven by human effort to supply water to a particular location. But this method had a limit at which it can deliver water because human effort is not exhaustive.
Water lifting devices have existed for centuries, in various parts of the world (Ann, 2009). (Oleson, 1984) Early devices such as water wheels and chutes were constructed and used animals (muscle energy) to provide the energy required for moving the wheels. This process is also limited because when the animal is exhausted the delivery of the water will stop.
(Tassios, 1998) invented pumps, such as helicoids pumps known as “Archimedean” and are still in use today. Also, several types of water lifting devices known as “tympana” (drums) were widely used for irrigation and mining, but worked for a limited number of hours and is switched off to avoid damage of the coil.
Finding portable water is about locating a water table which is always several feet below the surface of the ground and lifting the water up to the house is done via the use of electric pumping machine. Most common pump for a shallow well is a jet pump. Jet pumps are mounted above the well either in the home or in a well house, and draws the water up from the well through suction (Thomas, 1997). Consequently, the height that you can lift the water with a shallow-well jet pump relates to the weight of the air. While air pressure varies with elevation, it is common to limit the depth of a jet-pump-operated shallow well to about 25ft (Klenck, 1997).
Pumps are not intended to run continuously, and they don’t start each time you open a tap or flush the toilet. In order to provide consistent water pressure to the fixtures, the pump first moves water to a storage tank. The use of computers has played a major role in the recent advances in the design of automatic control systems. The most commonly used analogue computer is the electronic differential analyzer, in which voltages at various places within the computer are proportional to the variable terms in the actual systems. The analogue computer provides designers with the ability to simulate non-linear systems quickly (Bhupendra, 1969).

2. METHODOLOGY
2.1 Design diagram analysis
Detailed design drawings are initially done manually to develop dimensions and then using Solid Works, proper drawing details was done to standard. The drawing is analyzed using Ansys; a software that has proved highly effective at reducing final manufacturing cost and optimizing product performance. The software readily prepares design behavior of the components of the system with respect to values being in-put for forces and flow parameters which entirely describes the system.

Figure 1 Block diagram of a closed loop automatic system

2.2 COMPONENTS OF THE SYSTEM
Considering that this work is meant to solve the problem of manually supplying water to where they are needed either in homes, offices or industries, selection of suitable materials for this purpose is very important. The components are to be designed using proven electrical and electronic principles as well as fluid flow and material design principles, with focus on reducing complexity, hence, reduced high cost and energy requirement (Ikponmwosa, 2013). The components of the system are grouped into the following units:
1. The reservoirs
2. The frame.
3. Pipe, valves and pipe fittings
4. The pump
5. The power supply unit
6. The sensors
7. The control and display unit

Figure 2 Design diagram

2.2.1. The reservoirs
Two reservoirs which serve as source tank and the overhead tank, were constructed using fiber glass material of 5mm thickness. The fiber glass is a form of reinforced plastic, otherwise known as glass reinforced plastic or glass fiber reinforced plastics. It is light weight, strong and less brittle. This material was chosen to give an optimum result based on the design considerations. The glass sheet is cut into dimensions to give desired volume of the reservoirs and to obtain a uniform cross section through each of the tanks.

Dimensions for overhead tank: Length= 300mm, Width= 300mm and
Height= 600mm. Volume = 300mm×300mm×600mm = 540000mm3 = 54liters.
Dimensions for source tank: Length=400mm, Width=400mm, Height= 500mm.
Volume= 400mm×400mm×500mm 800000mm3 = 80liters. +
The volume of water to be contained in the sump tank will fill to 600mm height, i.e. 64litres, in order to allow some clearance in the tank to avoid overflow, while overhead tank will be filled to 500mm height i.e. 45litres and the level sensors for placed at a height of 100mm and 500mm respectively. The fiber glass sheets are cut into box shape and the glued using acrylic gum to avoid leakages.

(a) (b)
Figure 3 (a) Overhead tank and (b) source tank

2.1.2 Hydrostatic pressure in the reservoirs
When a liquid is at rest (i.e. not flowing), its pressure at a given depth can be determined. This is known as ‘hydrostatics. Hydrostatic pressure or the pressure a fluid exerts at equilibrium at a certain point in the fluid due to gravity increase at lower depths as the fluid can exert more force from the liquid above that point.
The hydrostatic pressure of a liquid in a tank as force per unit area of the bottom of the tank as given by
………………… (1)
Where: P= pressure F= force A= area
In this case, force will be the weight the liquid exerts on the bottom of the tank due to gravity. If the acceleration and mass is known, the force can be given as:
F= ma …………………. (2) Newton’s second law
Pressure can also be given in terms of density, gravity and height as
……………….. (3)
Where: density of liquid (water) acceleration due to gravity height of liquid
As regards the design of reservoir described above, it is important to calculate the pressure exerted by the liquid in order to know if the designed reservoir can withstand this pressure on its walls and how its joints will react relative to the pressure.
If the pressure exerted by the liquid at rest at a given depth is as stated in equation (3.3) above and the pressure exerted by the air above is given as , then the total pressure in the reservoir is given as:
………………. (4)
Where = atmospheric pressure = 101325Pa
Maximum hydrostatic pressure for overhead tank:
If: , , , and 101325Pa

Then;
P= 101325Pa + (1000×9.81×0.5) Pa
= 101325Pa + 4905Pa
= 110730Pa

Maximum hydrostatic pressure for source tank:
If: , , , and 101325Pa
Then;
P= 101325Pa + (1000×9.81×0.4) Pa
= 101325Pa + 3924Pa
= 105249Pa

2.1.3 The Frame
Having designed the two reservoirs for the system, the frame dimensions can readily be determined as well as carry out structural analysis. The frame is to be made of mild steel of about 2mm-3mm thickness in order to be able to withstand the vibration that will be caused by the pump.
To ensure that the frame dimensions are not over spaced (over design), nor under spaced either, the position of the two tanks and pipes connections were considered. The two tanks are to be placed to have a height difference of 700mm and placed at 100mm apart. The frame is thus dimensioned, height= 1350mm, length= 900mm, width = 500mm. Wheels are attached to the frame to aid moving it to different positions without being lifted from the ground.

Figure 4 Project design frame

2.1.4 Pipe and Pipe Fittings
Polyvinyl Chloride (PVC) pipe was selected for this project work because it’s a low carbon content, low cost, chemical resistance and ease of joining. They last long with a minimum of maintenance. Pipe fittings such as elbows, tees, valves, expanders, reducers, connectors, etc represent a significant component of the pipe pressure losses in most pipe systems. The design of this system involves water pumping through pipes and it is important to take into consideration these losses due to the fittings of the pipe.
The pressure losses through the pipe fittings and some minor equipment will be calculated using the K- value method. The K- value, Resistance Coefficient, Velocity Head, Excess Head or Crane method allows the user to characterize the pressure loss through fittings in a pipe. The K-value represents the multiple of velocity heads that will be lost by fluid passing through the fitting. It is more accurate than the Equivalent Length method, as it can be characterized against varying flow conditions (i.e. Reynold’s Number). The velocity head methods is named as such because it represents the pressure loss through a fitting as the equivalent number of “velocity heads”.

Figure 5 Pipe fitting: (a) union, (b) 900 Elbow, (b) Ball valve, (c) Male adapter

Formula for calculating head loss from K- values:
K pipe =
Where f = friction factor L = length of pipe d = internal diameter of pipe

Table 1. Calculating K fittings for the system under consideration

2.1.5 The electric water pump
Water is pumped from the reservoir into a receiving tank. This kind of arrangement is used to lift water from a reservoir, or river, into a water treatment works for treatment before the water goes into the supply network. The water level in the reservoir varies but the discharge level in the receiving tanks remains constant as the water is discharged from a point above the water level.
The pump is required to pass forward a flow of 3litres/sec to the overhead tank. The operating pressure of a pumped system is calculated in the SI unit of meters (m). To maintain dimensional consistency, any pressure values used within the calculations are therefore converted from kPa into m using the following conversion;
1 kPa = 0.102 m (as measured by a water filed U tube manometer). For the above system, the operating pressure or the total system head,
HTotal = HS + HD + (PRT – PRES) ………………… (1)
Where; H s = Static head (m), H D = Dynamic head (m)
PRT = Pressure on the surface of the water in the receiving tank (m)
PRES = Pressure on the surface of the water in the reservoir (m)
Although the atmospheric pressure changes with height, the change in pressure that occurs over the pumping height is often so small that it can be considered negligible. In this exemplar, the change in pressure over the elevation from the reservoir to the receiving tank is not that significant and hence is negligible, i.e.
PRT – PRES 0.
Therefore, equation (1) becomes:
HTOTAL= HS + HD ……………….. (2)
The static head HS is the physical change in elevation between the surface of the reservoir and the point of discharge into the receiving tank. As the water level in the reservoir can vary, the static head for the system will vary between a maximum and a minimum value:
HSmin= discharge level reservoir TW L HSmax = discharge level reservoir BW L
Where:
TWL = Top Water Level (reservoir) BWL = Bottom Water Level (reservoir)
As a result of the variation in the static head, the total system head, H Total , will also have a maximum and minimum value which we need to calculate here. The dynamic head is generated as a result of friction within the system. The dynamic head is calculated using the basic Darcy Weisbach equation given by:
HD = …………………… (3)
Where:
K = loss coefficient v = velocity in the pipe (m/sec) g = acceleration due to gravity (m/sec 2 )
We can calculate the velocity in pipe using the following formula:
Q= AV ……………………(4)
Where:
Q = flow rate through the pipe (m3 /sec) A = pipe cross sectional area (CSA) (m2)
V = velocity of flow (m/s)
If Q is 3litres/sec and the flow is pumped through a 1inch internal diameter pipe i.e. 1inch= 0.0254m
Then:
A= = = 1.27 × 10-4 m2
Hence, using equation (4), we get:
V = V = = 24.59 m/s

The loss coefficient K is made up of two elements:
K = K fittings + K pipe ………………….. (5)
K fittings is associated with the fittings used in the pipe works of the system to pump the water from reservoir to the receiving tank. Values can be obtained from standard tables and a total K fittings value can be calculated by adding all the K fittings values for each individual fitting within the system. The table shown in the table 3.1 above is used for the calculation of K fittings for the system under consideration.
Hence, the total K fittings for the system under consideration is 3.28.
These values will be used to determine the pump specification required.

Figure 6 Water Pump

2.2.6 Power supply unit
The power supply needed for this work is ac mains for the pump, but requires a dc supply for the micro-controller. This dc supply is obtained through s conversion process using inverter.

2.1.6 Sensors
The water level controller is an electronic circuit using ultrasonic sensor, transistors and relays. The circuit automatically switches the on the pump when water is low in the tank and switches the pump off when water reaches a predetermined level. The actuator is a power device that produces the input to the plant according to the control signal so that the output signal will approach the reference input signal.
The acoustic wave signal is an ultrasonic wave travelling at a frequency above 18KHz.
Typically, a micro controller is used for communication with the ultrasonic sensor. To begin measuring the distance, the micro controller sends a trigger signal to the ultrasonic sensor. When triggered, the ultrasonic sensor generates about eight acoustic (ultrasonic) wave bursts and initiates a time counter. As soon as the reflected (echo) signal is received, the timer stops. The output of the ultrasonic sensor is a high impulse with the same duration as the time difference between transmitted ultrasonic bursts and the received echo signal.
The micro controller interprets the time signal into distance which is theoretically measured using the TDR (time/distance/rate) measurement formula. Since the ultrasonic distance is the distance travelled from the ultrasonic transducer to the object – and back to the transducer – it is a two-way trip. By dividing the distance by 2, we can determine the actual distance from the transducer to the object.
Ultrasonic waves travel at the speed of sound (343m/s at 200C). The distance between the object and the sensor is half of the distance travelled by the sound wave, given as:

Fig 7. Sensor circuit diagram

Figure 8. the water level controller circuit

3. ANALYSIS AND TESTS
The digital water level controller system keeps the water level in the overhead reservoir from going dry by constantly adjusting its output (pump ON or OFF) depending on the input it gets from the water level sensor.
The adjustments made by the system refer to check for errors. So long the water level remains above the minimum, the system gives a positive feedback and the pump remains off. On sensing a lower level of liquid than the minimum, the system give a negative feedback or an error signal which turns on the pump to increase the level of water in the tank and correct this error. The level of the tank is the measured parameter here.
The system input, control, process, output and feedback are illustrated in the diagram below as in the conventional feedback control system

Figure 4.1 The system input, control, process, output and feedback

Transfer function is not practically applied but of great significance on paper which helps us to design any process parameter – i.e. how it will function and behave in the future with respect to stability. It is a mathematical function which says how input and output of system is transferred. The function thus gives us the idea of dynamics.
3.1 Test for control circuit sensor
The ultrasonic sensor module is interfaced with the microcontroller. When level distance measured in meters falls below a set point, the pump starts by sensing the signal coming out and receiving level coming to the ultrasonic transducer which is fed to the microcontroller. When the microcontroller receives the signal from the transducer it activates the relay through a MOSFET that operated the pump ON or OFF.
This test is carried out to ascertain how the sensor reacts when close to surfaces, both fluid and different kinds of solid surfaces. The table below shows the circuit displays of the state of the system (pump ON or OFF) in response to the sensor signal and at what distance from the sensor this occurs.

Table 2 Test for sensor response at different water level

The sensor detects water level by emitting short ultrasonic burst and then listening for the echo. Under control of a host microcontroller, the sensor emits a short 40KHz explosion which travels through air, hits an article and bounces back once again to the sensor.

From the above result, it could be seen that there is variation in distances at which the sensor detects water level and the display shows a pump on or off condition.

3.2 Tests for Rate of Discharge
This system can be used to determine the discharge of water by the delivery pipe at different speeds. The electric motor pump speed is varied using triac. For every speed at which the electric motor is turned, the time taken to fill the overhead tank is recorded and hence the discharge for that speed determined since the volume in this case is constant but the time it takes the sensor to shut down the pump at when the tank is full will vary.
The recorded values of time at different speed variation and the calculated discharge for each speed and time are used to plot a graph of speed against time and speed against discharge.

Fig 4 Graph of speed against time

Fig 5 Graph of speed against discharge

The results from the graphs shows that at a lower the speed, the longer time it takes to fill the tank, and at a higher the speed, the discharge will be higher and time taken to fill the overhead tanks will be reduced.

4. SUMMARY AND CONCLUSION
This work has achieved a control system design via rigorous processes that could regulate the pumping of water into an overhead tank or reservoir to avoid waste and eliminate human effort and time in operating the pumping machine that discharges water in the overhead tank. From the work ultrasonic sensor interfaced with the micro-controller is selected to the do the automation required. From the control panel display unit it can be observed at what level the tank has been fill at any time.
This control system and be installed in various homes, offices or industry to regulate the water supply to their various overhead tanks or reservoirs.

5. REFERENCES
1. Scarborough, V.L. The Flow of Power: Ancient Water Systems and Landscapes; School of American Research Press: Santa Fe, NM, USA, 2003; p. 204.
2. Ortloff, C.R. Water Engineering in the Ancient World—Archaeological and Climate Perspectives on Societies of Ancient South America, the Middle-East and South-East Asia; Oxford University Press: New York, NY, USA, 2009; p. 433.
3. Mays, L.W. A brief history of water technology during antiquity: Before Romans. In Ancient Water Technologies; Mays, L.W., Ed.; Springer Science and Business Media: Dordrecht, The Netherlands; 2010, Chapter 1, pp. 1–28.
4. Ann, C. History of Water Pumps, eHow Contributor. 2009. Available online: http://www.ehow.com/facts_5031932_history-water-pumps.html (accessed on 1st September 2019).
5. Oleson, J.P. Greek and Roman Mechanical Water-Lifting Devices: The History of a Technology; University of Toronto Press: Toronto, Canada, 1984.
6. Τassios, Τ. Hellenic Ancient Technology; Kathimerini: Thens, Greece, 1998.
7. Angelakis, A.N.; Mamassis, N.; Defteraios, P. Urban Water Supply, Wastewater, and Storm water Considerations in Ancient Hellas: Lessons Learned. Environ. Natl. Resource. Res. 2014, 4, 95–102.
8. Eubanks, B.M. The Story of the Pump and Its Relatives; Bernard M. Eubanks: Salem, OR, USA,1971; p. 185
9. Scarborough, V.L. The Flow of Power: Ancient Water Systems and Landscapes; School of American Research Press: Santa Fe, NM, USA, 2003; p. 204.
10. Ortloff, C.R. Water Engineering in the Ancient World—Archaeological and Climate Perspectives on Societies of Ancient South America, the Middle-East and South-East Asia; Oxford University Press: New York, NY, USA, 2009; p. 433.
11. Mays, L.W. A brief history of water technology during antiquity: Before Romans. In Ancient Water Technologies; Mays, L.W., Ed.; Springer Science and Business Media: Dordrecht, The Netherlands; 2010, Chapter 1, pp. 1–28.
12. Ann, C. History of Water Pumps, How Contributor. 2009. Available online: http://www.ehow.com/facts_5031932_history-water-pumps.html (accessed on 1st September 2019).
13. Oleson, J.P. Greek and Roman Mechanical Water-Lifting Devices: The History of a Technology; University of Toronto Press: Toronto, Canada, 1984.
14. Τassios, Τ. Hellenic Ancient Technology; Kathimerini: Thens, Greece, 1998.
15. Angelakis, A.N.; Mamassis, N.; Defteraios, P. Urban Water Supply, Wastewater, and Storm water Considerations in Ancient Hellas: Lessons Learned. Environ. Natl. Resource. Res. 2014, 4, 95–102.
16. Eubanks, B.M. The Story of the Pump and Its Relatives; Bernard M. Eubanks: Salem, OR, USA,1971; p. 185
17. https://www.homemade-circuits.com.waterlevelcontroller
18. Bin Zhang, Yue-Juan Wei, […] and Ji-Jun Xiong.