Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC 16F877A interfacing with PIR sensor and DC motor

Status
Not open for further replies.

kmdineshece

Member level 1
Member level 1
Joined
Dec 17, 2013
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
384
Hi all!...............

pls, anyone help me!.....


I'm doing automatic welcome screen project,
when a person arrive, the screen should be open automatically,

harware connection was made, but my software has many malfunctions!........

pls help me for pin declaration,

assigning input and output pins!........

when PIR goes high it maintains the same state for few seconds, how can rectify this problem

I need HiTech C compiler based program
 

Can you share the circuit diagram and the code,which you have written till now..?
 


Code C - [expand]
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include <pic.h>
#include <math.h>
__CONFIG(0X1F71);
#include "lcd.h"
 
#define sensor_1 RB0
#define sensor_2 RB1
#define motor_1 RB2
#define motor_2 RB3
#define led RB4
 
void delay(unsigned int time) // Delay 
{
    unsigned int i, j;
    for(i=0;i<time;i++)
       for(j=0;j<time;j++); 
}
 
void main(void)
{   unsigned int result,temp,unit,a,b,c,d,x,y,z;
    x = 0;
    y = 0;
//  TRISA = 1;          // AN0 ADC channel as input 
    TRISB0 = 1;         // port B as output
    TRISB1=1;
    TRISB2=0;
    TRISB3=0;
//PORTB=0xF0;
TRISB4=0;
    TRISC = 0;          // port C is  used for switches and relay
    TRISD = 0;          // port D as output
    lcdint();           // intialised LCD
    cmm(0x01);          // clear display
    cmm(0x80);          // 1'st line of LCD
    data_str(" SCIENTRIK ENGG ");
    delay(100);
    cmm(0xC0);          // 2'nd line of LCD
    data_str("    SOLUTIONS   ");
    delay(100);
    cmm(0x01);          // clear display
    cmm(0x80);          // 1'st line of LCD
    
    data_str(" WELCOME SCREEN ");
    delay(100);
    
    motor_1=0;
    motor_2=0;
delay(300);
led=0;
    
while(1)
{  
 
if((RB1==1) || (RB0==1))
{
 cmm(0x01);         // clear display
    cmm(0x80);          // 1'st line of LCD
    data_str("   SENSOR 1&2  ");
    motor_1=1;
    delay(170);
    motor_1=0;
    led=1;
    while((RB1==1) || (RB0==1))
    data_str("   SENSOR 1&2 ");
    cmm(0x01);          // clear display
    cmm(0x80);          // 1'st line of LCD
    data_str("   SENSOR_out  ");
 
    led=0;
    motor_2=1;
    delay(170);
    motor_2=0;
}
if((RB1==0) && (RB0==0))
{
    motor_1=0;
    motor_2=0;
 
    cmm(0x01);          // clear display
    cmm(0x80);          // 1'st line of LCD
    data_str("   NO MOTION  ");
    led=0;
   
}
 
}
}

 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top