PIR Basics

I have used a number of PIR and microwave detectors to detect the presence of people for lighting, fans etc. Both have their place: strengths and weaknesses. I've used a number of PIR and one of the most popular is the SR range specifically the SR50x. The range is based on the Excelitas sensors Big Clive has a nice intro to PIRs, how to add a light sensor, and an external PIR teardown.

I had a basic SR 505 and notice that it appeared to be high (triggered) all the time. I wrote a short sketch to test it and even after the stabilisation period it was triggering.

My problem was that the default triggering (retrigger mode) was on and the sensitivity of the unit was too high. I changed the mode (moved the jumper to non-retrigger) and turned the sensitivity to the minimum. It now works fine I was using it with an ESP8266 Wemos D1 Mini, Wemos D1 and a Node MCU board all worked fine under test. Many folks report false triggering due to RF leakage from the ESP8266 modules.

I#ve also notice people misunderstand the 3.3V requirements for the ESP8266. The boards that are USB powered have a 5V rail and a VIN rail. Use the later to power the PIR. Note the OUTPUT of the PIR IS 3.3V so can be safely connected to one of the GPIOs of the ESP8266


I send the output of the PIR as a 1 or 0 via MQTT for processing on the MQTT server. This allows me to adjust the time of day/daylight settings etc without having to change the code on the ESP8266. The big timer node red addon by Pete Scargill is worth a look

Reading the documentation: HC-SR501 is based on infrared technology, automatic control module, using Germany imported LHI778 probe design, high sensitivity, high reliability, ultra-low-voltage operating mode, widely used in various auto-sensing electrical equipment, especially for battery-powered automatic controlled products.

HC-SR501 PIR MOTION DETECTOR

Specification:

  • Voltage: 5V - 20V
  • Power Consumption: 65mA
  • TTL output: 3.3V, 0V
  • Delay time: Adjustable (0.3-> 5min)
  • Lock time: 0.2 sec
  • Trigger methods: L - disable repeat trigger, H enable repeat trigger
  • Sensing range: less than 120 degrees, within 7m range
  • Temperature: - 15 ~+70
  • Dimension: 32*24 mm, distance between screw 28mm, M2, Lens dimension in diameter: 23mm

Technical Info:
  1. Working voltage range: DC 4.5-20V
  2. Quiescent Current: 50uA
  3. Output levels:  3.3 V(high ),  (Low) 0V
  4. Trigger L trigger cannot be repeated / H repeated trigger
  5. circuit board dimensions: 32 * 24 mm
  6. maximum 110 ° angle sensor
  7. 7 m maximum sensing distance


Product Type
HC--SR501 Body Sensor Module
Operating Voltage Range
5-20VDC
Quiescent Current
<50ua span="">
Level output
High 3.3 V /Low 0V
Trigger
L cannot be repeated trigger/H can be repeated trigger(Default repeated trigger)
Delay time
5-300S( adjustable) Range (approximately .3Sec -5Min)
Block time
2.5S(default)Can be made a range(0.xx to tens of seconds
Board Dimensions
32mm*24mm
Angle Sensor
<110 angle="" cone="" span="">
Operation Temp.
-15-+70 degrees
Lens size sensor
Diameter:23mm(Default)


Application scope
  • Security products 
  • Body induction toys 
  • Body induction lamps 
  • Industrial automation control etc


The pyroelectric infrared switch is a passive infrared switch which consists of BISS0001 microcontroller, pyroelectric infrared sensors, and a few external components. It can activate all kinds of equipment, including an incandescent lamp, fluorescent lamp, intercom, automatic, electric fan, dryer and automatic washing machine, etc. It is widely used in enterprises, hotels, stores, and corridor and other sensitive areas for automatical lamplight, lighting and alarm system.

Instructions

Detector module needs a minute or so to initialize. During initializing time, it will output 0-3 time in the first minute then it switches to standby.


Keep the surface of the lens from light sources and wind, which can introduce interference


The module has two probes with a rectangular aperture. The two probes (A and B) are located at the two ends of the rectangle. When a person enters from the right, or the left, Time for IR to reach to reach the two sub-probes differs.The larger the time difference is, the higher the sensitivity. Motion backward and forwards or up / down product smaller time differences. So it sensor is less sensitive. Try and site the module so it can trigger for motion in the left to right direction. In order to increase the detection range, this module uses round lens which captures IR from all direction. The module is most sensitive to motion from the right or left  Vs from up or down / backward and forwards


Adjust the distance potentiometer clockwise rotation, increased sensing distance (about 7 meters), on the contrary, the sensing distance decreases (about 3 meters).

Adjust the delay potentiometer clockwise rotation sensor the delay lengthened (300S), on the contrary, shorten the induction delay (5S).