Now if you connect this jumper between inner corner PIN and middle PIN, then LED will stay on all the time till there is any motion. In this position LED will blink continuously until there is motion. This is called “non-retriggering” Or “ Non-repeatable trigger” and jumper said to be in L position. Now when we find the LED blinking whenever there is any motion, look back of the PIR, you will find a jumper which is placed between outer corner PIN and middle PIN (see diagram above). PIRs takes some time to stable itself according to surrounding conditions, so you can find, LED turn ON and OFF randomly for about 10-60 seconds. Resistor 220ohm (any resistor below 1k ohm).When there is any motion in the range of PIRs, LED will start blinking. Vcc PIN of PIRs connected to the positive terminal of the 9v battery, GND pin is connected to negative terminal of battery and Output pin of PIR is connected to LED with a resistor of 220 Ohm. We are using a HC-SR501 PIR Sensor, an LED (which will glow whenever there is a motion infront of the sensor) and resistor.
We have built a very simple Motion detector circuit here. These lenses are curved in such a manner so that sensor can cover a wide range. Pyroelectric sensor is covered by a plastic cap, which has array of many Fresnel Lens inside. As soon as somebody enters in first half, the infrared level of one half becomes greater than other, and this causes PIRs to react and makes the output pin high. Pyroelectric sensor divide in two halves, when there is no motion, both halves remain in same state, means both senses the same level of infrared. BISS0001 IC take the input from sensor and does processing to make the output pin HIGH or LOW accordingly. Along with this, BISS0001 ("Micro Power PIR Motion Detector IC"), some resistors, capacitors and other components used to build PIR sensor. The main component of PIR sensor is Pyroelectric sensor shown in figure (rectangular crystal behind the plastic cap). Whenever an object passes through the sensor range, it produces infrared because of the friction between air and object, and get caught by PIR.
PIR sensors can detect small amount of variation in infrared. Human also emits infrared because of body heat. Here we should note that every object emits some amount of infrared when heated. They are also referred as Pyroelectric or IR motion sensors. Basically PIR sensor detects any change in heat, and whenever it detects any change, its output PIN becomes HIGH. It is called passive because it receives infrared, not emits. Note: The program can be calibrated for smaller detection (hardware) delay by using smaller Program delay(D1).Passive Infrared Sensor (PIR) is very useful module, used to build many kinds of Security Alarm Systems and Motion Detectors. Time.sleep(0.1) #While loop delay should be less than detection(hardware) delay Time.sleep(2) #D1- Delay to avoid multiple detection If GPIO.input(pir): #Check whether pir is HIGH Time.sleep(2) #Waiting 2 seconds for the sensor to initiate tmode(GPIO.BOARD) #Set GPIO pin numbering Import RPi.GPIO as GPIO #Import GPIO library If you haven’t installed Python GPIO library or unfamiliar with Raspberry Python and GPIO pins, please go through our first tutorial Led Blinking using Raspberry Pi. Vcc, Output, Ground are connected to 2 ( 5V), 26 ( GPIO) and 6 ( GND) pins of Pi respectively.