Professional Documents
Culture Documents
Water Level Controller: Done by
Water Level Controller: Done by
SURAJ CR
CHANDY ABRAHAM
SANOOP DHRUVAN
S8 EC 2009
SNGCE KADAYIRUPPU
ABSTRACT
The sensors sense the intensity of water and give indication to 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
Water level controller is equipment used to control the water level in a field.
components are PIC micro controller, sensor, motor etc... The sensors sense the
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
MICROCONTROLLER
indication from the sensor. The microcontroller produces controls signal to the
drive the motor according to the indication and enables the display. The motor
MOTOR
DISPLAY
16*2 LCD display is used. The present state of the motor is displayed on the
display.
BLOCK DIAGRAM
SENSOR
PIC
LCD
MOTOR
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.
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
#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);
}
}