Beruflich Dokumente
Kultur Dokumente
BY
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING NATIONAL INSTITUTE OF TECHNOLOGY HAMIRPUR-177005, HP (INDIA)
April, 2012
Submitted in partial fulfillment of the Requirements for the award of the degree of
Bachelor of Technology
in ELECTRONICS & COMMUNICATION ENGINEERING
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.
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.
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.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.
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 ).
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
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
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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-
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".
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.
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
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 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)
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
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"); }
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.
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,
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.
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 :