HOME FAN DETECTOR
Group's member
Mohammad Akmal Hakim B Noor Said (01DNS14F2021)
Nurul Syahidah Bt Robia (01DIP15F1013)
Nurul Syazwani Bt Mohd Yazid (01DIP15F1034)
Synopsis
To detect the movement of people in the house.
Hardware
- Dc motor
- Motor driver
- Pic micro controller PIC16F877A
- PIR motion sensor
- Protues 8 Professional
- MPLAB IDE v8.83
Circuit diagram
Coding
#include<htc.h>
void delay (unsigned long); __CONFIG(0x3F3A);
#define Motion_sensor RA0
#define Motor RC2
void main (void)
{
TRISA = 1;
TRISC = 0;
PORTCbits.RC2 = 0;
if (Motion_sensor == 1)
{
PORTCbits.RC2 = 1; delay(2);
}
else PORTCbits.RC2 = 0; delay(2);
}
void delay(unsigned long)
{
unsigned char i;
for (i=0xDE; i!=0; i--)
{
unsigned char j;
for (j=0x50; j!=0; j--)
{
unsigned char k; for (k=0xC; k!=0; k--)
{
}
}
}
}
Video
No comments:
Post a Comment