Sei sulla pagina 1di 24

A Report on Mini Project

Prepared by:

T.E. EXTC
A project submitted on partial fulfilment of Term Work.
Approved by:

____________
___________
Prof. Rashmi
Sub In Charge

___________
Prof. V. N. Pawar

Prof. D. G. Borse

HOD EXTC

Principal

ACKNOWLEDGEMENT

We sincerely acknowledge Prof. Rashmi for her valuable inputs regarding the
report. Her suggestions were of the utmost importance to us in building our
project.
We would also like to acknowledge the support given by all our subject teachers,
lab assistants without which, the report would not have been successful. We also
like to thank Microsoft for designing such software which made our work much
easier.
We express our heartfelt towards our HOD, Prof. V.N. PAWAR for his support
and guidance and are grateful to our principal Dr. D.G. BORSE who gave us the
opportunity to enhance our presentation techniques through the making of the
report for this subject.

Table of Contents

Serial No.
1
2
3
3.1
3.2
3.3
4
4.1
4.2
4.3
4.4
5
6
7
8
9

Contents
ABSTRACT
INTRODUCTION
DESIGNING
CIRCUIT DIAGRAM
DISCRIPTION
COMPONENTS
COMPONENTS DISCRIPTION
MICROCONTROLLER AT89C52
LCD DISPLAY
RELAY
MOTOR
PROGRAM CODE
ADVANTAGES
APPLICATION
CONCLUSION
REFERENCE

Page No.

1. Abstract
Water scarcity is one of the major problems facing major cities of the world and
wastage during transmission has been identified as a major culprit; this is one of
the motivations for this research, to deploy computing techniques in creating a
barrier to wastage in order to not only provide more financial gains and energy
saving, but also help the environment and water cycle which in turn ensures that

we save water for our future. We presented our research in embedding a control
system into an automatic water pump controller through the use of different
technologies in its design, development, and implementation. The system used
microcontroller to automate the process of water pumping in an over-head tank
storage system and has the ability to detect the level of water in a tank, switch
on/off the pump accordingly and display the status on an LCD screen. This
research has successfully provided an improvement on existing water level
controllers by its use of calibrated circuit to indicate the water level and use of
DC instead of AC power thereby eliminating risk of electrocution.

Keywords:
Microcontroller, conductivity, water pump, assembly language, computer simulation, waste

List of Figures

Serial No.
1
2

Contents
CIRCUIT DIAGRAM
MICROCONTROLLER AT89C52

Page No.

3
4
5
6
7
8
9
10
11
12

PIN DIAGRAM OF 89C52


PIN DESCRIPTION OF 89C52
LCD PIN DIAGRAM
LCD DISPLAY
RELAY
MOTOR
TRANSISTOR
RESISTOR
CAPACITOR
DIODE

PROJECT ON
WATER LEVEL CONTROLLER
WITH INDICATOR
USING MICROCONTROLLER

2. Introduction
Pumps are essential in the water supply field, wooden pumps existed in the
1700s and these were used to empty the bilges of ships. They were made from
bored logs with wooden pistons to create suction. Metal piston type pumps,
driven by steam, were developed in the early to mid-1800s but it was not until

the advent of electrically driven pumps that water system expansion became
feasible on a large scale. Layne Bowler developed the first vertical turbine water
pumps in 1894 and Jacuzzi developed the first submersible pumps in the 1920s.
These manufacturing developments provided the hardware to allow the
establishment of many New Hampshire public water systems in the very late
1800s (Hicks et al., 1971). Automatic water pump controller is a series of
functions to control the Automatic Water Pump Controller Circuit in a reservoir or
water storage. The water level sensor is made with a metal plate mounted on the
reservoir or water tank, with a sensor in the short to create the top level and a
detection sensor for detecting long again made for the lower level and ground
lines connected to the bottom of reservoirs or reservoir. In everyday life, there
must be some physical elements that need to be controlled in order for them to
perform their expected behaviours. A control system therefore can be defined as
a device, or set of devices, that manages, commands, directs or regulates the
behaviour of other device(s) or system(s). Consequently, automatic controlling
involves designing a control system to function with minimal or no human
interference. Intelligent systems are being used in a wide range of fields
including from medical sciences to financial sciences, education, law, and so on.
Several of them are embedded in the design of everyday devices. This paper
aimed at presenting our project in embedding a control system into an automatic
water pump controller. One of the motivations for this research was the need to
bring a solution to the problem of water shortage in various places eliminating
the major culprit; waste of water during pumping and dispensing into overhead
thanks. We believe that creating a barrier to wastage will not only provide more
financial gains and energy saving, but will also help the environment and water
cycle which in turn ensures that we save water for our future.

3. Designing
3.1 Circuit Diagram

Fig. 3.1.1

3.2

Description

This circuit works on the principle that water conducts electricity. Two wires
connected to VCC and two other wires are dipped in tank at different levels
namely top & bottom and their output are taken on pins P2.6, P2.7 via transistor

BC547. Port P1 is connected to data pins of LCD and P3.2, P3.3, P3.4 are
respectively connected to RS, RW, and EN pins of LCD.
Initially when the tank is empty motor will be on automatically & LCD will show
the message Motor on. As the tank starts filling up wire at different levels get
some positive voltage, due to conducting nature of water. This voltage is then
fed to their corresponding pins on controller. When tank gets full motor will be on
automatically & LCD shows the message Motor Off.

3.3

Components

Circuit Components:

At89c52 controller
At89c52 programming board.
16*2 LCD
12V Relay
Bc547 (NPN) transistors 2
Transistor (BC 337)=1
Crystal oscillator 11.0592MHz
Resistors (1K) 3
Resistors (10K) 1
Capacitor (1uf)-4
Resistor 500 ohm
AC Motor
Pot 10k
Programming cable
Connecting wires

4. Components Description
4.1 Microcontroller

Fig.4.1.1
AT89C52 is

an

8-bit microcontroller and

belongs

to

Atmel's 8051

family.

AT89C52 has 8KB of Flash programmable and erasable read only memory
(PEROM) and 256 bytes of RAM. AT89C52 has an endurance of 1000 Write/Erase
cycles which means that it can be erased and programmed to a maximum of
1000 times.
Though very slight difference between the features of AT89C51 and AT89C52,
they

are

very

similar

in

their

pin

configurations*

and

operations.

The differences between AT89C51 and AT89C52 have been tabulated below.

RAM
Flash
Number of Timers/Counters
Number of Interrupt Sources

AT89C52
256 Bytes
8 KB
3 (16-bit each)
8

AT89C51
128 Bytes
4 KB
2 (16-bit each)
6

*The pin configuration of AT89C52 is exactly similar to that of AT89C51


except that the first two pins, P1.0 and P1.1 are multiplexed to correspond to
Timer2 operations as given in the following table.
Existing
P1.0
P1.1

Alternate
T2
T2 EX

Function
Timer/counter 2 External Count input
Timer/counter 2 Trigger input

While AT89C51 has two timers (Timer0 & Timer1), AT89C52 also has Timer2.
Corresponding to Timer2, there are extra SFRs (Special Function Registers)
T2CON & T2MOD. Also there are registers RCAP2H & RCAP2L to configure 16 bit
Capture & Auto-reload modes of Timer2.

Pin Diagram

Fig.4.1.2

Pin Description

Pin No
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

Function
External count input to Timer/Counter 2, clock-out
Timer/Counter 2 capture/reload trigger and
direction control

Name
P1.0

T2 EX

P1.1

8 bit input/output port (P1) pins

Reset pin; Active high


Input (receiver) for serial
RxD
communication
Output (transmitter) for serial
TxD
communication
External interrupt 1
Int0
External interrupt 2
Int1
Timer1 external input
T0
Timer2 external input
T1
Write to external data memory
Write
Read from external data
Read
memory

P3.1
8 bit input/output
port (P3) pins

Ground (0V)
8 bit input/output port (P2) pins
/
High-order address bits when interfacing with external
memory

Program store enable; Read from external program memory


Address Latch Enable
Program pulse input during Flash programming
External Access Enable; Vcc for internal program executions
Programming enable voltage; 12V (during Flash programming)

8 bit input/output port (P0) pins


Low-order address bits when interfacing with external memory

Supply voltage; 5V (up to 6.6V)

LCD 162 (LM016L)

P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
Reset
P3.0

Quartz crystal oscillator (up to 24 MHz)

Fig.4.1.3

4.2

T2

P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
Crystal 2
Crystal 1
Ground
P2.0/ A8
P2.1/ A9
P2.2/ A10
P2.3/ A11
P2.4/ A12
P2.5/ A13
P2.6/ A14
P2.7/ A15
PSEN
ALE
Prog
EA
Vpp
P0.7/ AD7
P0.6/ AD6
P0.5/ AD5
P0.4/ AD4
P0.3/ AD3
P0.2/ AD2
P0.1/ AD1
P0.0/ AD0
Vcc

Fig.4.2.1
Fig.4.2.2

Introduction
The most commonly used Character based LCDs are based on Hitachis HD44780
controller or other which are compatible with HD44580. we will discuss about
character based LCDs, their interfacing with various microcontrollers, various
interfaces (8-bit/4-bit), programming, special stuff and tricks you can do with
these simple looking LCDs which can give a new look to your application.

Pin Description
The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4
Line LCDs which have only 1 controller and support at most of 80 charachers,
whereas LCDs supporting more than 80 characters make use of 2 HD44780
controllers.
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins
(two pins are extra in both for back-light LED connections). Pin description is
shown in the table below.

Character LCD type HD44780 Pin diagram

Pin No.

Name

Description

Pin no. 1

VSS

Power supply (GND)

Pin no. 2

VCC

Power supply (+5V)

Pin no. 3

VEE

Contrast adjust

Pin no. 4

RS

0 = Instruction input
1 = Data input

Pin no. 5

R/W

0 = Write to LCD Module


1 = Read from LCD module

Pin no. 6

EN

Enable signal

Pin no. 7

D0

Data bus line 0 (LSB)

Pin no. 8

D1

Data bus line 1

Pin no. 9

D2

Data bus line 2

Pin no.
10

D3

Data bus line 3

Pin no.
11

D4

Data bus line 4

Pin no.
12

D5

Data bus line 5

Pin no.
13

D6

Data bus line 6

Pin no.
14

D7

Data bus line 7 (MSB)

Fig.4.2.3

4.3

Relay

Fig.4.3.1
A relay is an electrically operated switch. Many relays use an electromagnet to
mechanically operate a switch, but other operating principles are also used, such
as solid-state relays. 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 as amplifiers: they
repeated the signal coming in from one circuit and re-transmitted it on another
circuit. 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".

4.4

Motor

Fig.4.4.1
An electric motor is an electrical machine that converts electrical energy into
mechanical energy. The reverse of this would be the conversion of mechanical
energy into electrical energy and is done by an electric generator.
In normal motoring mode, most electric motors operate through the interaction
between an electric motor's magnetic field and winding currents to generate
force within the motor. In certain applications, such as in the transportation
industry with traction motors, electric motors can operate in both motoring and
generating or braking modes to also produce electrical energy from mechanical
energy.
Found in applications as diverse as industrial fans, blowers and pumps, machine
tools, household appliances, power tools, and disk drives, electric motors can be
powered by direct current (DC) sources, such as from batteries, motor vehicles or
rectifiers, or by alternating current (AC) sources, such as from the power grid,
inverters or generators. Small motors may be found in electric watches. Generalpurpose motors with highly found in applications as diverse as industrial fans,
blowers and pumps, machine tools, household appliances, power tools. An
electric motor is an electrical machine that converts electrical energy into
mechanical energy. The reverse of this would be the conversion of mechanical
energy into electrical energy and is done by an electric generator.
In normal motoring mode, most electric motors operate through the interaction
between an electric motor's magnetic field and winding currents to generate
force within the motor. In certain applications, such as in the transportation
industry with traction motors, electric motors can operate in both motoring and
generating or braking modes to also produce electrical energy from mechanical
energy.
Disk drives, electric motors can be powered by direct current (DC) sources, such
as standardized dimensions and characteristics provide convenient mechanical
power for industrial use. The largest of electric motors are used for ship

propulsion, pipeline compression and pumped-storage applications with ratings


reaching 100 megawatts. Electric motors may be classified by electric power
source type, internal construction, application, type of motion output, and so on.
Electric motors are used to produce linear or rotary force (torque), and should be
distinguished from devices such as magnetic solenoids and loudspeakers that
convert electricity into motion but do not generate usable mechanical powers,
which are respectively referred to as actuators and transducers.

4.5

Transistor BC 547
Pin Diagram

Fig.4.5.1

BC547 is mainly used for amplification and switching purposes. It has a


maximum current gain of 800. Its equivalent transistors are BC548 and BC549.
The transistor terminals require a fixed DC voltage to operate in the desired
region of its characteristic curves. This is known as the biasing. For amplification
applications, the transistor is biased such that it is partly on for all input
conditions. The input signal at base is amplified and taken at the emitter. BC547
is used in common emitter configuration for amplifiers. The voltage divider is the
commonly used biasing mode. For switching applications, transistor is biased so
that it remains fully on if there is a signal at its base.
In the absence of the base signal it gets completely switch off.

4.6

Resistors

A resistor is a passive two-terminal electrical component that implements


electrical resistance as a circuit element. Resistors act to reduce current flow,
and, at the same time, act to lower voltage levels within circuits. In electronic
circuits resistors are used to limit current flow, to adjust signal levels, bias active
elements, terminate transmission lines among other uses. High-power resistors
that can dissipate many watts of electrical power as heat may be used as part of

motor controls, in power distribution systems, or as test loads for generators.


Resistors may have fixed resistances that only change a little with temperature,
time or operating voltage. Variable resistors can be used to adjust circuit
elements (such as a volume control or a lamp dimmer), or as sensing devices for
heat, light, humidity, force, or chemical activity.
Resistance value is marked on the resistor body. Most resistors have 4 bands.
The first two bands provide the numbers for the resistance and the third band
provides the number of zeros. The fourth band indicates the tolerance. Tolerance
values of 5%, 2%, and 1% are most commonly available.

The following table shows the colors used to identify resistor values:

COLOR

4.7

DIGIT

MULTIPLIER

Silver

x 0.01

Gold

x 0.1

TOLERANCE

TC

10%
5%

Black

x1

Brown
Red

1
2

x 10
x 100

Orange

x 1 k

15*10-6/K

Yellow

x 10 k

25*10-6/K

Green

x 100 k

0.5%

Blue
Violet

6
7

x 1 M
x 10 M

0.25%
0.1%

Grey

x 100 M

White

x 1 G

Capacitors

Fig.4.7.1

1%
2%

100*10-6/K
50*10-6/K

10*10-6/K
5*10-6/K
1*10-6/K

A capacitor (originally known as a condenser) is a passive two-terminal electrical


component used to store energy electrostatically in an electric field. The forms of
practical capacitors vary widely, but all contain at least two electrical conductors
(plates) separated by a dielectric (i.e. insulator). The conductors can be thin
films, foils or sintered beads of metal or conductive electrolyte, etc. The "no
conducting" dielectric acts to increase the capacitor's charge capacity. A
dielectric can be glass, ceramic, plastic film, air, vacuums, paper, mica, oxide
layer etc. Capacitors are widely used as parts of electrical circuits in many
common electrical devices. Unlike a resistor, an ideal capacitor does not
dissipate energy. Instead, a capacitor stores energy in the form of an
electrostatic field between its plates.
When there is a potential difference across the conductors (e.g., when a
capacitor is attached across a battery), an electric field develops across the
dielectric, causing positive charge +Q to collect on one plate and negative
charge Q to collect on the other plate. If a battery has been attached to a
capacitor for a sufficient amount of time, no current can flow through the
capacitor. However, if a time-varying voltage is applied across the leads of the
capacitor, a displacement current can flow.
Capacitors are widely used in electronic circuits for blocking direct current while
allowing alternating current to pass. In analogue filter networks, they smooth the
output of power supplies. In resonant circuits they tune radios to particular
frequencies. In electric power transmission systems, they stabilize voltage and
power flow.

4.8

Diode IN4007

Fig.4.8.1

A rectifier diode is used as a one-way check valve. Since these diodes only allow
electrical current to flow in one direction, they are used to convert AC power into
DC power. When constructing a rectifier, it is important to choose the correct

diode for the job; otherwise, the circuit may become damaged. Luckily, a 1N4007
diode is electrically compatible with other rectifier diodes, and can be used as a
replacement for any diode in the 1N400x family.

5. Code
#include<reg52.h>
sbit q=P2^6;
sbit r=P2^7;
sbit t=P2^0;
sbit rs=P3^2;
sbit rw=P3^3;
sbit en=P3^4;
sfr

lcddata=0x90;

void delay(unsigned char a)


{
unsigned char i,j;
for(i=0;i<a;i++);
for(j=0;j<125;j++);
}
void command(unsigned char m)
{
lcddata=m;
rs=0;
rw=0;

en=1;
delay(5);
en=0;
}
void lcddisplaydata(unsigned char m)
{
lcddata=m;
rs=1;
rw=0;
en=1;
delay(5);
en=0;
}
void main()
{
unsigned char x;
unsigned char name1[]="MOTOR IS ON ";
unsigned char name2[]="MOTOR IS OFF";
command(0x38);
command(0x0c);
while(1)
{
if(r==1&&q==1)
{
t=1;
command(0x80);
x=0;
while(name1[x]!='\0')

{
lcddisplaydata(name1[x]);
x++;
}
}
else if(r==0&&q==0)
{
t=0;
command(0x80);
x=0;
while(name2[x]!='\0')
{
lcddisplaydata(name2[x]);
x++;
}
}
}
}

6. Advantages
Water Level Controller Circuit Advantages:
Human effort is reduced as the system controls the motor
automatically based on the water level.
This system consumes less power.
Simple and more reliable.

7. Applications
Applications of Water Level Controller Circuit using 8051:
Used in big buildings where the manual monitoring is difficult.
Used in industries to control the liquid level automatically.
Automatic Water level Controller can be used in Hotels, Factories,
Homes Apartments, Commercial Complexes, Drainage, etc., It can
be fixed for single phase motor, Single Phase Submersibles, Three
Phase motors. (For 3 and Single Phase Submersible Starter is
necessary) and open well, Bore well and Sump. We can control two
motor and two sumps and two overhead tanks by single unit.
Automatic water level controller will automatically START the pump
set as soon as the water level falls below the predetermined level
(usually 1/2 tank) and shall SWITCH OFF the pump set as soon as
tank is full.

8. Summary and Conclusion


Automatic water pump control system employs the use of different
technologies in its design, development, and implementation. The system
used microcontroller to automate the process of water pumping in an
over-head tank storage system and has the ability to detect the level of
water in a tank, switch on/off the pump accordingly and display the status
on an LCD screen. This research has successfully provided an
improvement on existing water level controllers by its use of calibrated
circuit to indicate the water level and use of DC instead of AC power
thereby eliminating risk of electrocution.

Potrebbero piacerti anche