If you’re searching for a proximity sensor and are on a tight budget, consider the HC-SR501 Pyroelectric or Passive Infrared sensor. This article will discuss the pros and cons of using this device including practical applications and guidelines for using it.
The HC-SR501 PIR sensor (also called an IR motion sensor) is a cheap yet versatile motion sensor that can detect passers-by or room occupancy status simply by detecting the presence of a moving object as an infrared heat source. Through advancements in manufacturing and miniaturization, the PIR sensor can be mass-produced efficiently with little cost. Knowing which sensor to buy is a dilemma that every designer has to make as they outweigh the performance vs. cost ratio of their projects. Conclusively, this article will help the user decide if this sensor is the right choice for his application and design budget.
Part 1. How does a PIR sensor work?
A PIR sensor can detect the movement of objects that emit heat in the infrared wavelength spectrum. It does this through two rectangular “windows” that are sensitive to infrared sources. These windows are lined up with each other to detect movement. Consider how it does this through the diagram below:
This waveform output of the sensor is fed to a digital signal processing chip BIS0001. The BIS0001 is a Passive Infrared controller. You can check out its datasheet here. The chip does several calculations before detecting this kind of waveform. After that, it outputs a signal that is passed to discrete components that systematically create a momentary high signal.
Note that the behavior of the waveform is indicative of movement. That being said, the designer should have a rough estimate of what to expect.
Consequently, it can be concluded that the HC-SR501 PIR sensor will not be able to detect stationary objects due to the nature of its detection mechanism. It should also be noted that once an object is detected, the only way to re-trigger the sensor is for the object to move again, or for another object to come by. Note that it takes about 3 seconds to do a re-trigger, but there are user settings on the device that can affect this.
The options for the user to adjust certain parameters on this module are listed below.
- Sensitivity adjusts – How far to detect objects. The range is from 3 to 7 meters.
- Time high adjust – How long the signal will stay high after detecting motion. The range is from 5 seconds to 5 minutes.
- A jumper for repeatable trigger – The user has the option of floating the output high for every trigger or releasing it to re-trigger on every detected object.
These options come as potentiometers or jumpers which are seen in the diagram in the next part. We’ll also explain some of the options in detail.
Part 2. What is the internal construction of this PIR sensor?
Overall, the sensor looks like what’s in the image below:
Without the cover, the PIR sensor is exposed (as seen below). Note the sensor is hermetically sealed inside a metal can.
The sensor’s cover is a white plastic dome-shaped material. It can serve as protection for the PIR sensor but that’s not its main function. If you’ll notice there are beehive shapes all over it. These shapes are actually Fresnel zones. Incidentally, the dome-shaped cover is a Fresnel lens that focuses beams of images projected outside into more condensed forms. This gives the sensor the ability to cover a wider area.
The sensor’s connections, adjustment pots, and jumpers are seen below. They are labeled for your convenience.
The power supply connections and the output signal can be seen on the 3-pin header at the top of the device. The power supply can handle 4.5V to 20V indicating that it has its own voltage regulator.
Two potentiometers, namely sensitivity adjust, and time high adjust are seen at the bottom part. The sensitivity adjustment can lengthen or shorten the distance of IR detection. The time adjust simply lengthens the output high time when a motion is detected.
On the left side, there is a jumper option for triggering the output. If the jumper is on the high side, the re-trigger option is selected, while the no-retrigger mode is on the low side.
|High||Re-Trigger mode||Every time a motion is detected a high output with the time high adjust is made. You can interrupt this mode by re-triggering with motion again, and the time high adjust will reset its count while maintaining the high output.|
|Low||No Re-Trigger mode||Every time a motion is detected, high output with the time high adjust is made. The high output time cannot be interrupted. After approximately 3 secs, you can trigger it again.|
Part 3. What are its different applications, advantages, and disadvantages?
Since this is a motion sensor, only objects that move will be detected. Additionally, the object must emit IR radiation (like human beings, animals, or living things). Plastic objects are out of the question and will not trigger the device except if it has parts or materials that emit IR radiation.
Calibration occurs in the first minute of applying power to the sensor. At this moment the sensor cannot be used as it outputs test values. This poses a disadvantage if you require immediate motion detection upon powering up your system.
The biggest advantage you gain from this device is its cost. It is so inexpensive that some companies in China will be happy to manufacture or re-sell them for you. Additionally, the device performs well and functions as it should.
You can use this device in different applications. Examples of these:
- Knowing when a room is occupied or not. Couple this with a CCTV camera and you’ll be notified if there are people in a room even in the blind spots.
- Turning the lights on when a person is detected. This is great for finding things in the dark automatically. Couple this with a relay and you’re ready to go.
- Turning on the escalator in establishments without the need for touching anything.
- Turning on devices such as electric fans or coolers when a person enters a room.
Part 4. Final verdict.
The HC-SR501 is functional and consistent with its intended application, which is to detect human motion. Additionally, the low cost of the device appeals to many designers on a budget with their design goals.