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.

Connecting PIR Sensor With PIC16f877a

Status
Not open for further replies.

Sara89

Banned
Joined
Dec 22, 2013
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
0
hi could anyone please help with connecting the attached pir sensor to pic 16f877a .. it has a digital output .... thank you
**broken link removed**
i've tried to connect the output directly to the pic but it didnt work ..
 

hi could anyone please explain how do we connect a PIC to a digital output sensor ... thank you
 

hi could anyone please explain how do we connect a PIC to a digital output sensor ... thank you

If the sensor uses the same voltage as the PIC, then just connect directly to a DIO or if it outputs analog, then connect to the analog channel. Read the datasheet for the sensor, they will tell you what it needs, sometimes it requires some resistor connected to it.

Then you just set the PIC for that channel as input or anlog and read it.

And by "digital" do you mean it outputs high or low? OR do you mean it outputs signal through serial or spi communication?
 

I have one of these before, I believe the output is an open collector, meaning you will need a pullup resistor. You cant just connect directly to it.
Tie the ouput to a resistor, and connect the resistor to VCC. The output also goes to PIC dio pins.
 

You will need to know the communication protocol for the sensor, which is in the datasheet. Then be sure your PIC supports that protocol in hardware or be prepared to have a software solution. There are lots of software solutions on the Internet. For MPASM, PicList.com is a valuable resource.

I can be more specific, if you say what your sensor is and its protocol.

John
 

You should first know the communication protocol of the sensor you want to interface with the PIC and then see whether the microcontroller you are using supports that protocol or not.....then you can make any project
 

sir am using the HC-SR501 sensor but it is not working .... the PIC is not detecting the motion although the code is right
thank you
 

These PIR don't really have a "communication protocol" unless they changed it. Its just an open collector output, when it detects movement it turns on the transistor, that's it, nothing you need to do. Just connect a pull up resistor to the output of the sensor and connect the output to a DIO pin on the PIC if you are trying to read it.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top