Testing A PIR | PIR Motion Sensor - Adafruit Learning System

Skip to main content PIR Motion Sensor Testing a PIR
  • Overview
  • How PIRs Work
  • Connecting to a PIR
  • Testing a PIR
  • Using a PIR w/Arduino
  • CircuitPython Code
  • Example Projects
  • Buy a PIR Motion Sensor
  • Single page
  • Feedback? Corrections?
  • Text View
Primary Products
  • PIR (motion) sensor with a cable around it. PIR (motion) sensor $9.95 Add to Cart
200 Intermediate Product guide 💕 2

Testing a PIR

proximity_pirtestsch.gif proximity_pirtestbb.gif

Now when the PIR detects motion, the output pin will go "high" to 3.3V and light up the LED!

Once you have the breadboard wired up, insert batteries and wait 30-60 seconds for the PIR to 'stabilize'. During that time the LED may blink a little. Wait until the LED is off and then move around in front of it, waving a hand, etc, to see the LED light up!

Retriggering There's a couple options you may have with your PIR. First up we'll explore the 'Retriggering' option. Once you have the LED blinking, look on the back of the PIR sensor and make sure that the jumper is placed in the L position as shown below. proximity_pirback.jpg proximity_triggerlow.jpg Now set up the testing board again. You may notice that when connecting up the PIR sensor as above, the LED does not stay on when moving in front of it but actually turns on and off every second or so. That is called "non-retriggering". proximity_non-retriggerable.gif Now change the jumper so that it is in the H position. If you set up the test, you will notice that now the LED does stay on the entire time that something is moving. That is called "retriggering". proximity_retriggerable.gif

(The graphs above are from the BISS0001 datasheet, they kinda suck)

For most applications, "retriggering" (jumper in H position as shown below) mode is a little nicer.

proximity_triggerhigh.jpg If you need to connect the sensor to something edge-triggered, you'll want to set it to "non-retriggering" (jumper in L position). Changing sensitivity The Adafruit PIR has a trimpot on the back for adjusting sensitivity. You can adjust this if your PIR is too sensitive or not sensitive enough - clockwise makes it more sensitive. proximity_189bottom_LRG.jpg Changing Pulse Time and Timeout LengthThere are two 'timeouts' associated with the PIR sensor. One is the "Tx" timeout: how long the LED is lit after it detects movement - this is easy to adjust on Adafruit PIR's because there's a potentiometer. The second is the "Ti" timeout which is how long the LED is guaranteed to be off when there is no movement. This one is not easily changed but if you're handy with a soldering iron it is within reason.

First, lets take a look at the BISS datasheet again

proximity_titx.gif On Adafruit PIR sensors, there's a little trim potentiometer labeled TIME. This is a 1 Megaohm adjustable resistor which is added to a 10K series resistor. And C6 is 0.01uF so
Tx = 24576 x (10K + Rtime) x 0.01uF
If the Rtime potentiometer is turned all the way down counter-clockwise (to 0 ohms) then
Tx = 24576 x (10K) x 0.01uF = 2.5 seconds (approx)
If the Rtime potentiometer is turned all the way up clockwise to 1 Megaohm then
Tx = 24576 x (1010K) x 0.01uF = 250 seconds (approx)
If RTime is in the middle, that'd be about 120 seconds (two minutes) so you can tweak it as necessary. For example if you want motion from someone to turn on a fan for a minimum of 1 minute, set the Rtime potentiometer to about 1/4 the way around. For older/other PIR sensors If you have a PIR sensor from somewhere else that does not have a potentiometer adjust, you can trace out the adjustment resistors this way: proximity_pirtitx.gif

Determining R10 and R9 isnt too tough. Unfortunately this PIR sensor is mislabeled (it looks like they swapped R9 R17). You can trace the pins by looking at the BISS001 datasheet and figuring out what pins they are - R10 connects to pin 3 and R9 connects to pin 7. the capacitors are a little tougher to determine, but you can 'reverse engineer' them from timing the sensor and solving!

For example:

Tx is = 24576 * R10 * C6 = ~1.2 seconds R10 = 4.7K and C6 = 10nF

Likewise,

Ti = 24 * R9 * C7 = ~1.2 seconds R9 = 470K and C7 = 0.1uF

You can change the timing by swapping different resistors or capacitors. For a nice tutorial on this, see Keith's PIR hacking page.

Page last edited June 27, 2012

Text editor powered by tinymce.

Connecting to a PIR Using a PIR w/Arduino Related Guides Adafruit VL53L4CD Time of Flight Distance Sensor By Liz Clark beginner Your browser does not support the video tag. This links to the guide Haunted Air Blaster. Haunted Air Blaster By John Park intermediate Ultrasonic Ruler By Ruiz Brothers beginner LPC824 NeoPixel IR Distance Sensor By Kevin Townsend beginner Adafruit VCNL4200 Long Distance IR Proximity and... By Liz Clark beginner Your browser does not support the video tag. This links to the guide FunHouse Motion Detecting Lights with LIFX Bulbs. FunHouse Motion Detecting Lights with LIFX Bulbs By John Park beginner Wireless Security Camera with the Arduino Yun By M. Schwartz advanced Your browser does not support the video tag. This links to the guide Track a Turtle with WipperSnapper. Track a Turtle with WipperSnapper By Isaac Wellish beginner Adafruit VCNL4020 Proximity and Light Sensor By Liz Clark beginner Adafruit VL6180X Time of Flight Micro-LIDAR Distance... By lady ada intermediate Quadcopter Spray Can Mod By Becky Stern beginner No-Code WipperSnapper Summoning Horn By Tyeth Gundry beginner Your browser does not support the video tag. This links to the guide MIDI Laser Harp with Time of Flight Distance Sensors. MIDI Laser Harp with Time of Flight Distance Sensors By Liz Clark intermediate Your browser does not support the video tag. This links to the guide Magic Mirror with Glowing Secret Messages. Magic Mirror with Glowing Secret Messages By Erin St Blaine intermediate New Your browser does not support the video tag. This links to the guide Tree with Animated Eyes and Motion Sensor. Tree with Animated Eyes and Motion Sensor By Erin St Blaine intermediate
Create Wishlist
× Title Description Close Search Search
Categories

Tag » Arduino Pir Motion Sensor Not Working