Microcontroller Based Water Controller for Optimum Water Supply

DOI : 10.17577/IJERTV2IS120495

Download Full-Text PDF Cite this Publication

Text Only Version

Microcontroller Based Water Controller for Optimum Water Supply

I. A. Ezenugu a

aDepartment of Electrical/ElectronicEnginee ring, Imo State University,

      1. 2000, Owerri, Nigeria

        1. E. Ogu b

          bSuccess Computers Nigeria,

          #72 Njiribeako Street, Owerri, Nigeria.

        2. N. Ikwueze c

cDepartment of Civil Engineering, Enugu State University of Science and Technology, P.M.B 01660, Enugu, Nigeria.

Abstract

One of the most vital life elements on this earth is water. It is used for cooking, drinking, washing, bathing, concrete making, fish habitation etc. The scarcity and irregular supply of this life element in our neighborhood has been a challenge to human comfort and well-being. The advancement in technology however, has drastically reduced the syndrome of water scarcity as water boreholes are easily sunk in our neighborhoods. Prompt availability and supply of water to the consumers is achieved using a microcontroller based water supply system which automates the operation of the water pumping system to ensure regular water supply. The result of this design is a twenty-four hour availability and supply of water to the structurerally fortified/ supported overhead storage tank as long as there is electrical energy to always energize the system.

Keywords: Water Sensing, under voltage, over voltage, microcontroller.

  1. Introduction.

    Technology has advanced so much in the last decade or two that it has made life more meaningful and comfortable. The new age of technology has redefined the way people think and live. Most people nowadays want to be completely served. Technologies which have been developed in recent years goes to show the very fact that improvements are in fact possible and these improvements have eased our life and the way we live.

    The comfort of being able to take control of devices has required actions of many scholars and designers as it saves a lot of time and effort. And to do so there is need for a systematic approach which we

    have tried to implement with our system in the automation of a water scheme.

    With the advancement and breakthroughs in technology over the years, the lives of people have become more meaningful than before. This development, we believe, will ultimately save a lot of time and stress of running up and down especially when people try to switch the waterpump ON and OFF and continually monitor the tank to monitor when it is filled to avoid overflow of water, and subsequent over flooding of the premises.

    The objective of this work is to develop an electronic based system/circuitry that completely automates the water borehole scheme operation. This system will be a powerful and flexible tool that will offer this service at any time, and as well protect the water pump against the harmful effect of under voltage, over voltage and transient.

    The proposed approach for designing this system is to implement a microcontroller-based control system that requires no human assistance. The microcontroller carries out the necessary command/instruction to ensure the full automation of the water pump.

  2. System Design and Development.

    The design of this control system is sub divided into two sections viz: the hardware and the software. Each of this section however, plays a vital role in the entire system below.

    1. Hardware Design and Development.

      The hardware section of this design incorporate some electrical and several electronic components of which the integration results into a functional device and system termed automatic water level controller. The functional units of the hardware section are as

      indicated in the block diagram of figure 1 below. Also the operation flow chart of the automatic water level controller is as shown in figure 2

      Start

      Is water low?

      Yes

      Is Voltage low?

      No

      Is

      NNoo

      Yes

      Yes

      Delay

      Voltage high?

      Turn on Pump

      No

      Is Voltage low?

      Yes

      Fig.1-Block diagram of automatic water level controller

      The flowchart of the automatic water level controller is as shown below in fig.2.

      No

      Is

      Voltage high?

      No

      Is Tank full?

      Yes

      Yes

      Turn off Pump

      No

      Continue pumping.

      Continue pumping.

      Fig.2- Flow chart of the automatic water level controller.

      Power supply unit.The power supply used in this design is able to supply the necessary power needed by the various sub-blocks of the device. Since the microcontroller cannot operate on a DC voltage greater than 5V DC, the power supply should supply a constant (regulated) 5V DC. Also since there is no relay used in the switching block of the design, we designed a power supply that can produce 500mA. The circuit diagram of the power supply unit is as shown in fig.3 below.

      R1

      10k

      R2

      10k

      R3

      10k

      R4

      10k

      U1

      7812

      1 VI

      GND

      GND

      VO 3

      2

      2

      Vcc

      4

      4

      3

      1

      2

      11

      11

      Vref

      220uF

      Fig.3- Power supply unit

      4

      4

      3

      1

      2

      11

      11

      Vref

      Low Voltage

      High Voltage

      Water and voltage sensors units.For the design to be effectively implemented, there need to be input from the water and voltage sensors to the controller. The water sensors senses the level of water in the tank (reserve or full) while the voltage sensors continues to

      4

      4

      Tank full

      Water Low

      Vref 3

      11

      11

      2

      4

      4

      3

      2

      1 Tank full

      Low Water

      1

      monitor the supplied voltage to check when there is an under or over voltage. The sensors are designed with comparators, and so a total of four comparators were used to detect the conditions. From fig.4 below, each of the comparator should output a logic1 to the controller to show the status of the condition/ parameter it is monitoring.

      As seen in the diagram, for the voltage

      GND

      Vref

      11

      11

      Fig.4- Voltage and water sensors

      Three aluminum conductors are used as the

      sensors there is a reference voltage at the inverting input of the comparator so that when there is an under and over voltage situation, each comparator outputs a logic1(for the high voltage sensor).

      For the water sensors, the reference voltage is set at the inverting input of the comparator (for the water low/reserve sensor) so that when the probes senses does not sense water it will output a logic1 while for the tank full sensor the reference is set at the non inverting input so that when the tank full sensor sense water it outputs a logic1 to the controller. The circuit diagram of sensory unit is as shown in fig.4 below.

      water sensing probe because aluminum does not react in water. One of the probes serves as the common ground to the other two probes, (reserve and tank full). When there is water touching the ground and any of the probes, a resistance is being created by the water hence forming a voltage divider with the other resistor in the circuit; the arrangement of the probes is as shown fig.5a and fig.5b below.

      For the low voltage sensor, the reference is set as the non-inverting input so that when the supplied voltage is low, the sensor will output a logic 1 to the microcontroller.

      Fig.5a- Arrangement of the probes

      Vcc

      R1

      Vx

      Rw

      provdes a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.

      The source code for the design is made in c language.

      Vx=

      1+

      Fig.5b- Voltage divider circuit

      The circuit diagram for the connection of the microcontroller to the other part of the circuit is as shown in fig.6 b

      Remember the smaller the ratio of R1 to Rw the closer Vx tends to 0V and vice versa. From experimental result, the resistance between two aluminum conductors placed 2 inches apart in a 10 liters bucket filled with water is about 119k and as the probes are brought closer, the resistance decrease and vice versa. To this end a high resistance of 10M is used as R1 such that the resistance created by the water forms a low resistance relative to R1 thereby making the voltage to fall below the set reference at the inverting and non-inverting input of the two operational amplifiers of the water sensors as discussed above.

      Controller. As said earlier the device is designed around the AT89S52 microcontroller whose architecture is based on the popular Intel 8051 microcontroller.

      The AT89S52 is a low-power, high- performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which

      Fig.6- Microcontroller connection

      Display and alarm units.The LCD display and the alarm used in this design is intended to notify the end user the status of the automatic water level controller at any point in time. The LCD used in this design is LM016 which is a 2×16 (it shows 2 lines with each line capable of displaying 16 characters). The system is designed in such a way that the LCD is continually

      ON displaying the status of the device while the buzzer/alarm only comes ON when there is a serious attention needed, for instance, when the level of water is low and there is either an under or over voltage. The

      available or before hardwiring. The overall circuit diagram of the automatic water level controller is as shown in fig.8 below.

      circuit connection of the LCD and the alarm is as shown in fig.6 above.

      Interface and switch units. As we know, the water pump operates on AC voltage and the electronic

      820R

      Vref

      10M 10M 10k 10k

      50k 3

      2

      Vref

      11

      11

      100k

      4

      4

      1 High Voltage

      220uF

      7805

      VI VO

      VI VO

      2

      2

      GND

      GND

      1

      0.33uF

      3

      Vcc

      LCD1

      LM016L

      circuitry so far discussed operates on DC voltage. To this effect, the interfacing block of the device completely and safely isolates the AC circuit from the DC circuit. MOC3063 optical isolated triac which has a zero crossing capability is used to completely isolate

      Tank full

      4

      4

      50k

      3

      2

      Vref

      Vref 3

      11

      11

      1

      2

      3

      1

      2

      3

      4

      5

      6

      4

      5

      6

      7

      8

      9

      10

      11

      12

      13

      14

      7

      8

      9

      10

      11

      12

      13

      14

      100k

      1 Low Voltage

      Low Water

      VSS VDD VEE

      VSS VDD VEE

      RS RW E

      D0 D1 D2 D3 D4 D5 D6 D7

      RS RW E

      D0 D1 D2 D3 D4 D5 D6 D7

      100nF

      4

      4

      12MHz

      U1

      19 XTAL1

      18 XTAL2

      P0.0/AD0 39

      P0.1/AD1 38

      P0.2/AD2 37

      P0.3/AD3 36

      P0.4/AD4 35

      P0.5/AD5 34

      RV1

      the two circuits.

      In the switching mechanism, BTA25 triac which is capable of handling 25A is used. The circuit

      1

      11

      11

      2

      4

      4

      Water Low

      R1

      210K

      9 RST

      1. PSEN

      2. ALE

      3. EA

        P0.6/AD6 33

        P0.7/AD7 32

        P2.0/A8 21

        P2.1/A9 22

        P2.2/A10 23

        P2.3/A11 24

        P2.4/A12 25

        P2.5/A13 26

        P2.6/A14 27

        P2.7/A15 28

        20K

        diagram of the interface and the switch as connected is as shown below in fig.7 below.

        GND

        Vref

        Zero Crossing

        Zero Crossing

        1 6

        3

        11

        11

        2

        390R

        Ta1 nk Full

        1 P1.0/T2

        2 P1.1/T2EX

        3 P1.2

        4 P1.3

        5 P1.4

        6 P1.5

        7 P1.6

        8 P1.7

        AT89C52

        U2

        1. 1B

        2. 2B

        3. 3B

        4. 4B

        5. 5B

        6. 6B

        7. 7B

      P3.0/RXD 10

      11

      P3.1/TXD 12

      P3.2/INT0 13

      P3.3/INT1 14 P3.4/T0 P3.5/T1 15

      P3.6/WR 16

      P3.7/RD 17

      COM 9

      1C 16

      2C 15

      3C 14

      4C 13

      5C 12

      6C 11

      7C 10

      BUZ1

      BUZZER

      Fig.7- Interface and switch

      2

      4

      MOC3063

      BTA25

      Load

      Input Voltage

      ULN2003A

      D1

      LED-BIRG

      +88.8

      R2kRPM

      1.0K

      Fig.8-Circuit diagram

    2. Software Development.

      As we know that every computer needs a set of instruction to perform the desired task, so do microcontrollers need instructions to perform the tasks required of them. However, unlike the microprocessors, the instructions needed by the microcontrollers can be stored in the internal ROM that is inbuilt in the controller. It should not be forgotten that the microcontroller can also run its instruction from an external memory when configured to do so.

      Keil µV software was used to create the software needed by the microcontroller to perform the

      desired function. The Keil µVision Debugger accurately simulates on-chip peripherals (I²C, CAN, UART, SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM Modules) of the 8051 device.

      Simulation helps you understand hardware configurations and avoids time wasted on setup problems. Additionally, with simulation, you can write and test applications before target hardware is

  3. Results.

    As mentioned earlier, the source code for the design is written in c language, and thereafter compiled and debugged using the Keil µV. The hex file produced from the Keil µV is used for virtual simulation of the circuit in the proteus window and the circuit was discovered to be working as designed. The snapshot of the proteus window during the simulation is as shown in fig.9 below while the simulation log for the design is as shown in fig.10 below.

    Fig.9-Circuit simulation

    Fig.10-Simulation log

    The list of components used in this design is presented in table1 below.

    Table1: List of components used in the design

    S/N

    Component

    Quantity

    1

    AT89S52

    microcontroller

    1

    2

    Lm016 LCD

    1

    3

    MOC3063

    1

    4

    IN4007

    2

    5

    470µF

    1

    6

    270

    1

    7

    3.9k

    1

    8

    BTA25

    1

    9

    Crystal Oscillator

    1

    10

    Buzzer

    1

    11

    LM324

    1

    12

    50k Variable Resistor

    2

    13

    3V Zener Diode

    4

    14

    470

    4

    15

    10k

    2

    16

    100k

    2

    17

    0.33µF

    1

    18

    0.1µF

    1

    19

    7805

    1

    20

    9V-0V-9V

    Transformer

    1

    21

    40 pin DIP socket

    1

    22

    14 pin DIP socket

    1

    23

    6 pin DIP socket

    1

  4. Discussion and Conclusion.

Automatic control system is one that makes the required adjustments automatically, without human aid.

It is common to separate control system descriptions into two broad categories process control and servomechanisms depending upon how the value of the physical variable is expected to behave in time. In many instances, the objective of a control system is to force a physical variable to remain constant in time and equal to some desired value. This type of control is often called a process control system. Process is encountered, in automated manufacturing operations, such as in the chemical and petrochemical industries where temperatures, flow rates, levels, and so on are forced to maintain constant values. Such control is often also called regulation and the desired value is called the set point.

Another type of control system objective is to force a physical variable to change in time, but in a precisely prescribed manner. That is, the physical variable will be forced to follow or track some target value as it changes in time. The term servomechanism is frequently used to describe such control by reference to a historical approach to providing the control. A common example of this kind of control system is in industrial robot arm motion, where the arm must follow a specific path in space as a function of time.

In the paper low cost, effective, closed loop control system has been designed. The approach discussed in the paper has achieved the target to control a water borehole scheme by constant monitoring of the level of water in the tank and switching the pump ON and OFF depending on the result gotten from the sensors in the tank. Hence we can conclude that the required goals and objectives of designing an automatic water level controller have been achieved.

References

  1. Atmel Corporation (2008), www.atmel.com/literature

  2. Roger T. (2008): Digital Electronics Principles and applications, McGraw-Hill Higher Education.

  3. Rechard C.D and Bishop H.R (2005). Modern Control Systems. Singapore, Pearson Education.

  4. Thwe Mu Han and Ohn Mar Myaing (2011), 2011 International Conference on Circuits, System and Simulation. IPCSIT vol.7 (2011) © (2011) IACSIT Press, Singapore.

ABOUT THE AUTHORS

Engr. I.A Ezenugu, is a COREN Registered Engineer and a Lecturer in the Department of Electrical/Electronic Engineering, Imo State University Owerri, Nigeria. He holds a Masters Degree (M.Eng) in Electrical/Electronic Engineering. His Major research interests are in Microprocessors and Control systems.

R.E.Oguis a Bachelor of Engineering Degree (B.Eng) holder in Electrical/ Electronic Engineering of the Imo State University Owerri Nigeria. His research interests are in the use of Microcontrollers/ Microprocessors for both home and industrial automations.

S.N Ikwueze is a Technologist in the Department of Civil Engineering, Enugu State University of Science and Technology, Enugu Nigeria. She holds a bachelors Degree (B.Eng) in Civil Engineering. She is currently a Masters Degree student. Her research interests are in Structural Design, Construction Management and Geotechnical Analysis.

Leave a Reply