water project (1).docx

47
1 | Page  CHAPTER 1 INTRODUCTION 1.1 INTRODUCTION: This project is very much different from other water level indicators, many water level indicators are available in the market, they are cost efficient & reliable also, but the main disadvantage of this type of W.L.I is that the readings are observed by going close to the tank. This is because each LED is connected to the wire which senses the level. Now if 5 level indicators are used then the no. of wire used is 5, so the LED indicator is placed very close to the tank. I f we want to observe th e output at some distance place,we should extend all the 5 wires connected to the LEDs, which is hectic & costly job. To overcome the above disadvantages instead of using analog ICs we use 8051 Microcontrollers. It is programmed to sense the level & transmit the level data serially and to receive the serial level data & show the level position on port 1 connected to the LED indicator. Water level controller is an equipment used to control the water level. This is done by switching ON or OFF the motor. The level of water is controlled by using 8051 microcontroller. Micro controller produces the control signal to drive the motor. If there is no water in the tank, micro controller gives the control signal to start the motor and if there is sufficient water in the tank and micro controller gives the control signal to stop the motor. The level sensor probes are used for the tank are interfaced to the microcontroller through transistors.. A positive voltage supply probe goes to the down bottom of the tank. The probes for sensing 1/4, 1/2, 3/4 and FULL levels are placed with equal spacing one by one above the  bottom positive probe. These levels are indicated by the LEDs and is displayed at the LCD  board. 1.2 OBJECTIVE  To observe the water level of tank  To control motor automatically  To save energy and natural resources 1.3 PROBLEM STATEMENT

Upload: pritjot-gill

Post on 02-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 1/47

1 | P a g e

CHAPTER 1 INTRODUCTION

1.1 INTRODUCTION:

This project is very much different from other water level indicators, many water level

indicators are available in the market, they are cost efficient & reliable also, but the main

disadvantage of this type of W.L.I is that the readings are observed by going close to the

tank. This is because each LED is connected to the wire which senses the level. Now if 5

level indicators are used then the no. of wire used is 5, so the LED indicator is placed very

close to the tank. If we want to observe the output at some distance place,we should extend

all the 5 wires connected to the LED‟s, which is hectic & costly job. To overcome the above

disadvantages instead of using analog IC‟s we use 8051 Microcontrollers. It is programmed

to sense the level & transmit the level data serially and to receive the serial level data & show

the level position on port 1 connected to the LED indicator.

Water level controller is an equipment used to control the water level. This is done by

switching ON or OFF the motor. The level of water is controlled by using 8051

microcontroller. Micro controller produces the control signal to drive the motor. If there is no

water in the tank, micro controller gives the control signal to start the motor and if there is

sufficient water in the tank and micro controller gives the control signal to stop the motor.

The level sensor probes are used for the tank are interfaced to the microcontroller through

transistors.. A positive voltage supply probe goes to the down bottom of the tank. The probes

for sensing 1/4, 1/2, 3/4 and FULL levels are placed with equal spacing one by one above the

bottom positive probe . These levels are indicated by the LED‟s and is displayed at the LCD

board.

1.2 OBJECTIVE

To observe the water level of tank

To control motor automatically

To save energy and natural resources

1.3 PROBLEM STATEMENT

Page 2: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 2/47

2 | P a g e

Most of the people in the context of our country, they are still using manual process for water

pumping and motor control that used in home, office and industries. Manual controlling

process is difficult when the water tank is located at higher buildings and controlling from

ground level. Due to more time consuming on manual operation it is total loss of our valuable

time. If we are unable to continuous monitoring there are loss of energy sources for pumping

water as well as loss of natural resources by overflowing water from tank.

With invention of different technology and automatic system, people wants to do such a task

without touching it. For fulfillment of people desire we have design this system which control

the motor used to pump. Motor is automatically start and stops as our requirement. Our

system is not only motor controlling system it also check the condition of water tank and

display the present status.

The proposed approach for this system is based on microcontroller controlling system with

simple self-made water level sensor. Microcontroller reads the status of system and give

desired output by switching motor and displaying LCD and LED.

1.4 THEORY

The embedded system is a combination of computer hardware, software and perhapsadditional mechanical or other parts, designed to perform a specific function within a given

time frame. The embedded software is required for all real-time applications and is developed

using a real time operating system (RTOS), as it helps to schedule and execute tasks based on

priority in a predictable manner.

This project is based on the embedded systems technology using microcontroller. The

objective of this project is to control the motor used in home and office for water pumping

with the help of switching function of microcontroller with observing status by simple self-

made sensor. In this project we interface LCD and Microcontroller to show the status of

whole system. When water tank is empty motor is automatically start and when tank is full

motor is stop and all condition in you are system will be display in LCD.

The Microcontroller is the embedded device which has on chip program memory in which

the machine control program is stored. Suppose if sensor send signal to turn on the motor,

Page 3: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 3/47

3 | P a g e

then the Microcontroller activates the relay which is connected to motor. Now the Motor is

switched ON by relay.

Page 4: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 4/47

4 | P a g e

CHAPTER 2 BLOCK DIAGRAM

2.1 BLOCK DIAGRAM:

The figure shown below is the simple block diagram of our project. It is a simple illustration

of how we have implemented our project and the various parts involved in it. From the

below representation, the transistors are used as sensors to read status of water level and

sends different signal to the microcontroller. Block diagram of the project is given below :

FIG 2.1: WATER LEVEL CONTROLLER USING 8051

2.2 PARTS OF THE SYSTEM

2.2.1 Water level sensor:

Page 5: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 5/47

5 | P a g e

In market, different water level sensor are available but in this project we have used self-

made sensor. Water level sensor is the simply group of wire. Separate wire conducts voltage

from where the level of water is reached and this voltage is supplied to the transistor and

further to the specific port of the microcontroller.

2.2.2 Microcontroller:

Microcontroller is programmable semiconductor device. This is 40 pins digital device.

Microcontroller has in built RAM and ROM with microprocessor. The microcontroller we

used in this project is AT89C51.which is the main section of our project. Microcontroller are

widely used in embedded system.

2.2.3 Relay:

A relay is an electrically controllable switch widely used in industrial controls, automobiles

and appliances. It allows isolation of two separate section of system with two different

voltage source. We have used electromechanical relay, when current flows through the coil

magnetic field is induced around the coil which causes the armature to be attracted to the coil.

2.2.4 Indicator:

Indicator are the electronic devices which shows the condition of the system. It indicates

what is happening in our system. LCD and LED are the indicators used in our system. We

have added LED indicator together with LCD because uneducated people cannot understand

LCD‟s output.

2.2.5 Power supply:

Power supply provides all necessary voltage and current for our system to operate. Power

supply used in this projects convert 220v AC supply in to 5v and 12v dc supply using

transformer, diodes, capacitor and regulator IC. A power supply can by broken down into a

series of blocks, each of which performs a particular function. For example a 5V regulated

supply.

The Circuit comprises on-board power supply circuit. The unregulated voltage is supplied a

transformer whose output is fed to the bridge rectifier which has capacitor - 2200µf/25V

Page 6: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 6/47

6 | P a g e

across its output terminals to eliminate any ripples. The series combination of LED - Green

and resistor 1KΩ are set across the capacitor to indicate the on state of circuit. Further, this

output of voltage regulator LM7805 has capacitor 0.1µf (ceramic) as load across output

terminal to eliminate any remaining ripples. The transformer used is 220V/50Hz to 0-

12V/500mA which is a step down transformer.

FIG 2.2: BLOCK DIAGRAM OF POWER SUPPY

CHAPTER 3 COMPONENTS USED

3.1 RESISTORS

FIG 3.1: RESISTORS

Page 7: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 7/47

7 | P a g e

Resistors are "Passive Devices", that is they contain no source of power or amplification but

only attenuate or reduce the voltage or current signal passing through them. This attenuation

results in electrical energy being lost in the form of heat as the resistor resists the flow of

electrons through it.

Then a potential difference is required between the two terminals of a resistor for current to

flow. This potential difference balances out the energy lost. When used in DC circuits the

potential difference, also known as a resistors voltage drop, is measured across the terminals

as the circuit current flows through the resistor.

Most resistors are linear devices that produce a voltage drop across themselves when an

electrical current flows through them because they obey Ohm's Law, and different values ofresistance produces different values of current or voltage. This can be very useful in

Electronic circuits by controlling or reducing either the current flow or voltage produced

across them.

There are many thousands of different Types of Resistors and are produced in a variety of

forms because their particular characteristics and accuracy suit certain areas of application,

such as High Stability, High Voltage, High Current etc, or are used as general purpose

resistors where their characteristics are less of a problem. Some of the common

characteristics associated with the humble resistor are; Temperature Coefficient, Voltage

Coefficient, Noise, Frequency Response, Power as well as Temperature Rating, Physical

Size and Reliability .

In all Electrical and Electronic circuit diagrams and schematics, the most commonly used

symbol for a fixed value resistor is that of a "zig-zag" type line with the value of its resistance

given in Ohms, Ω. Resistors have fixed resistance values from less than one ohm, ( <1Ω ) towell over tens of millions of ohms, ( >10MΩ ) in value. Fixed resistors have only one single

value of resistance, for example 100Ω'sbut vari able resistors (potentiometers) can provide an

infinite number of resistance values between zero and their maximum value.

Standard Resistor Symbols

Page 8: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 8/47

8 | P a g e

The symbol used in schematic and electrical drawings for a Resistor can either be a "zig-zag"

type line or a rectangular box.

All modern fixed value resistors can be classified into four broad groups;

Carbon Composition Resistor - Made of carbon dust or graphite paste, low wattage values

Film or Cermet Resistor - Made from conductive metal oxide paste, very low wattage values

Wire-wound Resistor - Metallic bodies for heatsink mounting, very high wattage ratings

Semiconductor Resistor - High frequency/precision surface mount thin film technology

There are a large variety of fixed and variable resistor types with different construction styles

available for each group, with each one having its own particular characteristics, advantages

and disadvantages compared to the others. To include all types would make this section very

large so I shall limit it to the most commonly used, and readily available general purpose

types of resistors.

Resistor Colour Code

We saw in the previous tutorial that there are many different types of Resistors available and

that they can be used in both electrical and electronic circuits to control the flow of current or

voltage in many different ways. But in order to do this the actual resistor needs to have some

form of "resistive" or "resistance" value. Resistors are available in a range of different

resistance values from fractions of an Ohm ( Ω ) to millions of Ohms.

Obviously, it would be impractical to have available resistors of every possible value for

example, 1Ω,2Ω, 3Ω, 4Ω etc, because literally hundreds of thousands, if not millions of

different resistors would need to exist to cover all the possible values. Instead, resistors are

manufactured in what are called "preferred values" with their resistance value printed onto

their body in coloured ink.

4 Coloured Bands

Page 9: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 9/47

9 | P a g e

The resistance value, tolerance, and wattage rating are generally printed onto the body of the

resistor as numbers or letters when the resistors body is big enough to read the print, such as

large power resistors. But when the resistor is small such as a 1/4W carbon or film type, these

specifications must be shown in some other manner as the print would be too small to read.

So to overcome this, small resistors use coloured painted bands to indicate both their resistive

value and their tolerance with the physical size of the resistor indicating its wattage rating.

These coloured painted bands produce a system of identification generally known as

a Resistors Colour Code .

An international and universally accepted resistor colour coding scheme was developed many

years ago as a simple and quick way of identifying a resistors ohmic value no matter what itssize or condition. It consists of a set of individual coloured rings or bands in spectral order

representing each digit of the resistors value.

A resistors colour code markings are always read one band at a time starting from the left to

the right, with the larger width tolerance band oriented to the right side indicating its

tolerance. By matching the colour of the first band with its associated number in the digit

column of the colour chart below the first digit is identified and this represents the first digit

of the resistance value. Again, by matching the colour of the second band with its associated

number in the digit column of the colour chart we get the second digit of the resistance value

and so on as illustrated below:

Page 10: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 10/47

10 | P a g e

FIG 3.2 : The Standard Resistor Colour Code Chart.

Colour Digit Multiplier Tolerance

Black 0 1

Brown 1 10 ± 1%

Red 2 100 ± 2%

Orange 3 1,000

Yellow 4 10,000

Green 5 100,000 ± 0.5%

Blue 6 1,000,000 ± 0.25%

Violet 7 10,000,000 ± 0.1%

Grey 8

Page 11: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 11/47

11 | P a g e

White 9

Gold 0.1 ± 5%

Silver 0.01 ± 10%

None ± 20%

TABLE 3.1: The Resistor Colour Code Table.

Calculating Resistor Values

The Resistor Colour Code system is all well and good but we need to understand how to

apply it in order to get the correct value of the resistor. The "left-hand" or the most significantcoloured band is the band which is nearest to a connecting lead with the colour coded bands

being read from left-to-right as follows;Digit, Digit, Multiplier = Colour, Colour x 10 colour in

Ohm's (Ω's) . For example, a resistor has the following coloured markings;

Yellow Violet Red = 4 7 2 = 4 7 x 10 2 = 4700Ω or 4k7.

The fourth and fifth bands are used to determine the percentage tolerance of the resistor.

Resistor tolerance is a measure of the resistors variation from the specified resistive value and

is a consequence of the manufacturing process and is expressed as a percentage of its

"nominal" or preferred value.

Typical resistor tolerances for film resistors range from 1% to 10% while carbon resistors

have tolerances up to 20%. Resistors with tolerances lower than 2% are called precision

resistors with the or lower tolerance resistors being more expensive. Most five band resistors

are precision resistors with tolerances of either 1% or 2% while most of the four band

resistors have tolerances of 5%, 10% and 20%. The colour code used to denote the tolerancerating of a resistor is given as;Brown = 1%, Red = 2%, Gold = 5%, Silver = 10 %. If resistor

has no fourth tolerance band then the default tolerance would be at 20%.

3.2 CRYSTAL OSCILLATOR

Page 12: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 12/47

12 | P a g e

FIG 3.3: CRYSTAL OSCILLATOR

A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a

vibrating crystal of piezoelectric material to create an electrical signal with a very precisefrequency. This frequency is commonly used to keep track of time (as in quartz

wristwatches), to provide a stable clock signal for digital integrated circuits, and to stabilize

frequencies for radio transmitters and receivers. The most common type of piezoelectric

resonator used is the quartz crystal, so oscillator circuits incorporating them became known

as crystal oscillators, but other piezoelectric materials including polycrystalline ceramics are

used in similar circuits.

Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens of

megahertz. More than two billion crystals are manufactured annually. Most are used for

consumer devices such as wristwatches, clocks, radios, computers, and cellphones. Quartz

crystals are also found inside test and measurement equipment, such as counters, signal

generators, and oscilloscopes.

3.4 IC BASE

FIG 3.4: IC BASE

Page 13: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 13/47

13 | P a g e

Using an IC base saves the IC from burning due to overheat if IC is soldered directly. Also,

changing an IC becomes very easy if the IC gets damaged due to some reason and once the

IC- base is soldered, the IC can be easily taken out and fitted back „n‟ number of times.

Before soldering the IC-Base it should be checked that all the pins have successfully pierced

the holes of the PCB and appeared on back side because sometimes the some pins are not

able to pierce and get damaged in the process. The IC-Base should be carefully installed

upright according to circuit, but if it gets soldered oppositely by mistake then there is no need

to de-solder the IC-Base, rather the IC should be fitted in the base keeping in mind the

orientation of the circuit .

3.5 DIODES

A diode is a semiconductor device which allows current to flow through it in only one

direction. Although a transistor is also a semiconductor device, it does not operate the way a

diode does. A diode is specifically made to allow current to flow through it in only one

direction. Some ways in which the diode can be used are listed here. A diode can be used as a

rectifier that converts AC (Alternating Current) to DC (Direct Current) for a power supply

device.

3.5.1 What is a Diode and how to work?

A diode is the simplest sort of semiconductor device. Broadly speaking, a semiconductor is a

material with a varying ability to conduct electrical current. Most semiconductors are made of

a poor conductor that has had impurities (atoms of another material) added to it. The process

of adding impurities is called doping.

In the case of LEDs, the conductor material is typically aluminum-gallium-arsenide(AlGaAs). In pure aluminum-gallium-arsenide, all of the atoms bond perfectly to their

neighbors, leaving no free electrons (negatively-charged particles) to conduct electric current.

In doped material, additional atoms change the balance, either adding free electrons or

creating holes where electrons can go. Either of these additions make the material more

conductive.

A semiconductor with extra electrons is called N-type material, since it has extra negatively-

charged particles. In N-type material, free electrons move from a negatively-charged area to a positively charged area.

Page 14: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 14/47

14 | P a g e

A semiconductor with extra holes is called P-type material, since it effectively has extra

positively-charged particles. Electrons can jump from hole to hole, moving from a

negatively-charged area to a positively-charged area. As a result, the holes themselves appear

to move from a positively-charged area to a negatively-charged area.

A diode comprises a section of N-type material bonded to a section of P-type material, with

electrodes on each end. This arrangement conducts electricity in only one direction. When no

voltage is applied to the diode, electrons from the N-type material fill holes from the P-type

material along the junction between the layers, forming a depletion zone. In a depletion zone,

the semiconductor material is returned to its original insulating state -- all of the holes are

filled, so there are no free electrons or empty spaces for electrons, and charge can't flow.

FIG 3.5: DEPLETION ZONE OF DIODE

At the junction, free electrons from the N-type material fill holes from the P-type material.

This creates an insulating layer in the middle of the diode called the depletion zone.

To get rid of the depletion zone, you have to get electrons moving from the N-type area to the

P-type area and holes moving in the reverse direction. To do this, you connect the N-type side

of the diode to the negative end of a circuit and the P-type side to the positive end. The free

electrons in the N-type material are repelled by the negative electrode and drawn to the

positive electrode. The holes in the P-type material move the other way. When the voltage

difference between the electrodes is high enough, the electrons in the depletion zone are

boosted out of their holes and begin moving freely again. The depletion zone disappears, and

charge moves across the diode.

Page 15: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 15/47

15 | P a g e

FIG 3.6: WORKING OF DIODE

When the negative end of the circuit is hooked up to the N-type layer and the positive end is

hooked up to P-type layer, electrons and holes start moving and the depletion zone

disappears.

If we try to run current the other way, with the P-type side connected to the negative end of

the circuit and the N-type side connected to the positive end, current will not flow. Thenegative electrons in the N-type material are attracted to the positive electrode. The positive

holes in the P-type material are attracted to the negative electrode. No current flows across

the junction because the holes and the electrons are each moving in the wrong direction. The

depletion zone increases.

3.6 LED

FIG 3.7 LEDS

Page 16: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 16/47

Page 17: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 17/47

17 | P a g e

silicon diode, for example, are arranged in such a way that the electron drops a relatively

short distance. As a result, the photon's frequency is so low that it is invisible to the human

eye -- it is in the infrared portion of the light spectrum. This isn't necessarily a bad thing, of

course: Infrared LEDs are ideal for remote controls, among other things.

Visible light-emitting diodes (VLEDs), such as the ones that light up numbers in a digital

clock, are made of materials characterized by a wider gap between the conduction band and

the lower orbitals. The size of the gap determines the frequency of the photon -- in other

words, it determines the color of the light.

While all diodes release light, most don't do it very effectively. In an ordinary diode, the

semiconductor material itself ends up absorbing a lot of the light energy. LEDs are specially

constructed to release a large number of photons outward. Additionally, they are housed in a

plastic bulb that concentrates the light in a particular direction. As you can see in the diagram,

most of the light from the diode bounces off the sides of the bulb, traveling on through the

rounded end.

3.7 MICRO CONTROLLER

Important features and applications of 8051:

8051 architecture provides many functions (ROM, RAM, CPU, I/O, interrupt logic, timer.

Etc.) in a single package.

8-bit ALU, Accumulator, 8-bit Registers and 8-bit data bus; hence it is an 8-

bit microcontroller

Boolean processor Multiply, divide and compare instructions

4 register banks (memory mapped)

Fast interrupt with register bank switching

Interrupts with selectable priority [3]

Dual 16-bit address bus – It can access 2 x 2 16 memory locations – 64 KB (65536

locations) each of RAM and ROM

128 bytes of on-chip RAM (IRAM)

Page 18: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 18/47

18 | P a g e

4 KB of on-chip ROM, with a 16-bit (64 KB) address space (PMEM)

Four byte bi-directional input/output port

USART (serial port)

Two 16-bit Counter/timers Power saving mode (on some derivatives)

3.7.1 Pin diagram:

Fig 3.8: Pin diagram of 8051

3.8 LCD DISPLAY

Page 19: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 19/47

19 | P a g e

FIG 3.9: LCD Display

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 LED s. 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. Click to learn more about internal structure of a LCD .

Page 20: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 20/47

20 | P a g e

FIG 3.10: Pin diagram of LCD display

Pin Description:

Pin

No Function Name

1 Ground (0V) Ground

2 Supply voltage; 5V (4.7V – 5.3V) Vcc

Page 21: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 21/47

21 | P a g e

3 Contrast adjustment; through a variable resistor VEE

4 Selects command register when low; and data register when

high

Register Select

5 Low to write to the register; High to read from the register Read/write

6 Sends data to data pins when a high to low pulse is given Enable

7

8-bit data pins

DB0

8 DB1

9 DB2

10 DB3

11 DB4

12 DB5

13 DB6

14 DB7

15 Backlight V CC (5V) Led+

16 Backlight Ground (0V) Led-

TABLE 3.2: Pin description of LCD display

3.8 TRANSISTORS

A transistor is a semiconductor device , commonly used as an amplifier or an electrically

controlled switch. The transistor is the fundamental building block of the circuitry in

computers , cellular phones , and all other modern devices. Because of its fast response and

accuracy, the transistor is used in a wide variety of digital and analog functions, including

amplification , switching , voltage regulation , signal modulation , and oscillators . There are

mainly two groups of transistors the BJT & the FET. The BJT has both polarity carriers i.e.

Holes and Electrons, while the FET is a special transistor having only one type of carrier

responsible for conduction. Generally there are two types of transistors. They are the NPN &

Page 22: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 22/47

22 | P a g e

the PNP. The NPN type has p-type material sandwiched between the n- type materials while

the PNP has n- type material sandwiched between the p- type materials. The transistor has

three terminals namely Base, Collector & Emitter.

3.8.1 BC 548 TRANSISTOR

FIG 3.11: BC548 Transistor

The pinout for the package used for the BC546 to BC560 has pin 1 (the leftmost pin in the

diagram above, i.e. when the flat face of the package faces the viewer with leads at the

bottom) attached to the collector, pin 2 connected to the base, and pin 3 connected to the

emitter.

3.9 BUZZER

Page 23: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 23/47

23 | P a g e

FIG 3.12: Buzzer

Piezo buzzer is an electronic device commonly used to produce sound. Light weight, simple

construction and low price make it usable in various applications like car/truck reversingindicator, computers, call bells etc. Piezo buzzer is based on the inverse principle of piezo

electricity discovered in 1880 by Jacques and Pierre Curie. It is the phenomena of generating

electricity when mechanical pressure is applied to certain materials and the vice versa is also

true. Such materials are called piezo electric materials. Piezo electric materials are either

naturally available or manmade. Piezoceramic is class of manmade material, which poses

piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When

subjected to an alternating electric field they stretch or compress, in accordance with thefrequency of the signal thereby producing sound

3.10 VOLTAGE REGULATOR

A voltage regulator is designed to automatically maintain a constant voltage level. Depending

on the design, it may be used to regulate one or more AC or DC voltages.

Page 24: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 24/47

24 | P a g e

FIG 3.13: Schematic View of Voltage regulator

Electronic voltage regulators are found in devices such as computer power supplies where

they stabilize the DC voltages used by the processor and other elements. In

automobile alternators and central power station generator plants, voltage regulators controlthe output of the plant. In an electric power distribution system, voltage regulators may be

installed at a substation or along distribution lines so that all customers receive steady voltage

independent of how much power is drawn from the line.

As our IC i.e 8051 microcontroller works on 5volt, so we have to regulate supply around 5

volts so that it will not harm our IC, otherwise IC may burn..

FIG 3.14: Internal circuit of voltage regulator

The Zener Diode is used in its "reverse bias". From the I-V Characteristics curve we can

study that the zener diode has a region in its reverse bias characteristics of almost a constant

negative voltage regardless of the value of the current flowing through the diode and remains

nearly constant even with large changes in current as long as the zener diodes current remains

between the breakdown current I Z(min) and the maximum current rating I Z(max)

Page 25: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 25/47

25 | P a g e

3.11 RELAYS

A relay is an electrical switch that opens and closes under the control of

another electrical circuit. In the original form, the switch is operated by an

el ec tr omagne t to open or close one or many sets of contacts. It was invented by Joseph

Henry in 1835. Because a relay is able to control an output circuit of higher power than the

input circuit, it can be considered to be, in a broad sense, a form of an electrical

amplifier.

Page 26: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 26/47

26 | P a g e

FIG 3.15: Diagram of sugar cube relays

Despite the speed of technological developments, some products prove so popular tha t

their key parameters and design features remain virtually unchanged for years.

One such product is the „sugar cube‟ relay, shown in the figure above, which has proved

useful to many designers who needed to switch up to 10A, whilst using relativelylittle PCB area Since relays are switches, the terminology applied to switches is

al so ap pl ied to relays. A relay will switch one or more poles, each of whose contacts can be

thrown by energizing the coil in one of three ways:

Normally open pins: cont acts conn ect the circuit when the relay is

activated; the circuit is disconnected when the relay is inactive. It is also called a

FORM A contact or “make” contact.

Normally closed pins: contacts disconnect the circuit when the relay is activated, thecircuit is connected when relay is inactive. It is also called FORM B contact or break

contact

Change over or double through: contacts control two circuits ; one

normally open contact and one normally – closed contact with a common

terminal. It is also called a “ form C transfer contact”.

Page 27: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 27/47

27 | P a g e

CHAPTER 4 WORKING OF WATER LEVEL CONTROLLER

4.1 CIRCUIT DIAGRAM

FIG 4.1: Circuit diagram of water level controller

The figure shown above is the simple circuit diagram of our project. It is a simple illustration

of how we have implemented our project and the various parts involved in it. From the above

representation, the transistors are used as sensors to read status of water level and sends

different signal to the microcontroller.

Page 28: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 28/47

28 | P a g e

4.2 WORKING

A water level controller based using 8051 is shown in circuit diagram. This water level

controller monitors the level of the over head tank and automatically switches on the water

pump whenever the level goes below a preset limit. The level of the over head tank is

indicated using 5 led‟s and the pump is switched of when the over head tank is filled. The

pump is not allowed to start if the water level in the sump tank is low and also the pump is

switched off when the level inside the sump tank goes low during a pumping cycle. The

circuit diagram of the water level controller is shown below.

The level sensor probes for the overhead tank are interfaced to the port 2 of the

microcontroller through transistors. Have a look at the sensor probe arrangement for theoverhead tank in Fig1. A positive voltage supply probe goes to the down bottom of the tank.

The probes for sensing 1/4, 1/2, 3/4 and FULL levels are placed with equal spacing one by

one above the bottom positive probe. Consider the topmost (full level) probe, its other end is

connected to the base of transistor Q4 through resistor R16. Whenever water rises to the full

level current flows into the base of transistor Q4 which makes it ON and so its collector

voltage goes low. The collector of Q4 is connected to P2.4 and a low voltage at P2.4 means

the over head tank is FULL. When water level goes below the full level probe, the base ofQ2 becomes open making it OFF. Now it is collector voltage goes high and high at P2.4

means the tank is not full. The same applies to other sensor probes (3/4, 1/2, 1/4) and the

microprocessor understands the current level by scanning the port pins P2.4 ,P2.5, P2.6 and

P2.7. All these port pin are high (all sensor probes are open) means the tank is empty.

Port pin P0.5 is used to control the pump. Whenever it is required start pumping, the

controller makes P0.5 low which makes transistor Q6 ON which in turn activates the relay

K1 that switches the pump. Also the LED d6 glows indicating the motor is ON. LED D7 is

the low sump indicator. When the water level in the sump tank goes low, the controller makes

P0.7 low which makes LED D7 to glow.

4.3 PROGRAM

ORG 00H

MOV P2,#11111000B // INITIATES P2 AS SENSOR INPUT

Page 29: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 29/47

Page 30: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 30/47

30 | P a g e

MAIN:

ACALL SMPCK // CHECKS THE LEVEL OF THE SUMP TANK

MOV A,P2 // MOVES THE CURRENT STATUS OF P2 TP A

ACALL ABC

CJNE A,#00001000B,LABEL1 // CHECKS WHETHER TANK IS FULL

SETB P0.1// SWITCH OFF OTHER LED'S

SETB P0.2

SETB P0.3

SETB P0.4

CLR P0.0 // GLOWS FULL LEVEL LED

MOV A,#'F'

ACALL DATAWRT

ACALL DELAY

MOV A,#'U'

ACALL DATAWRT

ACALL DELAY

MOV A,#'L'

ACALL DATAWRT

ACALL DELAY

Page 31: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 31/47

31 | P a g e

MOV A,#'L'

ACALL DATAWRT

ACALL DELAY

MOV A,#01H

ACALL COMNWRT

ACALL DELAY

SETB P0.5// SWITCH OFF PUMP

LABEL1:MOV A,P2

ACALL ABC

CJNE A,#00011000B,LABEL2 // CHECKS WHETHER TANK IS 3/4

SETB P0.0

SETB P0.2

SETB P0.3

SETB P0.4

CLR P0.1 // GLOWS 3/4 LEVEL LED

MOV A,#'T'

ACALL DATAWRT

ACALL DELAY

MOV A,#'H'

ACALL DATAWRT

Page 32: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 32/47

32 | P a g e

ACALL DELAY

MOV A,#'I'

ACALL DATAWRT

ACALL DELAY

MOV A,#'R'

SJMP MAIN4

MAIN3:SJMP MAIN

MAIN4:ACALL DATAWRT

ACALL DELAY

MOV A,#'D'

ACALL DATAWRT

ACALL DELAY

MOV A,#'F'

ACALL DATAWRT

ACALL DELAY

MOV A,#'O'

ACALL DATAWRT

ACALL DELAY

MOV A,#'U'

ACALL DATAWRT

Page 33: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 33/47

33 | P a g e

ACALL DELAY

MOV A,#'R'

ACALL DATAWRT

ACALL DELAY

MOV A,#'T'

ACALL DATAWRT

ACALL DELAY

MOV A,#'H'

ACALL DATAWRT

ACALL DELAY

MOV A,#01H

ACALL COMNWRT

ACALL DELAY

LABEL2:MOV A,P2

ACALL ABC

CJNE A,#00111000B,LABEL3 // CHECKS WHETHER TANK IS 1/2

SETB P0.0

SETB P0.1

SETB P0.3

SETB P0.4

Page 34: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 34/47

34 | P a g e

CLR P0.2 // GLOWS 1/2 LEVEL LED

MOV A,#'H'

ACALL DATAWRT

ACALL DELAY

MOV A,#'A'

ACALL DATAWRT

ACALL DELAY

MOV A,#'L'

ACALL DATAWRT

ACALL DELAY

MOV A,#'F'

ACALL DATAWRT

ACALL DELAY

MOV A,#01H

ACALL COMNWRT

ACALL DELAY

LABEL3:MOV A,P2

ACALL ABC

CJNE A,#01111000B,LABEL4 // CHECKS WHETHER TANK IS 1/4

SETB P0.0

Page 35: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 35/47

35 | P a g e

SETB P0.1

SETB P0.2

SETB P0.4

CLR P0.3 // GLOWS 1/4 LEVEL LED

SJMP MAIN2

MAIN1:SJMP MAIN3

MAIN2:MOV A,#'O'

ACALL DATAWRT

ACALL DELAY

MOV A,#'N'

ACALL DATAWRT

ACALL DELAY

MOV A,#'E'

ACALL DATAWRT

ACALL DELAY

MOV A,#'F'

ACALL DATAWRT

ACALL DELAY

MOV A,#'O'

ACALL DATAWRT

Page 36: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 36/47

36 | P a g e

ACALL DELAY

MOV A,#'U'

ACALL DATAWRT

ACALL DELAY

MOV A,#'R'

ACALL DATAWRT

ACALL DELAY

MOV A,#'T'

ACALL DATAWRT

ACALL DELAY

MOV A,#'H'

ACALL DATAWRT

ACALL DELAY

MOV A,#01H

ACALL COMNWRT

ACALL DELAY

JB P0.6,LABEL4

CLR P0.5 // SWITCHES MOTOR ON

LABEL4:MOV A,P2

ACALL ABC

Page 37: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 37/47

37 | P a g e

CJNE A,#11111000B,MAIN1 // CHECKS WHETHER TANK IS EMPTY

SETB P0.0

SETB P0.1

SETB P0.2

SETB P0.3

CLR P0.4 // GLOWS EMPTY LED

MOV A,#'E'

ACALL DATAWRT

ACALL DELAY

MOV A,#'M'

ACALL DATAWRT

ACALL DELAY

MOV A,#'P'

ACALL DATAWRT

ACALL DELAY

MOV A,#'T'

ACALL DATAWRT

ACALL DELAY

MOV A,#'Y'

ACALL DATAWRT

Page 38: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 38/47

38 | P a g e

ACALL DELAY

CLR P3.7 //BUZZER

ACALL DELAY

ACALL DELAY

ACALL DELAY

ACALL DELAY

ACALL DELAY

MOV A,#01H

ACALL COMNWRT

ACALL DELAY

SETB P3.7 // BUZZER

JB P0.6,MAIN9 // CHECKS WHETHER SUMP IS LOW

CLR P0.5 // SWITCHES MOTOR ON

MAIN9:AJMP MAIN1

SMPCK:JB P0.6,LABEL5 // CHECKS WHETHER SUMP IS LOW

SETB P0.7 // EXTINGUISHES THE SUMP LOW INDICATOR LED

SJMP LABEL6

LABEL5:SETB P0.5 // SWITCHES THE PUMP OFF

Page 39: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 39/47

39 | P a g e

CLR P0.7 // GLOWS SUMP LOW INDICATOR LED

LABEL6:RET

COMNWRT: MOV P1,A

CLR P2.2 //RS

CLR P2.1 //RW

SETB P2.0 //EN

ACALL DELAY

CLR P2.0 //EN

RET

DATAWRT: MOV P1,A

SETB P2.2 //RS

CLR P2.1 //RW

SETB P2.0 // EN

ACALL DELAY

CLR P2.0 //EN

RET

DELAY: MOV R3,#120

HERE2: MOV R4,#255

HERE: DJNZ R4,HERE

Page 40: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 40/47

40 | P a g e

DJNZ R3,HERE2

RET

ABC:CLR P2.0

CLR P2.2

CLR P2.1

RET

END

Page 41: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 41/47

41 | P a g e

CHAPTER 5 RESULTS AND DISCUSSIONS

5.1 KEIL SOFTWARE

5.1.1 INTRODUCTION TO KEIL

Keil MicroVision is an integrated development environment used to create software to be run

on embedded systems (like a microcontroller). It allows for such software to be written either

in assembly or C programming languages and for that software to be simulated on a computer

before being loaded onto the microcontroller.

µVision3 is an IDE (Integrated Development Environment) that helps write, compile, and

debug embedded programs. It encapsulates the following components:

A project manager.

Make facility.

Tool configuration

Editor

A powerful debugger.

5.1.2 TO CREATE A NEW PROJECT IN UVISION3:

1. Select Project - New Project.

2. Select a directory and enter the name of the project file.

3. Select Project = Select Device and select a device from Device Database.

4. Create source files to add to the project

5. Select Project - Targets, Groups, and Files. Add/Files, select Source Group1, and add the

source files to the project.

6. Select Project - Options and set the tool options. Note that when the target device is

selected from the Device Database all-special options are set automatically. Default memory

model settings are optimal for most applications.

Page 42: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 42/47

42 | P a g e

7. Select Project - Rebuild all target files or Build target.

To create a new project, simply start MicroVision and select Project=>New Project from the

pull down menus. In the file dialog that appears, choose a name and directory for the project.

It is recommended that a new directory be created for each project, as several files will be

generated. Once the project has been named, the dialog shown in the figure below will

appear, prompting the user to select a target device. In this lab, the chip being used is the

AT89C52, which is listed under the heading Atmel.

Window for choosing target device.

Next, Micro Vision must be instructed to generate a HEX file upon program compilation. A

HEX file is a standard file format for storing executable code that is to be loaded onto themicrocontroller. In the Project Workspace pane at the left, right click on Target 1 and select

Options for 1 .Under the Output tab of the resulting options dialog, ensure that both the

Create Executable and Create HEX File options are checked. Then click OK.

Project Options Dialog

Next, a file must be added to the project that will contain the project code. To do this, expand

the Target 1 heading, right click on the Source Group 1 folder, and select Add files. Create anew blank file (the file name should end in .asm), select it, and click Add. The new file

should now appear in the Project Workspace pane under the Source Group 1 folder. Double-

click on the newly created file to open it in the editor. All code for this lab will go in this file.

To compile the program, first save all source files by clicking on the Save All button, and

then click on the Rebuild All Target Files to compile the program as shown in the figure

below. If any errors or warnings occur during compilation, they will be displayed in the

output window at the bottom of the screen. All errors and warnings will reference the line and

column number in which they occur along with a description of the problem so that they can

be easily located. Note that only errors indicate that the compilation failed, warnings do not

(though it is generally a good idea to look into them anyway).

Project Workspace Pane

Save All and Build All Target Files Buttons

Page 43: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 43/47

43 | P a g e

When the program has been successfully compiled, it can be simulated using the integrated

debugger in Keil MicroVision. To start the debugger, select Debug=>Start/Stop Debug

Session from the pull down menus.

At the left side of the debugger window, a table is displayed containing several key

parameters about the simulated microcontroller, most notably the elapsed time (circled in the

figure below). Just above that, there are several buttons that control code execution. The Run

button will cause the program to run continuously until a breakpoint is reached, whereas the

Step Into button will execute the next line of code and then pause (the current position in the

program is indicated by a yellow arrow to the left of the code).

5.2 PROGRAMMER

The programmer used is a powerful programmer for the Atmel 89 series of microcontrollers

that includes 89C51/52/55, 89S51/52/55 and many more.

It is simple to use & low cost, yet powerful flash microcontroller programmer for the Atmel

89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and Blank

Check. All fuse and lock bits are programmable. This programmer has intelligent onboard

firmware and connects to the serial port. It can be used with any type of computer and

requires no special hardware. All that is needed is a serial communication port which all

computers have.8051 to USB programmer is used here.

.

5.3 PCB LAYOUT

Layout designing to a generic strip board can be very inefficient due to human error in layout

and solder connections. Strip boards are also not aesthetically pleasing. A better solution,which is both more professional When the development stage of a circuit board is complete

and working correctly, it is then necessary to take this breadboard prototype and create a

sharp looking finished product. A prototype can be moved to a strip board inexpensively and

fast, not to mention at basically no cost. However, this movement looking and more robust,

is to create a Printed Circuit Board.The design of a Printed Circuit Board (PCB) requires a

completed or near completed and functional breadboard circuit. In the best-case situation, the

full circuit will be laid out on the breadboard and can then be transferred to the PCB. The

PCB is where the connections and components must come together correctly to ensure proper

Page 44: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 44/47

44 | P a g e

functionality. When transferring the design, the PCB will allow for a much smaller PCB then

the breadboard. The user can achieve this by closer interconnects and component placement

as well as some reduced some chip sizes. Another benefit to designing a PCB specific to the

product is that the PCB can be made any 2-dimensional size and shape. This allows the PCB

to fit into the design and not trying to fit the design around the PCB. Once a PCB has been

designed it can be produced hundred of times with exact precision. Therefore, the PCB

designer should take care when designing it to ensure it is correct, efficient, and as

inexpensive as possible.

Designing the Board

Start by installing the ExpressPCB freeware. The software can be found at

ExpressPCB.com.

Once the software has been installed, start by opening ExpressPCB. The program

defaults to a two-layer board.

ExpressPCB defaults to a PCB size of 3.8 inches by 2.50 inches. Selecting the View

tab then clicking on Options can easily change the units.

Placing Components

When placing components there are a few important steps that will make the design run

smoother. First, place all large components. Second, attempt to place components that are

connected to one another as close together as possible to eliminate excess traces. Third, keep

in mind that wireless or other components that are used for transmitting or receiving a signal

should be kept towards the perimeter of the board. By keeping these components as near to

the perimeter as possible the user can reduce the chance of interference. Keeping the abovelisted suggestions in mind one can locate the per-existing components under the Components

tab by clicking the Component Manager link.

Placing Traces

Similar to placing components there are a few helpful hints for placing traces. First, avoid 90

degree traces. Right angle traces cause a decrease in impedance. A simple solution is to use

45 degree traces. Second, never cross power or ground traces. Third, keep traces as short as

Page 45: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 45/47

45 | P a g e

possible this keeps them efficient. Fourth, keep trace width in mind. Depending on the

component and the connection, these will vary. Keeping these hints in mind, the user should

begin by supplying a voltage and ground trace to each component for which is it required.

Notice that the default thickness of the trace is 0.010 inches. Typically a ground trace is 0.025

inches wide.

Ordering a PCB

Take top view and bottom view printouts. Once the PCB has been created and verified the

user can place an order.

Page 46: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 46/47

46 | P a g e

CHAPTER 6 APPLICATIONS , LIMITATIONS , CONCLUSION

1.1 APPLICATIONS

The automatic water level controller system can be used broadly over different fields. Some

of the major fields are listed below:

Personal use

Office use

Business

Education

1.2 LIMITATIONS

If the one wire of the sensor is broken system is halted

Sensor operated on the principle of water conduct electricity so sometimes it doesn‟t

work so we can change sensor type as our requirement.

System debugging is difficult for normal user

1.3 CONCLUSION

After analyzing and working in this project we concluded that project is very useful in daily

life of people .We faced few problems while doing this project till. We did a group work and

with the help of our supervisor and faculty members we are so close in success of our project.

Thus, the project we have undertaken has helped us gain a better perspective on various

aspects related to our course of study as well as practical knowledge of electronic equipment.

We became familiar with software analysis, designing, implementation, testing and

maintenance concerned with our project. we are developing a useful project that could

indicate levels of water and helping general public to avoid wastage of precious natural

resource water when not required or by switching motor on and off according to the display

on LCD‟s & LED‟s.

Page 47: water project (1).docx

8/11/2019 water project (1).docx

http://slidepdf.com/reader/full/water-project-1docx 47/47

REFERENCES

http://www.thefreedictionary.com/buzzer

www.datasheetarchive.com

www.alldatasheet.com

www.answers.com

www.google.com

The 8051Microcontroller by Kenneth J. Ayala

The 8051 Microcontroller and Embedded Systems by Muhammad Ali Mazidi.

http://www.electronicsforu.com/EFYLinux/efyhome/cover/February2010/Develo

ping-PCBs.pdf