Professional Documents
Culture Documents
SUBMITTED BY :
ADITYA SHARMA
NIPUN SHARMA
NITISH ARORA
Branch:ECE
DITM SONIPAT
HARYANA
SUBMITTED TO:
Our special thanks to Mrs.Swarna Pundir(ECE Dept) who showed us the right way and stood
with us each moment for every possible help.We are also thankful to Mr.Suresh Kumar(Lab
Assistant) who arranged the apparatus(Microcontrllers) for us.
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.
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
MAIN COMPONENTS
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
DC Motor
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----------
{RS=0;
PORTB=cmd;
EN=0;
Delay_Ms(2);
EN=1;
Delay_Ms(50);
//-----------------------Lcd 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---------------
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);
}