You are on page 1of 46

MICROCONTROLLER BASED WATER LEVEL INDICATOR

B. Tech. Minor Project Report

BY

DEVI .S.DEVARAJ (09427) SURABHI SADAVAT (09470) JYOTSNA CHATURVEDI (09480)

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING NATIONAL INSTITUTE OF TECHNOLOGY HAMIRPUR-177005, HP (INDIA)

April, 2012

MICROCONTROLLER BASED WATER LEVEL INDICATOR


B. Tech. Minor Project Report

Submitted in partial fulfillment of the Requirements for the award of the degree of

Bachelor of Technology
in ELECTRONICS & COMMUNICATION ENGINEERING

Under the guidance of

MR. MANORANJAN RAI BHARTI

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING NATIONAL INSTITUTE OF TECHNOLOGY HAMIRPUR-177005, HP (INDIA) April, 2012

CERTIFICATE
We hereby certify that the work which is being presented in the B. Tech. Minor Project Report entitled Microcontroller Based Water Level Indicator, in partial fulfilment of the requirements for the award of the Bachelor of Technology in Electronics & Communication Engineering and submitted to the Department of Electronics & Communication Engineering of National Institute of Technology, Hamirpur H.P., is an authentic record of our own work carried out during the period from January 2012 to April 2012 under the supervision of, Manoranjan Rai Bharti ,Assistant Professor, E&CE Department, NIT Hamirpur H.P. The matter presented in this minor project has not been submitted by us for the award of any other degree elsewhere. DEVI.S.DEVARAJ (09427) Mr.

SURABHI SADAVAT (09470)

JYOTSNA CHATURVEDI (09480)

This is to certify that the above statement made by the candidates is correct to the best of our knowledge. Date: Mr. Manoranjan Rai Bharti Assistant Professor Project Mentor E&CE Department, NIT Hamirpur. Head E&CE Department National Institute of Technology, Hamirpur (HP.)

ACKNOWLEDGEMENT
We take this opportunity to express our gratitude to the people who have been instrumental in the successful completion of this project. Apart from our efforts , the success of this project depends largely on the encouragement and guidelines provided to us by our project mentor from time to time . We would like to show our greatest appreciation to our supporting mentor Mr. Manoranjan Rai Bharti, Assistant Professor, E&CE Department ,NIT Hamirpur. We are grateful for his constant support and help. We deem it our privilege to have carried this project under his valuable guidance. We wish to thank Prof. Vinod Kapoor, Head of the Department, E&CE and Dr. Ashwani Rana, AP E&CED & Project Coordinator, all the Members of Evaluation Committee as well as the Faculty of E&CE Department NIT Hamirpur for their consistent support, valuable suggestions and for giving us the opportunity to work on this project. We wish to put on record our sincere gratitude to our respected parents for their love and support. We thank one and all who have helped us during the course of the project work.

DEVI.S.DEVARAJ (09427) SURABHI SADAVAT (09470) JYOTSNA CHATURVEDI (09480)

ABSTRACT

Sustainability of available water resource is now a dominant issue. This problem is quite related to poor water allocation, inefficient use, and lack of adequate and integrated water management. Water is commonly used for agriculture, industry, and domestic consumption. Therefore, efficient use and water monitoring are potential constraints for home or office water management system. To deal with this major problem of efficient water management, we propose an automated water level indicator. Water level indicator saves water, power and time by preventing over-flow of water from over head tank. This indicator can be used with over head tank of any size, shape and model. The water level indicator that we are proposing is: microcontroller based gives visual indication about the level of the water in the tank We are using LCD display for indicating the water level in the over head tank. Automated control of the water pumping system . We have done our coding in C language and simulated the circuit using proteus software. Through our project we are trying to address the problem of poor water allocation, inefficient use of water and lack of adequate and integrated water management .Thus, automatic water management is the main concern of our project.

CHAPTER 1 OVERVIEW

1.1

INTRODUCTION
Water is being used as if it is a never-ending resource. Obviously, we cannot decide how much rain we will get, nor can we predict to a good degree of accuracy when would rain occur. Thus, the only thing we can do to save ourselves from the dangerous situation of lack of water to drink while we are thirsty is to conserve water. In a country like India where agriculture is the primary occupation for many people, water conservation is a must.In drought-affected areas, water-management is a key issue. For example : There are many areas where people are unaware of an automated water level monitoring system, and still go for the method of switching off the motor mechanically when the spillage occurs. Through our project we have just moved a step ahead towards this goal. With the advent of technology many systems for water level indication have been developed from time to time .But each system comes with some or other shortcomings either in terms of size, efficiency or cost. Microcontroller Based Water Level Indicator is an effort to overcome these bottlenecks.

1.2

OBJECTIVE
The objective of our project is to design and implement a water level indicator system using microcontroller, which can monitor the various levels of a water tank to avoid spillage of water and to display the various levels using LCD. This circuit works on the principle that water conducts electricity. The major concern of our project is to save water, power and time by preventing over-flow of water from over head tank as well as to provide efficient and automated monitoring of available water resources for domestic purposes. Such module or circuit can be installed in big buildings where manual monitoring of tanks is difficult and its indicator can be placed at some centralised place.

1.3

BRIEF HISTORY

1.3.1 MANUAL CONTROL


Switches were used to control motor/water pump manually. No indication of water level in water tank. Wastage of time and water.

1.3.2 MECHANICAL CONTROL


Mechanical systems like safety balls are used to control the water level ; valves are closed when full level is achieved. Prevents wastage of water, but uncontrolled running of motor leads to wastage of power.

1.3.3 AUTOMATED CONTROL


Automatic controlling and monitoring using microcontroller as logic device. Saves TIME, POWER and WATER. Cost effective. Use of digital circuitry leads to easy installation of system.

1.4 METHODOLOGY
The common method of water level control for home appliances is simply to start a feed pump at a low level and allow it to run until a higher water level is reached in the water tank. Many automated water level monitoring systems have been offered but most of the methods have some shortcomings in practice. We will try to overcome these limitations and implement efficient automated water monitoring system .To incorporate the property of automatic control in our system, we will be using microcontroller as an integral part in our project.

CHAPTER 2 SENSORS AND LOGIC DEVICES

The technique of water level monitoring and controlling system concentrated with some basic parts which are softly aggregated together in our proposed method. Two such important parts are: SENSORS LOGIC DEVICE

2.1 SENSORS
A converter which measures a physical quantity (WATER LEVEL) and converts it into a signal which can be read by an instrument (MICROCONTROLLER ).

2.1.1 Conducting Wires as Sensors


Normal conducting wires can be used as sensors for a simple corrosion free water level indicator for home and industries. In fact the level of any conductive non corrosive liquids can be measured using this circuit. The circuit is based on transistor as switches. The number of levels to be measured is equal to the number of transistor employed in the circuit. Each transistor is switched on to drive the corresponding LEDS/pins of the microcontroller, when its base is supplied with current through the water through the electrode probes. One electrode probe with the power supply is placed at the bottom of tank. Next probes are placed step by step above the bottom probe. When water is raising the base of each transistor gets electrical connection to power supply through water and the corresponding probe which in

turn makes the transistors conduct to glow LED/send an electrical signal to the corresponding pin of the microcontroller and indicate the level of water. Insulated Aluminium wires with end insulation removed can be used as the electrode probes. The probes are arranged in order like a PVC pipe according to the depth and immersed in the tank. Electrolysis of the electrode probes is one of the problems associated with the circuit. With the passage of time , the electrolysis process results in the deposition of passive salt layer over the probe, which can degrade the efficiency of the system. Therefore, AC voltage is preferred over DC voltage since it prevents electrolysis at the probes. Since the conductivity of water changes from place to place, suitable adjustments have to be made with the resistance values. Nevertheless, the circuit is simple, costeffective, and reliable.

A B C D

FIG. 2.1: Simple Water Level Indicator using conducting wires as sensors

2.1.2 CAPACITVE TRANSDUCERS


A capacitor is forced when a level sensing electrode is installed in a vessel. The metal rod of the electrode acts as one plate of the capacitor and the tank wall (or reference electrode in a nonmetallic vessel) acts as the other plate. As level rises, the air or gas normally surrounding the electrode is displaced by material having a different dielectric constant. A change in the value of the capacitor takes place because the dielectric between the plates has changed. RF (radio frequency) capacitance instruments detect this dielectric change and convert it into a proportional output signal.

FIG. 2.2 CAPACITIVE TRANSDUCER

The capacitance relationship is given by the following equation:

C = 0.225 K (A/D)

Where: C = Capacitance in Pico farads K = Dielectric constant of material A = Area of plates in square inches D = Distance between the plates in inches Since the electrode and tank wall are fixed in place, the distance between them will not vary. Similarly, the dielectric of air and of the measured material remains constant. Consequently, the capacitance output can be reduced to this very basic equation: C = (1 x A Air) + (10 x A Material)

As it follows from the equation, the more material in the tank, the higher the capacitance output will be. The capacitance is directly proportional to the level of the measured material.

If instead the level of a conductive fluid such as water is to be sensed, the water acts a ground plate in this case instead of the tank wall. This changes the distance aspect of the basic capacitance -equation, whereby the output would be comparatively higher than that for a nonconductive material.

DRAWBACKS :
Some of the drawbacks of capacitive sensors as a water level sensors are as follows:

A non-insulated level sensing electrode must not come in contact with conductive material, in which case the sensor will act like a switch.

Vertically mounted electrodes must be clear of agitators and other obstructions and far enough from the vessel wall to prevent bridging of material between the electrode and the vessel wall.

The sensor must be surrounded with appropriate guard or shield electrodes to handle stray capacitance and crosstalk from other circuits.

Apart from its application in fluid level measurement, its extensive uses are found in the following areas as well:

Thickness measurement: Two plates in contact with an insulator will measure the insulator thickness if its dielectric constant is known, or the dielectric constant if the thickness is known.

Limit switch: Limit switches can detect the proximity of a metal machine component as an increase in capacitance, or the proximity of a plastic component by virtue of its increased dielectric constant over air.

Capacitive sensors in oil refineries measure the percent of water in oil, and sensors in grain storage facilities measure the moisture content of wheat.

Flow: Many types of flow meters convert flow to pressure or displacement, using an orifice for volume flow. Capacitive sensors are then used to measure the displacement

2.1.3 MAGNETIC REED SENSORS

A reed sensor (or a float sensor) can also be used in water level detection and employs magnetic reed switch as its main component. Reed sensors have certain other functional features such as an ability to withstand higher shock, easier mounting, additional intelligent circuitry, etc.

2.1.3A Magnetic Reed switches:

It is an electrical switch operated by an applied magnetic field. It was invented at Bell Telephone Laboratories in 1936 by W. B. Ellwood. The basic reed switch consists of two identical flattened ferromagnetic reeds, sealed in a dry inert-gas atmosphere within a glass capsule, thereby protecting the contact from contamination. The reeds are sealed in the capsule in cantilever form so that their free ends overlap and are separated by a small air gap. The contacts may be normally open or close when a magnetic field is applied.

FIG. 2.3: A MAGNETIC REED SWITCH (Normally Open)

WORKING PRINCIPLE:
The Reed switch operates under the influence of an external magnetic field. When a magnetic force is generated parallel to the reed switch, the reeds become flux carriers in the magnetic circuit. The overlapping ends of the reeds become opposite magnetic poles, which attract each other. If the magnetic force between the poles is strong enough to overcome the restoring force of the reeds, the reeds will be drawn together, hence completing an electrical circuit.

FIG. 2.4 WORKING PRINCIPLE OF REED SWITCHES

ADVANTAGES:
Since the contacts of the reed switch are sealed away from the atmosphere, they are protected against atmospheric corrosion. The hermetic sealing of a reed switch make them suitable for use in explosive atmospheres where tiny sparks from conventional switches would constitute a hazard. Also, the inert atmosphere around the reed contacts ensures that oxidation will not affect the contact resistance. Reed switches are immune to electrostatic discharge (ESD) and do not require any external ESD protection circuits. The isolation resistance between the contacts is as high as 1015 ohms, and contact resistance is as low as 50 milli-ohms.

Reed switches can directly switch loads as low as a few micro-watts without needing external amplification circuits, to as high as 120W. When used in combination with magnets and coils, they can be used to form many different types of relays.

APPLICATIONS
Reed sensors find immense applications in many fields. Most of applications fall under one of these categories:

Position sensing
When an application requires proximity sensing, end position sensing, or moving part sensing, a reed switch or a reed sensor fixed to the stationary surface and a magnet fixed to the moving surface can be used. When the moving part is away from the stationary part, the reed sensor remains un-actuated. As the moving part comes near the stationary part, the reed sensor gets actuated. This actuating distance is highly repeatable. Shock sensors, vibration sensors, inclination sensors, pressure sensors, flow sensors etc. use the basic position sensing principles to function.

Pulse Counting
Reed switches have a very high operating frequency and this feature lends itself to high speed pulse counting applications. Mounting a magnet to a rotating wheel or an object which moves back and forth repeatedly, and a reed sensor to a stationary part will generate the pulses required. The reed sensor used for sensing the pulses can be connected to a counter. If a magnet cannot be used in an application, special packages of reed switches which sense ferro-magnetic parts are available. Liquid and gas flow meters, electricity meters, automobile ABS, and speedometers use this principle of pulse counting.

Cellular phone, Notebook computer and PDA doors


In mobile devices with doors to protect the keypads, the power to the display or central processing unit (CPU) can conveniently be switched on or off, just by opening or closing the doors. A reed sensor can be used in these applications because it does not drain any power from the battery, irrespective of its contact state. Furthermore, when the sensor is actuated, the resistance across the contacts is so low in the order of a few milliohms, that unnecessary battery drain is avoided. Reed sensors are also used in notebook computers to trigger the CPU to sleep when the door is shut.

BIOMEDICAL APPLICATIONS:
Pacemakers and Defibrillators

Tachycardia and Bradycardia are problems in which the heart beats at a rate faster or slower than the normal human heart rate. Fibrillation is the uncontrolled beating of different parts of the heart. People with such heart problems need pacemakers or defibrillators to alter and maintain the pumping rate, or to control the beating at different parts of the heart. Implantable pacemakers and defibrillators use reed switches, so that the device mode can be altered with a magnet externally. Special reed sensors which are exclusively manufactured for use in life saving equipments are very compact and have a very high degree of reliability and precision.

DOMESTIC APPLICATIONS:
Domestic Coffee Machines
Domestic coffee machines use an inlet water hose which is triggered by a solenoid to fill up the water reservoir whenever needed. As the water drains, the float comes down and activates a reed sensor, and this signal can be used to trigger the input water solenoid. In machines without an incoming water pipe inlet, a float can be fitted on to a stem on the reservoir cap with a reed sensor mounted just outside the reservoir. This way, when the water level gets to a near low, an indication is given by the reed sensor and the reservoir can be taken out for refilling.

Level Sensing in Washing Machines and Dish Washers


Washing machines and dishwashers have reservoirs to hold detergent, and fabric or water softeners. A window is usually given behind the door of the appliance to check the level. With time, this window gets stained, and it is difficult to view the exact level. For such applications, a small foamed magnet on a spindle can be fixed to the reservoir cap, and a reed sensor can be mounted outside. When the reservoir reaches a near empty level, the reed sensor signals the processor which lights up an LED on the panel.

FLOAT SENSORS :
At the practical level, we propose the use of float sensors for the indication of various water levels. FLOAT SENSORS consist of REED-SWITCHES depending upon the number of water levels to be monitored. These are designed according to the capacity and dimensions of the overhead tanks.

FIG. 2.5 A 5- LEVEL FLOAT SENSOR

2.2 LOGIC DEVICES


2.2.1 OPERATIONAL AMPLIFIERS:
An Op-Amp can be used as a comparator to indicate the various level of water in a tank. A comparator is an open-loop op-amp with two analog inputs and a digital output; the output can be (+) or (-) saturation voltage, depending upon which input is larger. The output is then used to turn on the corresponding LED. Different LEDs indicate different water levels. We undertook a project on water level indicator using Op-amp last year. There we used Op-amp IC 741.

DRAWBACK :
Suitable only for detection of restricted number of levels , detection of greater number of levels leads to complex circuitry.

2.2.2 MICROCONTROLLER:
Microcontroller is used as a logic device to facilitate automatic control of water level in waterlevel indicator systems. The circuit enables the monitoring of various levels of the tank and thus, it can avoid spillage of water and also , the supply of water can be configured according to the various levels of tank. Microcontroller is a computer on a chip that is programmed to perform almost any control, sequencing, monitoring and display the function.

ADVANTAGES:
Relatively low cost, it becomes the natural choice to the designer. Its great advantage is no other external components are needed for its application because all necessary peripherals are already built into it. Thus, we can save the time, space and cost which is needed to construct low cost devices.

In automated water level indicator, the microcontroller takes input from the sensor unit which senses the water level. According to the logic fed into its memory , it processes the input. After processing input variables, resultant output decides the water pumps action (on/off) with respect to current water status of the tank. An LCD is interfaced with the microcontroller unit to display various levels of water in the tank. A relay is also used to drive high voltage/ current loads in a microcontroller-operated system.

CHAPTER 3 COMPONENTS AND CODING

3.1 COMPONENTS
Components used:
1. Microcontroller 2. LCD 16 x 2 3. Capacitors 4. Resistors 5. ULN2003AC 6. Relay 7. Buzzer 8. Voltage Regulator 9. Crystal AT89C52 (ATMEL) JHD 162A 10uf (Qty. 1) 100 (Qty. 5), 10k (Qty. 2) (Qty. 1) JQC-3FC(T73) DC 12V (Qty. 1) L7805CV 11.0592MHz

3.1.1 Microcontroller (AT89C52)


AT89C52 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C52 has 4KB of Flash programmable and erasable read only memory (PEROM) and 256 bytes of RAM. It can be erased and program to a maximum of 1000 times. In 40 pin AT89C52, there are four ports designated as P1, P2, P3 and P0. All these ports are 8-bit bi-directional ports, i.e., they can be used as both input and output ports. Except P0 which needs external pull-ups, rest of the ports have internal pull-ups. When 1s are written to these port pins, they are pulled high by the internal pull-ups and can be used as inputs. These ports are also bit addressable and so their bits can also be accessed individually. Port P0 and P2 are also used to provide low byte and high byte addresses, respectively, when connected to an external memory. Port 3 has multiplexed pins for special functions like serial communication, hardware interrupts, timer inputs and read/write operation from external memory. AT89C52 has an inbuilt UART for serial communication. It can be programmed to operate at different baud rates. Including three timers & hardware interrupts, it has a total of six interrupts.

FIG.3.1 MICROCONTROLLER PIN DIAGRAM In our project we are using: PORT 1 pins 1.1,1.2, 1.3 as E, R/W, RS respectively. -pin 1.4 to drive RELAY. PORT 2 as data pins. PORT 3 - pins 3.0,3.1,3.2,3.3,3.4 as input pins. -Pin 3.5 for buzzer.

3.1.2 LIQUID CRYSTAL DISPLAY (LCD)


LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on.

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data. The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.

FIG. 3.2. 16*2 LCD PIN DIAGRAM

Pin Description:
Pin No Function Name

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Ground (0V) Supply voltage; 5V (4.7V 5.3V) Contrast adjustment; through a variable resistor Selects command register when low; and data register when high Low to write to the register; High to read from the register Sends data to data pins when a high to low pulse is given

Ground Vcc VEE Register Select Read/write Enable DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 Led+ Led-

8-bit data pins

Backlight VCC (5V) Backlight Ground (0V)

3.1.3 PIEZO BUZZER


Piezo buzzer is made from two conductors that are separated by Piezo crystals. When a voltage is applied to these crystals, they push on one conductor and pull on the other. The result of this push and pull is a sound wave.. It produces sound based on reverse of the piezoelectric effect. The generation of pressure variation or strain by the application of electric potential across a piezoelectric material is the underlying principle. These buzzers can be used alert a user of an event corresponding to a switching action, counter signal or sensor input. They are also used in alarm circuits.

The buzzer produces a same noisy sound irrespective of the voltage variation applied to it. Most buzzers produce sound in the range of 2 to 4 kHz..

3.1.4 RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations. A type of relay that can handle the high power required to directly control an electric motor or other loads is called a contactor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protective relays".

3.1.5 Voltage regulator


7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at input and output pins depending upon the respective voltage levels.

FIG. 3.3 IC 7805

Pin Description:
Pin No 1 2 3 Function Input voltage (5V-18V) Ground (0V) Regulated output; 5V (4.8V-5.2V) Name Input Ground Output

The 7805 series has several key advantages over many other voltage regulator circuits which have resulted in its popularity:

7805 series ICs do not require any additional components to provide a constant, regulated source of power, making them easy to use, as well as economical, and also efficient uses of circuit board real estate. By contrast, most other voltage regulators require several additional components to set the output voltage level, or to assist in the regulation process. Some other designs (such as a switching power supply) can require not only a large number of components but also substantial engineering expertise to implement correctly as well.

7805 series ICs have built-in protection against a circuit drawing too much power. They also have protection against overheating and short-circuits, making them quite robust in most applications. In some cases, the current-limiting features of the 7805 devices can provide protection not only for the 7805 itself, but also for other parts of the circuit it is used in, preventing other components from being damaged as well.

3.1.6 RELAY DRIVER (ULN 2003)


The ULN2003 is a monolithic high voltage and high current Darlington transistor arrays. It consists of seven NPN Darlington pairs that feature high-voltage outputs with common-cathode clamp diode for switching inductive loads. The collector-current rating of a single Darlington pair is 500mA. The Darlington pairs may be paralleled for higher current capability. Applications include relay drivers, hammer drivers, lamp drivers, display drivers (LED gas discharge), line drivers, and logic buffers. The ULN2003 has a 2.7kW series base resistor for each Darlington pair for operation directly with TTL or 5V CMOS devices.

FEATURES 500mA rated collector current (Single output) High-voltage outputs: 50V Inputs compatible with various types of logic. Relay driver application. seven DARLINGTONS per package Integrated suppression integrated suppression diodes for inductive loads Outputs can be paralleled for higher current TTL/CMOS/PMOS/DTL compatible inputs Inputs pinned opposite outputs to simplify layout

FIG.3.5 PIN DIAGRAM OF ULN2003

3.2 CODING
Coding of logic which is to be fed into microcontroller is done in C language. Software Keil uVision3 is used for coding. CODE :
// Program to make a Liquid level indicator using MICROCONTROLLER

#include<reg51.h> sbit rs=P1^2; //register select pin sbit rw=P1^1; //read/write pin sbit e=P1^0; //enable pin sbit relay=P1^3;//RELAY control pin sbit quat=P3^0; //pin connected to quater level of tank sbit half=P3^1; //pin connected to half level of tank sbit threequat=P3^2; //pin connected to three -fourth level of tank sbit full=P3^3; //pin connected to full level of tank sbit overflow=P3^4; sbit buzz_on=P3^5;

void delay(int k) //delay function { int i,j; for(i=0;i<k;i++) for(j=0;j<1275;j++);

void mdata(char j) //write function { rs=1; //selecting command register rw=0; //selecting to write P2=j; //putting value on the pins e=1; //strobe the enable pin delay(1); e=0; return; }

void cmd(char j) //command function { P2=j; //put the value on pins rs=0; //selecting command register rw=0; //selecting to write e=1; //strobe enable pin delay(1); e=0; return;

void puts(char *a) //puts function to print a string { unsigned int p=0; for(;a[p]!=0;p++) mdata(a[p]); delay(100); }

void lcd(void) // function to initialise the LCD { cmd(0x38); //setting 8-bit interface, 2 lines, 5*7 Pixels delay(1); cmd(0x0e); //turning on underline visible cursor delay(1); cmd(0x01); //clearing screen delay(1); cmd(0x80); //moving cursor to the begining of line 1 of LCD }

void relay_on(void)

{ relay=1; // switch on motor delay(1); }

void relay_off(void) { relay=0; // switch off motor delay(1); }

void main() { quat=half=threequat=full=overflow=1; //configuring as input pins quat=half=threequat=full=overflow=1; //lowering input pins buzz_on=0; lcd(); puts("ready"); // making speaker on pin high,as it works on negative logic

while(1) { while(quat==1&&half==1&&threequat==1&&full==1&&overflow==1) //condition when tank is empty

{ lcd(); //puts("ready"); //delay(100); // initialising LCD

puts("VACANT"); //printing VACANT on lcd relay_on(); //switching on motor } while(quat==0&&half==1&&threequat==1&&full==1&&overflow==1) quater { lcd(); puts("QUARTER"); } while(quat==0&&half==0&&threequat==1&&full==1&&overflow==1) half { lcd(); puts("HALF"); } while(quat==0&&half==0&&threequat==0&&full==1&&overflow==1) //condition when tank is threequarter { lcd(); //printing HALF on lcd //condition when tank is //printing QUATER on lcd //condition when tank is

puts("THREEQUARTER"); }

//printing 3/4 FULL on lcd

while(quat==0&&half==0&&threequat==0&&full==0&&overflow==1) full { lcd(); puts("FULL"); //printing FULL

//condition when tank is

relay_off(); // switching off motor

} while(quat==0&&half==0&&threequat==0&&full==0&&overflow==0)//condition when tank is overflow {lcd(); puts("OVERFLOW"); buzz_on=1;//enabling speaker } buzz_on=0; } }

3.3 WORKING
The circuit works on the principle that water conducts electricity. A wire connected to ground and five other wires are dipped in tank at different levels namely quarter, half, three quarter , full and overflow. Their output are taken on pins P3.0, P3.1, P3.2, P3.3 ,P3.4 .Port P2 is connected to data pins of LCD and P1.0, P1.1, P1.2 are respectively connected to E, R/W, and RS pins of LCD. P1.4 is connected to ULN2003 which is a Relay driver used to drive a relay which further acts as a switch to start 12V DC motor. The basic logic behind designing this whole circuitry is that microcontroller interprets a signal only when it goes from high to low. Initially when the tank is empty LCD will show the message VACANT and motor starts pumping the water in the overhead tank..All the five wires are at logic 1. As the tank starts filling up, wire at different levels get logic 0, due to conducting nature of water. This transition from 1 to 0 will be sense by the microcontroller pins. When level reaches to quarter level, LCD displays the message QUARTER. On further rise of level, HALF and THREE QUARTER is displayed on LCD. When tank gets full LCD shows the message FULL and motor will now stop working .When the overflow is reached LCD will display OVERFLOW. A buzzer is also provided to alert the user when the tank gets overflow which will be a rare case. Once motor is stopped it will start only when the tank is completely VACANT.

3.4 SIMULATION
Simulation and circuit diagram is made on Proteus software.

CHAPTER 4 BENEFITS, PITFALLS AND APPLICATIONS


4.1 ADVANTAGES:
Conservation of three IMPORTANT resources : WATER, POWER, and TIME WATER- Ensures uninterrupted water supply, never allows tank to spill over or lie empty. POWER - Low power consumption leads to power conservation. No use of power circuitry at the sensing level while using REED SENSORS is one of the major advantages. TIME Use of MICROCONTROLLER as logic circuitry automates the whole process which ultimately saves the time of user. VERSATILITY- Usable with water tank of any size. DURABILITY- Using REED SENSORS, which are hermetically sealed in glass environment, free from contamination, and are safe to use in harsh industrial and explosive environments. So, they can have long life even when submerged in water for a long time. Never gives electric shock due to DC voltage output design Gives no false indication and no maintenance required while installation. High performance and high efficiency COST EFFECTIVE - ensures its usage at domestic level. RELIABILITY - Use of logic circuitry and REED SENSORS make it a reliable system. COMPACTNESS- controlling circuitry is digitalized that leads to an additional feature of compactness and portability. Simple circuitry and easy to implement.

4.2 LIMITATIONS:
No provision to deal with dry running of motor. Once FULL level is achieved,motor will stop working and it will start again only when the tank is completely vacant. REED SENSOR will be constructed according to the size of tank, so it cant be used for different tanks once it is used for a specific tank.

4.3 APPLICATIONS:
1) Automated
hotels, water level indicator can be extensively used to check the increasing and decreasing level of water in the tank and pipes in various establishments such as factories,

restaurants, hospitals, offices, schools, colleges and multi-storey residential

apartments having over head water tank of any size, shape and model. So, no need to go on the roof to check the water level. 2) Can be used for Municipal water taps for indication of flow of water from tap. 3) Can also be used to measure underground storage of water. 4) Can be used to predict the arrival of floods. 5) Water level indicators are used to monitor water level in standpipes and wells.

4.4 FUTURE SCOPE:


SOLAR WATER PUMP Moving towards renewable sources of energy we can make our project energy efficient and thus can help in conservation of energy. SOLAR WATER PUMP can be used for water pumping system, although solar water pumps are in use but automated solar water pumping system can be implanted at domestic level in order to increase efficiency.

FIBER-OPTIC AS LIQUID LEVEL SENSOR Some of the major advantages of using fiber optics sensors will be low power consumption, ability to withstand corrosive and high temperature environments, immunity from electromagnetic interference and high sensitivity.Accuracy will improve. Lower power and more real-time data will be available with advances in sensor.

WIRELESS AUTOMATED CONTROLLING SYSTEM A web based water level monitoring and controlling network would offer us to control this system from any place via internet even with different type of devices. This could lead to efficient management of water. Wireless sensor interfaces will increase over the coming years, providing cost savings in the area of installation costs.

4.5 CONCLUSION:
Water is one of the most important basic needs for all living beings. But unfortunately a huge amount of water is being wasted during daily life due to lack of control. We tried to overcome these problems and implemented an efficient automated water level monitoring and controlling system. Our intention of this project work was to establish a flexible, economical and easy configurable system which can be implemented at domestic level particularly in remote areas where technology is still in developing state. We have been used a low cost 89C52 microcontroller in this system which is the key point to reduce cost. Through our project we made an effort to solve one of the major daily life problems of society, i.e., proper and judicious utilization of an important natural resource like water. This project is basically aimed at using the technological solutions to deal with day to day life problems.

REFERENCES :

You might also like