Go Down

Topic: Problem reading PIR sensor (Read 2006 times) previous topic - next topic


Hello people

I have trouble reading og a PIR sensor and i can't see what im doing wrong. Im following the tutorial on http://bildr.org/2011/06/pir_arduino/

The problem is that it keep printing motion detected no matter what i do.  :(

I used the code used in the tutorial:

Code: [Select]
int pirPin = 2; //digital 2

void setup(){
pinMode(pirPin, INPUT);

void loop(){
  int pirVal = digitalRead(pirPin);

  if(pirVal == LOW){ //was motion detected
    Serial.println("Motion Detected");


I've added a picture as the hook up aswell:


Aug 16, 2012, 03:23 pm Last Edit: Aug 16, 2012, 03:33 pm by Krodal Reason: 1
This is the sensor you use : https://www.sparkfun.com/products/8630  ?
I can't see the problem, the wiring and sketch seems okay.

Do you have a multimeter, to check the output of the PIR sensor ?


I don't have that no.. :/

But i do have three of the sensors laying here and they are all acting the same way.

edit: and yes that is the sensors i use.


Well, I have a PIR sensor here, that keeps 'seeing' motion if it is above 25 degrees.
Or it could take 10 minutes after startup.
Did you wait half an hour ?


Aug 16, 2012, 04:06 pm Last Edit: Aug 16, 2012, 05:13 pm by mortni11 Reason: 1
no i hav'nt tried that. Would it make any difference? This is what is says from the site where i got it from:

"This is a simple to use motion sensor. Power it up and wait 1-2 seconds for the sensor to get a snapshot of the still room. If anything moves after that period, the 'alarm' pin will go low.

Red wire is power (5 to 12V). Brown wire is GND. Black wire is open collector Alarm.

This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.

The alarm pin is an open collector meaning you will need a pull up resistor on the alarm pin. The open drain setup allows multiple motion sensors to be connected on a single input pin. If any of the motion sensors go off, the input pin will be pulled low.

The connector is slightly odd but has a 0.1" pitch female connector making it compatible with jumper wires and 0.1" male headers."

edit: waiting did'nt give anything.


I haven't got any clue.

The pull-up resistor could make bad contact.
If you disconnect the sensor (so the pull-up resistor will keep the signal high) does that stop the messages "motion detected" ? If that doesn't stop it check the resistor.

You need a multimeter to measure the voltages of the sensor. The cheap digital ones are only 4 or 5 euros/dollars on Ebay, and that includes shipping.


If want to test the sensor to rule out if sensor is the issue, you can do it with test circuit in step 4 without multimeter.  All the best!



check the wiring on your sensor.  much to my dismay, i received a few that had wiring as follows:

Brown - Ground
Red - Signal
Black - 5v

it was strange connecting 5v to the black wire but it worked.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131