• No results found

8051 Microcontroller Based Multiple Water Tank Control System

N/A
N/A
Protected

Academic year: 2022

Share "8051 Microcontroller Based Multiple Water Tank Control System"

Copied!
21
0
0

Loading.... (view fulltext now)

Full text

(1)

8051 Microcontroller Based Multiple Water Tank Control System

S. B. JAGADAL and S. V. HALSE Kernataka State Women University

Bijapur, Karnataka, INDIA.

(Received on: October 24, 2013) ABSTRACT

Nowadays, the use of multiple overhead water tanks installed in houses or offices are evident. And to monitor these tanks is difficult as they are kept at remote places for example terrace or at different places of an industry or building. In this paper we proposed a control system which can be used to monitor many tanks by controlling the operation of motors which pumps water from sump to the overhead tanks using a single 8051 MCU interfaced with LCD display in a virtual environment.

Here we introduced a multi-tank control system with four tanks to be monitored. An assembly language program was developed to control these four motors in both modes automatic as well as manual. We have used logic control design to select the particular tank to fill the water to desire level. There is also a high level alarm which is used to prevent the overflow of the water. There is an automatic fill option which fills all the tanks one by one in a sequential manner automatically. This control system also allows user to fill the desire tank using select and run button of the respective motor in a random sequence. When the system is active and running, it can indicate the water level through bar graph LED when connected to sensor point. An LCD display of size 40X2 is interfaced to 8051 MCS to display the status of the tank besides giving necessary instruction to operate this system. We send the program to LCD from 8051MCS.This LCD is 40 characters wide with two lines. This control system schematic is based on basic digital concept to configure the circuit design.

Keywords: 8051 Microcontroller, MULTISIM Simulator, multiple water tank control system, LCD module, motor, Digital design.

(2)

INTRODUCTION

Although much studies have been approved on motor with tank control system, but it is having the limitation of single motor control and a tank design. Many alternative techniques are developed by using the level sensor, microcontroller and solenoid valve to maintain a level at a given set point as explained in

1

. A comparative study is also made on water level parameters where these parameters are also controlled by using conventional PID controller and then optimized using Fuzzy logic controller

2

. The proposed system is designed and executed in a virtual environment. In actual implementation of proposed control system can use relay interfacing circuit. As explained in M.A.A. Mashud, et al.

3

and Hemant Ingale et al.

4

.

This proposed system can also be controlled and monitored remotely by including additional features of web and cellular based services as explained in

5,6,7

where wireless automated controlling network has been successfully implemented for agricultural motor control. Here we achieved the control over four water tanks which suggests upgrading the existing liquid level and flowing control system over a single motor control and water tank monitoring. We can use the same system when four or more additional water tanks are to be monitored and control by slight modification in hardware and software. We can operate the four motors according to our desire sequence by the assembly language programming. This system is easy to implement and require 8051 MCS program development kit to burn program in to the microcontroller with interfacing devices

such as LCD to display operation and relays to run the motors.

The National instrumentation (NI) simulation software MUTISIM 11/12 contains Peripherals like the Water Holding Tank with attached water motor that can be controlled via an 8051 microcontroller

8,9

. The input signals to the 8051 MCU are the push buttons and the empty and set point pins of the tank part. The output signals are connected to the forward, reverse and stop pins of the motor. The user can use the kill button to stop the process and by adjusting the potentiometer he can control the flow rate of liquid. Each water tank with a motor is inbuilt peripheral device in simulator software. We used a single 8051 MCU to control four such peripheral devices. There is an another output signal from sensor, if connected to LED bar graph shows water level in the tank. This sensor output can also be used to turn on the alarm when over flow occurs, or we can use target(set) point signal to turn on SCR which is used as a switch to turn on the alarm.

Interfacing relay to 8051 microcontroller

Relays are simple switches which

are used to control high current/voltage

circuits with the help of low current/voltage

signals; usually a transistor is used to control

the relay. The transistor is driven into

saturation (turned ON) when a LOGIC 1 is

written on the PORT PIN thus turning ON

the relay. The relay is turned OFF by writing

LOGIC 0 on the port pin. If we want to

connect more relays to microcontroller then

we can use ULN 2003 for connecting seven

relays or ULN 2803 for connecting eight

relays

10

. In this proposed system, motor

operatessimply by the output signal from

(3)

8051 MCU through a buffer gate instead of a relay.because simulation sofware motor runs on +5V supply. But we have used relay interfacing circuit in case of the sensor out put to turn on the buzzer whenever overflow condition meets in any one of the tanks using OR logical design.

Water level sensor techniques and applications:

There are so many applications of water level sensor; Common applications include switching motor on and off to avoid overflow, dry running, uninterrupted water supply and indicating water level in a tank.

Following are the few techniques to determine the fluid level….

11,12

.

1. Weighing the tank by utilizing strain gauges gives precise level measurement without exposing the tank content to potential electrical spark hazards.

2. Ultrasonic range finding technique is a cost effective level sensing as speed of sound is much slower to speed of light and reflected signal from water surface using ultrasonic transducer can accurately measure distance.

3. By probe electrode and the tank wall or by using a reference electrode in case of insulated tank. A conductive path is established between the sense electrode and the tank wall/reference electrode, when the water/liquid comes in contact with the electrode tip. This current is sensed, amplified and made to operate a relay whose contacts in turn can be used for annunciation/control.

4. The simplest type is a float mechanical switch which gives continuous level information. They come in variety of material suitable for different types of caustic and non-caustic liquids. This

technique is suitable for today’s increasingly resource- and energy- conscious world.

Circuit description

Figure 1 shows the circuit of microcontroller based multiple tank control system. We have connected control pins of all the four motors to a single port(P1) of the microcontroller through AND logic gates design to select a single motor to start. There are another two sub circuits as shown in figure 3 and figure 6.The symbolical representation as HB(1) in figure 1 is the replaced hierarchical block shown in sub circuit 1 ( figure 3).This sub circuit consist of seven OR gates which are used to set overflow alarm. One of the input to each first four OR gate is from the each target (set) point of the four peripheral devices i.e.

tanks placed on workplace. And these connections are grounded by 50k ohm register each. Another input to these four OR gate is from the common point to kill button.

This sub circuit is used to alarm when overflow condition is reached in any tank.

Figure 4 shows the connection of tank selection keys 1,2,3,4 and auto fill key A to the Bus 3 in the schematic of figure 1.

Figure5 shows the buffer circuits, a buffer

gate does not change the logic level of the

input; it is used to isolate or amplify the

signal. Such four buffer circuits consisting

of three buffers gate has been used to

connect the forward fill, reverse fill and stop

signal of the motor. The buzzer sub circuit

as shown in Figure 7 is to alert user

whenever overflow occurs in any tank. In

this sub circuit SCR gate terminal is

triggered by the output of the sub circuit3

which is the ORed outputs of the four relays

which are connected to the sensor terminal

of each tank.

(4)

Schematic of the multi–water tank control system

Four motors connected to 8051MCU and push buttons with sub circuit 1:

Figure 1

Figure 2 shows the LCD Display connected to 8051 MCS via BUS 4.There are 8 data pins D0-D7 connected to port 2 pins, which are used to send information to the LCD or read the content of the LCD’s

internal registers. While three pins of port 3 are used to connect the E, R/W and RS control pins of LCD. To display letters and numbers, we send ASCII codes for the letters A-Z, a-z, and number, to these pins

U13

Total Volume:

Flow:

Current Volume:

Set Point:

50.00 25.00 27.62

0.00 110%

2.76 Empty Target:

Sensor:

Pump Cntrl Fwd Rev

SP

Stop

Buffer

U14

8051 P1B0T2 1

P1B1T2EX 2 3 P1B2 4 P1B3 5 P1B4

P1B5MOSI 6

P1B6MISO 7

P1B7SCK 8 9 RST

P3B0RXD 10

P3B1TXD 11

P3B4T0 14

P3B5T1 15

XTAL2 18

XTAL1 19 20GND

P2B0A821 P2B1A922 P2B2A1023 P2B3A1124 P2B4A1225 P2B5A1326 P2B6A1427 P2B7A1528 P0B7AD732 P0B6AD633 P0B5AD534 P0B4AD435 P0B3AD336 P0B2AD237 P0B1AD138 P0B0AD0VCC3940

P3B2INT0 12

P3B3INT1 13

P3B6WR 16

P3B7RD 17

PSEN29 ALEPROGEAVPP3031 VCC

5V

GND

R1 1kOhm RPACK 7

(HB1/IO5)

(20)

(19)

(18)

(17)

123

20 VCC

18 17

19

GND U15

Total Volume:

Flow:

Current Volume:

Set Point:

50.00 25.00 25.21

0.00 101%

2.52 Empty Target:

Sensor:

Pump Cntrl Fwd Rev

SP

Stop U16

Total Volume:

Flow:

Current Volume:

Set Point:

50.00 25.00 28.25

0.00 113%

2.82 Empty Target:

Sensor:

Pump Cntrl Fwd Rev

SP

Stop

Buffer Buffer

X6/IO1X6/IO3X6/IO5

X7/IO1X7/IO3X7/IO5

U24

Total Volume:

Flow:

Current Volume:

Set Point:

50.00 25.00 25.16

0.00 101%

2.52 Empty Target:

Sensor:

Pump Cntrl Fwd Rev

SP

Stop

Buffer X8/IO1X8/IO3X8/IO5

X6/IO2X6/IO4X6/IO6 X7/IO2X7/IO4X7/IO6

X8/IO2X8/IO4X8/IO6

X1/IO2X1/IO4X1/IO6 K

K2

EDR201A05 VCC

5V VCC

K K3

EDR201A05 VCC

5V VCC

K K4

EDR201A05 VCC

5V VCC

K K5

EDR201A05 VCC

5V VCC

33

0 46

43

49

0

0 0

36 38 37

BUS2 (16)

(15)

(14)

14 16 15 48

44

45

50 51

(25) Bus1 (26)

(27) Bus1 27

(28)28

(29) Bus1 29

(30)30

(31) Bus1 31

(32)

32

(62)

(63)

(21)

(22)

X23

2.5 V 39

X24

2.5 V 42 X25

2.5 V 41 X26

2.5 V 40

21 62

22 63 25

X3

2.5 V 47

X4

2.5 V 26

(4) 4

Bus3 (HB1/IO5)

HB1/IO5 35

34

BusOffPage1 Bus4

(5)

5

(23)

23

(24)

24

BusOffPage2 Bus6

(6)

6(7)

7(8)

8(9)

9(10)

10(11)

11(12)

12(13)

13 X13

2.5 V HB1/IO5

TANK 1 TANK 2 TANK 3 TANK 4

A1

A1

A4 A4 A3

A3 A2

A2

GND (19)

(20)

Key = K Kill

Key = P Power

Key = F FILLUP

19 20

R3 50Ω

X2

2.5 V

0

HB1

LD

IO1 IO2IO3

IO4 IO5

IO6

Key = D DRAIN

Key = Space STOP BUS2

Key = N NEXT

(16)16

(15)15

(14)14

Bus3

(HB1/IO5)

(HB1/IO5)

HB1/IO5

VCC 5V

R8 100Ω VCC

HB1/IO6 T o B u z z e r c ir c u it

OVFLW A1

A2A3 A4

A1 A2

A3 A4

GND

(5)

while making register select pin RS=1.there are also instruction command codes that can be send to the LCD to clear the display or force the cursor to the home position or blink the cursor. R/W read /write input pin allows the user to write information from it.

E, enable pin latches the information to its data pins, while Vcc and ground provide +5V. VEE is used for controlling LCD

contrast. Many subroutines are called from the main program to display information on LCD screen. Assembly language programming allows us to make each subroutine into a separate module. These modules can be tested separately. In a large program the modules can be assigned to different programming in order to shorten development time.

LCD Display:

Figure 2

Sub circuit 1(HB1)

Figure 3

U34

GND

VCC CV RS RWE D0D1D2D3D4D5D6D7

VCC VCC

0

BusOffPage1 Bus4

Ln1(5)

5

Ln2(23)

23

Ln3(24)

24

BusOffPage2

Bus6

Ln1(6)

6

Ln2(7)

7

Ln3(8)

8

Ln4(9)

9

Ln5(10)

10

Ln6(11)

11

Ln7(12)

12

Ln8(13)

13

U46A

74LS32N U47A

74LS32N U48A

74LS32N U49A

74LS32N

U49B

74LS32N U45B

74LS32N

U45C

74LS32N

IO1 IO2 IO3 IO4

IO5

IO6 29

53

54

55

56 57

IO1 IO2 IO3 IO4

IO5

IO6

(6)

Key = 1 NEXT

Key = 2 NEXT

Key = 3 NEXT

Key = 4 NEXT

GND

(48)

(49)

(50)

(51)

48

49

50

51

Bus3

Key = A Auto Fill

R6 700Ω VCC

5V

VCC

(52)

GND

52

U45A

74LS32N U46B

74LS32N

U47B

74LS32N U48B

74LS32N U49C

74LS32N

U50D

74LS32N

44

Bus1

(36)

(38)

(40)

40

(42)

42

(37)

(39)

39

(41)

41

(43)

43

BUS2 X27

2.5 V

36

X28

2.5 V

X30

2.5 V X3145

2.5 V X32

2.5 V

47

X21

2.5 V

37

(4)

4

(7)

7 38

46

Keys connection: Buffer circuit:

Figure 4

Sub circuit 2

Figure 6

Figure 5

(7)

Sub circuit 3:

Figure 7

Various keys and their functions:

Table 1

Key A F D K 1 2 3 4 N Space

bar Function AUTO

FILL

FORDWARD FILL

DRAIN/

REVERSE FILL

STOP/

KILL

Selects Tank 1

Selects Tank 2

Selects Tank 3

Selects Tank 4

Next Pause/

stop

OPERATING INFORMATION

The simulation software allows us to navigate 8051 and the peripheral device water tank and 40X2 size LCD to place on the workplace. The bus connection to the 8051 MCU and all four water tanks is made as shown in the circuit diagram. We used logic design to select a particular motor via a single port of microcontroller. The simulator software is interfaced with computer key board as well. We can use computer keyboard as the push buttons in the circuit simulation

This system operates in two modes

[1] First is the auto fill mode in which we can fill all the tanks one by one automatically, if the tank is already full then it jumps to next tank which is empty. We can stop the process by pressing the kill button in forward fill as well as reverse fill operation of the motor. If any tank is drained to a particular level then microcontroller checks this status, if it finds that target level of water is not reached it runs the motor in forward direction to fill tank, as

LS1

SONALERT 200 Hz

V1

60 Vrms 60 Hz

VCC

5V

0 D3

2N1599

1

S1A

Key = A

3 X1

2.5 V

VCC

SCR

X2

2.5 V

2

BUZZER (ALARM)

(8)

long as auto fill button is closed this operation is repeated.. When all the tanks are full, draining of a particular tank can be done by selecting the tank number and pressing the D button. The auto fill key A also works as next button in the second mode i.e. manual mode.

[2] The second mode is a normal mode of operation; we can select a particular tank to fill it by pressing tank selection keys 1/2/3/4 followed by F (run) push button.

When the process of forward fill or reverse fill is going on we can stop it by pressing k (kill) buttons at any time during the process similarly as in auto mode. There is one more button called stop button who’s control is given to the space bar key of the keyboard, which when pressed stops (pauses) the ongoing

process of filling or draining temporally and again by pressing D or F button the respective process can be continued for same tank. Instead of this we can also use stop button (spacebar) to stop the process and then by pressing next N button to fill next tank. Various keys and their functions are displayed in table 1 above.

LCD module displays the two state of the tanks i.e. full or empty, besides it displays the ongoing operation of the system (for example: tank 1 is filling) and necessary instruction to the user to press particular key.

Software design given below figure out one example of display subroutine at the end of the main program, in the similar manner we can write all subroutines where ever exits in the main program.

SOFTWARE DESIGN

$MOD51 ; this includes 8051 definitions for the Meta-link assembler

; Please insert your code here.

; Program Start

$TITLE (MULTI PUMP CONTROL SYSTEM)

; Program Start Reset:

NOP

; move stack pointer past register banks MOV SP, #20H

; P0B4 - empty

; P0B3 - target

; P0B0 - kill button

; P0B1 - power button

; P0B2 - run button

; P1B2 - forward fill

(9)

; P1B1 - reverse fill

; P1B0 - stop fill

Begin:

ACALL LCDATA ; initialize LCD ACALL display1; display subroutine

MOV P1,#000H

;---

; Wait for power button to be pressed Start loop:

MOV P1, #000H

JB P0.1, ready1 ; power button was pressed JMPstart loop

Ready1:

LCALL display2 ; display subroutine JMP ready

Start:

Ready:

;---

;SET ALL MOTORS IN STOP MODE NEXT:

MOV P1,#0F9H

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

SELMOTOR:

JB P3.4, AUTODISP JB P3.0, M1

JB P3.1, M2 JB P3.2, M3 JBP3.3, M4 JMP SELMOTOR M1:ACALLMOTOR1 M2: ACALL MOTOR2 M3: ACALLMOTOR3 M4: ACALL MOTOR4

AUTODISP:ACALLDisplay3 ; display subroutine JMP AUTO

AUTO:

ACALL AUTOFILLUP1

; Tank1empty or below set point fill up now

MOTOR1:

(10)

;**********MOTOR 1 CONTROL ***************************************

; Wait for run button to be pressed to start filling tank readyloop1:

JB P0.0, start ; kill button pressed JB P0.2, FILLUP1

JB P0.5,DRAIN1 JB P0.7, NEXT JMP readyloop1

;__________________________________________________________________________

FILLUP1:

AUTOFILLUP1:

ACALL Display4 ; display subroutine MOV P1, #009H; set stop signal to high

; Fill in forward direction fillfwd1:

MOV P1, #00CH ; set fwd. signal to high CALLoutput delay ; hold fwd. signal high

CALLoutput delay

MOV P1, #000H ; set fwd. signal back to low

;__________________________________________________________________________

; Wait for set point to be reached fillfwdloop1:

JB P0.0, fillfwdkill1; kill button pressed MOV P1, #00CH

JB P0.3, fillfwdend1 ; set point reached JB P0.6, STOP

JMP fillfwdloop1

; Stop filling in fwd. direction and start timer for 5 seconds fillfwdend1:

MOV P1, #009H ; set stop signal to high

JB P3.4, AUTO2 ; auto button if on go to Auto2 CALLtimer delay ; go to timer routine

ACALL Display5 ; display subroutine JMPready ; timer has finished, start draining

; Kill button was pressed during filling in forward direction fillfwdkill1:

MOVP1, #009H ; set stop signal to high CALLoutput delay ; hold top signal high

CALLoutput delay

JMP start ; go back to beginning of program

(11)

;**************************************************************************

; DRAINING Liquid from Tank --TANK MUST BE NOT BE EMPTY

;**************************************************************************

DRAIN1:

ACALL Display6 ; display subroutine

MOV P1, #00AH ; set reverse signal to high CALLoutput delay ; hold reverse signal

CALLoutput delay

MOV P1, #000H ; set reverse signal to low

;Wait for tank to reach the empty point

______________________________________________________________________

fillrevloop1:

JB P0.0, fillrevkill1; kill button pressed MOVP1, #00AH

JB P0.4, fillrevend1 ; empty point reached JB P0.6, STOP

JMP fillrevloop1

; Finished draining, go back to ready state

;__________________________________________________________________________

fillrevend1:

MOV P1, #009H ; set stop signal to high ACALLDisplay7 ; display subroutine

JMP ready

; Kill button was pressed during filling in reverse direction fillrevkill1:

MOV P1, #009H ; send stop signal CALLoutput delay

CALLoutput delay JMP start

STOP:MOV P1, #009H JB P0.2, FILLUP1 JB P0.5, DRAIN1 JB P0.7, N9 JMP STOP

N9:ACALL NEXT

;**********MOTOR 2 CONTROL ***************************************

MOTOR2:

; Wait for run button to be pressed to start filling tank readyloop2:

JNB P0.0, STR

ACALL start ; kill button pressed

(12)

STR:JB P0.2,FILLUP2

JB P0.5,DRAIN2 ; run button pressed JB P0.7,N2

JMP readyloop2 N2:ACALL NEXT

; ---Start running--- AUTO2:

FILLUP2:

ACALLDisplay8 ; display subroutine MOV P1,#011H

; Fill in forward direction fillfwd2:

MOV P1,#014H ; set fwd. signal to high CALLoutput delay ; hold fwd. signal high

CALLoutput delay

MOV P1,#000H ; set fwd. signal back to low

;_________________________________________________________________________

; Wait for set point to be reached fillfwdloop2:

JB P0.0,fillfwdkill2; kill button pressed MOV P1,#014H

JB P0.3,fillfwdend2 ; set point reached JB P0.6, STOP2

JMP fillfwdloop2

;__________________________________________________________________________

; Stop filling in fwd. direction and start timer for 5 seconds fillfwdend2:

MOV P1,#011H; set stop signal to high JB P3.4,AUTO3

CALL timer delay ; go to timer routine ACALLDisplay9 ; display subroutine

JMP ready ; timer has finished, start draining

;__________________________________________________________________________

; Kill button was pressed during filling in fwd. direction fillfwdkill2:

MOV P1, #011H ; set stop signal to high CALLoutput delay ; hold top signal high

CALLoutput delay

JMP start ; go back to beginning of program

(13)

;**************************************************************************

; DRAINING Liquid from Tank --TANK MUST BE NOT BE EMPTY

;**************************************************************************

DRAIN2:

ACALL DRAIN11 ACALL KEY2

MOV P1, #012H ; set reverse signal to high CALLoutput delay ; hold reverse signal

CALLoutput delay

MOV P1, #000H ; set reverse signal to low

; Wait for tank to reach the empty point

;__________________________________________________________________________

fillrevloop2:

JB P0.0, fillrevkill2 ; kill button pressed MOV P1,#012H ; set reverse signal to high

JB P0.4,fillrevend2 ; empty point reached JB P0.6, STOP2

JMP fillrevloop2

; Finished draining, go back to ready state fillrevend2:

MOV P1,#011H ; set stop signal to high ACALL Display10 ; display subroutine

JMP ready

;__________________________________________________________________________

; Kill button was pressed during filling in reverse direction fillrevkill2:

MOV P1, #011H ; send stop signal CALL output delay

CALL output delay JMP start

STOP2:MOV P1, #011H JB P0.2, FILLUP2 JB P0.5,DRAIN2 JB P0.7, N5 JMP STOP2

N5:ACALL NEXT

##########################################################################

MOTOR3:

; ################## MOTOR 3 CONTROL ####################################

; Wait for run button to be pressed to start filling tank

readyloop3:

(14)

JB P0.2, FILLUP3; run button pressed JB P0.5, DRAIN3

JNB P0.0, No KILL JB P0.7, N3

ACALL start ; kill button pressed No KILL:LJMP readyloop3 N3:ACALL NEXT

; __________start running___________________________________________________

AUTO3:

FILLUP3:

ACALL Display11 ; display subroutine MOV P1, #021H

; Fill in forward direction fillfwd3:

MOV P1, #024H ; set fwd. signal to high CALLoutput delay ; hold fwd. signal high

CALLoutput delay

MOV P1, #000H ; set fwd. signal back to low

; Wait for set point to be reached fillfwdloop3:

JB P0.0, fillfwdkill3; kill button pressed MOV P1, #024H ; set fwd. signal to high

JB P0.3, fillfwdend3 ; set point reached JB P0.6, STOP3

JMP fillfwdloop3

; Stop filling in fwd. direction and start timer for 5 seconds

;__________________________________________________________________________

fillfwdend3:

MOV P1, #021H ; set stop signal to high JB P0.6, STOP3; stop button pressed

JB P3.4, AUTO4

CALL timer delay ; go to timer routine ACALL Display12 ; display subroutine

JMP ready ; timer has finished,

; Kill button was pressed during filling in fwd. direction fillfwdkill3:

MOV P1, #021H ; set stop signal to high CALLoutput delay ; hold top signal high

CALLoutput delay

JMP start ; go back to beginning of program

(15)

;**************************************************************************

; DRAINING Liquid from Tank --TANK MUST BE NOT EMPTY

;**************************************************************************

DRAIN3:

ACALL Display13 ; display subroutine

MOV P1, #022H ; set reverse signal to high CALLoutput delay ; hold reverse signal

CALL output delay

MOV P1, #000H ; set reverse signal to low

; Wait for tank to reach the empty point fillrevloop3:

JB P0.0, fillrevkill3; kill button pressed MOV P1, #022H

JB P0.4, fillrevend3 ; empty point reached JB P0.6, STOP3

JMP fillrevloop3

; Finished draining, go back to ready state fillrevend3:

MOV P1, #021H ; set stop signal to high ACALL Display14 ; display subroutine

JMP ready

; Kill button was pressed during filling in reverse direction fillrevkill3:

MOV P1, #021H ; send stop signal CALLoutput delay

CALLoutput delay JMP start

STOP3:MOV P1, #021H JB P0.2, FILLUP3 JB P0.5, DRAIN3 JB P0.7, N8 JMP STOP3 N8:ACALL NEXT

;##########################################################################

MOTOR4:

; #################### MOTOR 4 CONTROL ##################################

; Wait for run button to be pressed to start filling tank readyloop4:

JB P0.2,FILLUP4

JB P0.5,DRAIN4; run button pressed

JNB P0.0,NoKIL ; kill button pressed

(16)

JB P0.7,N4 ACALL start

NoKIL:JMP readyloop4 N4: ACALL NEXT AUTO4:

;________________________ start running_______________________________________

FILLUP4:

ACALL LINE10 MOV P1,#041H JB P0.3, DRAIN4

; Fill in forward direction fillfwd4:

MOV P1, #044H ; set fwd. signal to high CALL output delay ; hold fwd. signal high

CALLoutput delay

MOV P1, #000H ; set fwd. signal back to low

; Wait for set point to be reached fillfwdloop4:

JB P0.0, fillfwdkill4; kill button pressed MOV P1,#044H ; set fwd. signal to high

JB P0.3, fillfwdend4 ; set point reached JB P0.6, STOP4;Press Stop Key, Topause operation

JMP fillfwdloop4

; Stop filling in fwd. direction and start timer for 5 seconds fillfwdend4:

MOV P1,#041H ; set stop signal to high CALLtimer delay ; go to timer routine

ACALL FLFDED4 ; display subroutine JMP BELOW; timer has finished, BELOW:

ACALLDisplay15 ; display subroutine JMP NEXT

; Kill button was pressed during filling in fwd. direction fillfwdkill4:

MOV P1,#041H ; set stop signal to high CALLoutput delay ; hold top signal high

CALL output delay

JNB P1.7,OVRFLW4 ; CHEK IF OVER FLOW - JMP DRAIN4;OCCURS DRAIN THE TANK

OVRFLW4:JMP start ; go back to beginning of program

(17)

;**************************************************************************

; DRAINING Liquid from Tank --TANK MUST BE NOT EMPTY

;**************************************************************************

DRAIN4:

ACALL Display16 ; display subroutine

MOV P1,#042H ; set reverse signal to high CALLoutput delay ; hold reverse signal

CALLoutput delay

MOV P1, #000H ; set reverse signal to low

; Wait for tank to reach the empty point fillrevloop4:

JB P0.0,fillrevkill4 ;kill button pressed MOV P1,#044H

JB P1.7,ADJ ; OVER FLOW ADJESTMENT JB P0.4,fillrevend4 ; empty point reached

JB P0.6, STOP4

JMP fillrevloop4

; Finished draining, go back to ready state fillrevend4:

MOV P1,#041H ; set stop signal to high ACALL Diplay17 ; display subroutine

JMP ready

; Kill button was pressed during filling in reverse direction fillrevkill4:

MOV P1, #041H ; send stop signal CALL output delay

CALLoutput delay LJMP start

STOP4:MOV P1, #041H JB P0.2,FILLUP4 JB P0.5,DRAIN4 JB P0.7,N7 JMP STOP4 N7: ACALL NEXT

ADJ: JNB P0.3,DR;NO SETPOINT REACHED JMP DRAIN4

DR:JMP STOP4

;---

; Timer

Timer start:

(18)

MOV P1, #041H ; set stop signal to high CALLoutput delay ; hold stop signal

CALLoutput delay

MOV P1,#000H ; set stop signal to low

MOV R2,#39H ; call output delay 39H times to get 5 second delay

; Wait for timer to finish Timer loop:

JB P0.0, timerdelaykill; kill button pressed, stop timer CALLoutput delay

DJNZ R2, timerloop JMPtimerdelayend Timer delay:

JMP timer start

; Kill button was pressed during timer routine, wait for power button timerdelaykill:

JB P0.1, timerdelayready ; power button pressed JMPtimerdelaykill

; Power button was pressed, wait for run button to resume timer timerdelayready:

JB P0.2, timerdelay ; run button pressed JB P0.0, timerdelaykill ; kill button pressed JMPtimerdelayready

; Timer routine finished, return from call timerdelayend:

RET

; Timer delays outputdelay:

PUSH ACC MOV A, R5 PUSH ACC MOV A, R6 PUSH ACC

MOV R5, #50 ; number of inner delays to call CLR A

outerdelay:

MOV R6, A CALLinner delay DJNZ R5,outerdelay POP ACC

MOV R6, A

POP ACC

(19)

MOV R5, A POP ACC outputdelayend:

RET innerdelay:

NOP NOP NOP NOP NOP

DJNZ R6,innerdelay RET

; ---initialize LCD---

LCDATA:

MOV A, #38H ACALL COMNWRT MOV A, #0EH ACALL COMNWRT MOV A, #01H ACALL COMNWRT MOV A, #06H ACALL COMNWRT RET

; ---Send command to LCD--- COMNWRT:

MOV P2,A CLR P3.6 CLR P3.7 SETB P3.5 CLR P3.5 RET

; ---Send data to LCD---

DATAWRT:

MOV P2,A

SETB P3.6

CLR P3.7

SETB P3.5

CLR P3.5

RET

(20)

;--- EXAMPLE OF A SUBROUTINE TO DISPLAY WORD “PUMP”

--- PUMP: MOV A, #'T'

ACALL DATAWRT MOV A, #'A'

ACALL DATAWRT MOV A, #'N' ACALL DATAWRT MOV A, #'K'

ACALL DATAWRT MOV A, #'S'

ACALL DATAWRT RET

______________________________________________________________________END

RESULT AND CONCLUSION

Water tank control system can be utilized in many areas such as water dam, water treatment system, industry tank control and boilers. The proposed control system is effective and useful when a number of overhead tank are to be monitored. It suggests upgrading the existing liquid level and flowing control system over a single motor control. We have successfully controlled four motors operation and monitored the respective four water tanks in a virtual environment using MULTISIM simulation software. We have used logic design to select the desire tank to operate.

The status of each tank is displayed on LCD screen. The exiting features of level control and tank monitoring is included to the proposed system. Multi-tank control system is flexible and cost effective with highly variable operating requirements. It saves overhead costs of electricity bill, time, manpower and wastage of water. The circuit design is simple and compact which can be

converted into an embedded system by implementing it in actual hardware’s to monitor and control multiple tanks with multiple motors using a single 8051 MCU.

REFERENCES

1. Kavita Jindala, Kavita Singh,

“Hardware and Software based Water level controller system using Microcontroller”, International Journal

of Science Technology & Management, IJSTM Vol. 2, Issue 2 (2011).

2. D. M Souran, S. H. Abbasi and F.

Shabaninia V. E Balas et al. (Edn),

“Comparative study between tank’s water level control using PID and Fuzzy logic control.”

Soft Computing Applications. AISC, 195, pp.41-153

springer-Verilog Berlin Heidelberg.

(2013).

3. M.A.A. Mashud1, M.A.A. Tariq1, M.

Shamim Hossain 2 and Md. Serajul

Islam 3. “Design and development of a

low-cost microcontroller based single

(21)

phase water-pump Controller”,

International Journal of Information Sciences and Techniques (IJIST) Vol.2,

No.4, (2012).

4. Hemant Ingale and N.N. Kasat.

“Automated Solar Based Agriculture Pumping.” International Journal of

Advanced Research in Computer Science and Software Engineering, Volume 2, Issue 11, pp. 407-410 (20120).

5. S.M. Khaled Reza, Shah Ahsanuzzaman Md. Tariq, S.M. Mohsin Reza.

“Microcontroller Based Automated Water Level Sensing and Controlling:

Design and Implementation Issue:”

WCECS, San Francisco, USA, Proceedings of the World Congress on Engineering and Computer Science.

(2010).

6. Brito, N,;Guimaraes, Portugal; Ribeiro, P. , Soares, F., Monteiro, C,. “A remote system for water tank level monitoring

and control - A collaborative case-study- Learning in Industrial Electronics, ICELIE '09. 3rd IEEE International Conference on (2009).

7. http://www.techrepublic.com/resource- library/whitepapers/tank-water-level- monitoring-system-using-gsm-network/

8. www.ni .com - multisim guide pdf 9. Muhammad Ali Mazidi Janice Gillispie

Mazidi, “The 8051 microcontroller and embedded systems” Prentice Hall of India, New Delhi.

10. www.efymag.com-water-level controller cum-motor protector; numeric water level indicater

11. http://en.wikipedia.org/wiki/Level_senor

12. Rajesh Kumar Garg and Vikram,

Design Plan of Modular Controller Discharge System using Simulation Singh,

International Journal of Computer Applications, Volume 9–

No.1, 0975 – 8887 (2010).

References

Related documents

The U.S. income tax system allows taxpayers to deduct certain expenses from taxable incone in order to improve horizontal equity and to encourage cer- tain activities,

It is established, that decapitalization of the financial sector in Ukraine in 2014-2016 ac- quired the following main forms: a decrease in equity due to depreciation

Therefore, we developed a new method that uses benzo[ ghi ]perylene (B(ghi)P) as a marker which attached with MWCNTs. For the analysis of MWCNTs from tissues, the existence of

Could a remarkable decrease in leptin and insulin levels from colostrum to mature milk contribute to early growth catch up of SGA infants? RESEARCH ARTICLE Open Access Could a

However, despite these objections, the CIAF can provide politically relevant information about the pattern of pediatric malnutrition at a population level by summing up

This suggests that (i) most consumers rely on just a few social media platforms to do social media shopping, (ii) most of the online businesses which most

Researchers have proposed many segmentation methods by using, global and local histogram thresholding [3 and 5], local region based image segmentations [10], region growing

For Methylene blue maximum adsorption is found to be at pH = 12.The adsorption of these positively charged dye groups on the adsorbent surface is primarily