Anda di halaman 1dari 15

DONE BY :

SURAJ CR

CHANDY ABRAHAM

SANOOP DHRUVAN

S8 EC 2009

SNGCE KADAYIRUPPU

WATER LEVEL CONTROLLER

ABSTRACT

The level of the water in a field is controlled by this equipment using

microcontroller. Main components are PIC microcontroller, motor, sensor etc.

The sensors sense the intensity of water and give indication to the

microcontroller. The microcontroller produces the control signals to drive the

motor. If there is no water then microcontroller gives control signal to start the

motor and if there is sufficient water in the field then the microcontroller give

control signal to stop the motor.


INTRODUCTION

Water level controller is equipment used to control the water level in a field.

The level of the water is controlled by using a microcontroller. Main

components are PIC micro controller, sensor, motor etc... The sensors sense the

presence of water and give indication to the microcontroller. The

microcontroller produces the control signals to drive the motor. If there is no

water then microcontroller gives control signal to start the motor and if there is

sufficient water in the field then the microcontroller give control signal to stop

the motor. And also the microcontroller enables the display and displayed as

“THE MOTOR IS ON” when the motor starts and disable the display when the

motor is off. Hence the level of water in a field can be automatically controlled.

The main components used in this equipment are PIC microcontroller, sensor

and motor

SENSOR

Here the sensor used is the two conductors placed in the field. If there is water

then the conduction occurs between the two conductors, which closes a circuit

to the microcontroller and microcontroller detects the intensity of water in the


field. If there is no conduction microcontroller detects that water is in the field.

If there is no conduction microcontroller detects absence of water.

MICROCONTROLLER

Pic16c73so microcontroller is employed. The PIC microcontroller detects the

indication from the sensor. The microcontroller produces controls signal to the

drive the motor according to the indication and enables the display. The motor

is controlled by a relay mechanism.

MOTOR

Motor is controlled by the microcontroller the microcontroller switching the power

supply to motor by relay mechanism. The motor employed is DC motor which

has high starting torque and constant speed.

DISPLAY

16*2 LCD display is used. The present state of the motor is displayed on the

display.
BLOCK DIAGRAM

SENSOR

PIC
LCD

MOTO
R
CIRCUIT DIAGRAM
PIN DIAGRAM

PIC16C73-SO

PCB LAYOUT
COMPONENT LAYOUT OF PCB
MAIN COMPONENTS
LCD (LIQUID CRISTAL DISPLAY)

LCD

Short for liquid crystal display, a type of display used in digital watches
and many portable computers. LCD displays utilize two sheets of
polarizing material with a liquid crystal solution between them. An
electric current passed through the liquid causes the crystals to align so
that light cannot pass through them. Each crystal, therefore, is like a
shutter, either allowing light to pass through or blocking the light.

Monochrome LCD images usually appear as blue or dark gray images


on top of a grayish-white background. Color LCD displays use two basic
techniques for producing color: Passive matrix is the less expensive of
the two technologies. The other technology, called thin film transistor
(TFT) or active-matrix, produces color images that are as sharp as
traditional CRT displays, but the technology is expensive. Recent
passive-matrix displays using new CSTN and DSTN technologies
produce sharp colors rivaling active-matrix displays.
.

PIC (Peripheral Interface Controller)

PIC is a family of Harvard architecture microcontrollers made by


Microchip Technology, derived from the PIC1640 originally developed
by General Instrument's Microelectronics Division. The name PIC
initially referred to "Peripheral Interface Controller".

PICs are popular with developers and hobbyists alike due to their low
cost, wide availability, large user base, extensive collection of
application notes, availability of low cost or free development tools, and
serial programming (and re-programming with flash memory) capability
PIC16C73-so

The PIC16C73 is an EPROM-based microcontroller with an integrated


Analog-to-Digital Converter. This easy- to- program (only 35 single
word instructions) device contains 4096x14 words of program memory,
192 bytes of user RAM and 5 MIPS performance @ 20MHz. In addition
to the 5-channel 8-bit A/D converter, this peripheral-rich device includes
Brown-Out-Reset (BOR), Power-On-Reset (POR), three timer/counters,
two Capture/Compare/PWM modules and two serial ports. The
synchronous Serial Port can be configured as either a 3-wire Serial
Peripheral Interface (SPI™) or the 2-wire Inter-Integrated Circuit
(I²C™) bus. This device also features a Universal Synchronous
Asynchronous Receiver Transmitter (USART) which is also known as a
Serial Communications Interface (SCI). The PIC16C73 has 22 I/O pins
with 25mA source/sink per I/O. PIC16C73 fits perfectly in applications
from security and remote sensors to appliance control and automotive.

DC Motor

DC motor, operation is based on simple electromagnetism. A current-


carrying conductor generates a magnetic field; when this is then placed
in an external magnetic field, it will experience a force proportional to
the current in the conductor, and to the strength of the external magnetic
field. opposite (North and South) polarities attract, while like polarities
(North and North, South and South) repel. The internal configuration of
a DC motor is designed to harness the magnetic interaction between a
current-carrying conductor and an external magnetic field to generate
rotational motion.
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature),
stator, commutator, field magnet(s), and brushes. In most common DC
motors the external magnetic field is produced by high-strength
permanent magnets1. The stator is the stationary part of the motor -- this
includes the motor casing, as well as two or more permanent magnet
pole pieces. The rotors (together with the axle and attached commutator)
rotate with respect to the stator. The rotor consists of windings (generally
on a core), the windings being electrically connected to the commutator.
The above diagram shows a common motor layout -- with the rotor
inside the stator (field) magnets.

The geometry of the brushes, commutator contacts, and rotor windings


are such that when power is applied, the polarities of the energized
winding and the stator magnet(s) are misaligned, and the rotor will
rotate until it is almost aligned with the stator's field magnets. As the
rotor reaches alignment, the brushes move to the next commutator
contacts, and energize the next winding. Given our example two-pole
motor, the rotation reverses the direction of current through the rotor
winding, leading to a "flip" of the rotor's magnetic field, driving it to
continue rotating.
DC Motor Operation
SOFTWARE

#define RS PORTD.F0
#define EN PORTD.F1
#define RW PORTD.F2
//PORTC.F0 is used for sensor rod
#define MOTOR PORTC.F2

//-----------------------Lcd comd----------
void lcdcmd(unsigned char cmd)
{
RS=0;
PORTB=cmd;
EN=0;
Delay_Ms(2);
EN=1;
Delay_Ms(50);
}

//-----------------------Lcd data----------
void lcddata(unsigned char data)
{
RS=1;
PORTB=data;
EN=0;
Delay_Ms(2);
EN=1;
Delay_Ms(50);
}
//-----------------------Device init------
void DeviceInit(void)
{
TRISB=0x00;
TRISD=0x00;
TRISC=0x01;
PORTB=0x00;
PORTD=0x00;
PORTC=0x00;
}

//---------------------Lcd init----------
void LcdInit(void)
{
RW=0;
lcdcmd(0x38);
lcdcmd(0x38);
lcdcmd(0x38);
lcdcmd(0x0C);
lcdcmd(0x06);
lcdcmd(0x01);
}

//---------------------msg---------------
void mess(unsigned char name[])
{
unsigned char i=0;
while(name[i]!='\0')
{
lcddata(name[i]);
i++;
}
}
//------------------Main fun-------------

void main(void)
{
DeviceInit();
LcdInit();
while(1)
{
while(!PORTC.F0)
{
MOTOR=1;
LcdInit();
mess(" motor on");
Delay_Ms(50);
}
MOTOR=0;
LcdInit();
mess(" motor off");
Delay_Ms(50);
}
}