Occupancy Detection: PIR vs mmWave
2023-10-06 | By Aditya Mishra
License: Attribution Microwave
Hello All!
I created the following blog post and video to explain what occupancy detection is, the different types of sensors that can be used for occupancy detection, and a high-level introduction into PIR and mmWave sensing.
The video goes hand-in-hand with the project.
Background and Introduction:
Occupancy detection: the hidden magic weaving through our modern world. From smart homes that anticipate our needs to efficient workplaces adjusting to our presence, this technology's touch is everywhere. It fuels energy savings, security enhancements, and seamless automation, painting a future where spaces respond to us before we even ask.
It’s used so frequently in our everyday lives you probably don’t even notice it!
Automated Doors better the customer experience and save energy (way cooler than any Jedi Mind trick)
At Costco, long lines for gas are made more efficient with the use of occupancy detection sensors, bettering the customer experience while making the company more money.
What technologies can be used for Occupancy Detection:
There are many different mechanisms that enable Occupancy Detection. The goal of this article is to introduce many examples of Occupancy Detection sensors and to take a deep dive into two of them: Passive Infrared (PIR) Sensors and Millimeter Wave (mmWave) Sensors.
- Passive Infrared (PIR) Sensors: detect changes in infrared radiation caused by body heat. They are commonly used in motion-activated lighting systems and security alarms. Very popular for Maker/DIY applications. A common one is 1597-1182-ND from DigiKey. We will be diving into more detail regarding this type of sensor in the rest of this article.
A diagram showcasing how PIR scans for radiation by body heat from Greenlighting.co
- Ultrasonic Sensors: emit sound waves (ultrasonic) and measure their reflection off objects. These are very easy to use and as a result, are what new engineers/students use for their projects. A very common one is 1528-2711-ND from DigiKey (shown in the image below).
ZACK, a robocar used to introduce students to the exciting world of STEAM, has Ultrasonic Eyes.
- mmWave/Microwave Sensors: emit microwave pulses and analyze the reflected signals to detect changes in movement. They are commonly used in automatic door systems and a group of researchers even came up with a way to use mmWave sensors to maintain social distancing. A very common Microwave sensor is the 1738-1064-ND from DigiKey - we will be diving deeper into mmWave Sensors for the remainder of the article.
Researchers from D3Engineering showcase a tool to maintain social distancing (a form of Occupancy Detection) using mmWave technology. The two people on the right are too close so the model highlights them in red.
- Cameras/Thermal Cameras: advanced image processing algorithms can detect occupancy by analyzing video feed for movement, shapes, and changes in the scene. This is very effective; however, the hardware can be expensive - making it unsuitable for some smart-home applications. A cost-effective one that is easy to use is 2648-SC1223-ND from DigiKey.
An example of parking lot occupancy detection using a camera from viso.ai; the available spots are in green and the unavailable are in red.
- Pressure Sensors: Pressure-sensitive mats or floors can detect occupancy by measuring the pressure exerted by a person's weight. Car seats use this to determine if someone is in the seat and to determine how much tension to use on the seatbelt in case of an accident. An example is 442-1136-ND from DigiKey.
Nearly every car seat has a pressure sensor in it to determine the tension required by the seat belt for the individual on it (too much or too little tension is undesirable in case of an accident - the weight of the person affects the tension).
- Machine Learning and AI: By analyzing data from the aforementioned sensors and other sources, machine learning algorithms can learn patterns of occupancy and make accurate predictions. Nearly all “complex” occupation detection mechanisms have an integration of Machine Learning and AI.
An example of Machine Learning integration with a mmWave sensor enabling edge intelligence. A person is able to be tracked (a form of occupancy detection) despite being barely visible to the human eye. Noise is able to be more effectively filtered using Machine Learning.
What is PIR:
All objects with a temperature above absolute zero emit infrared radiation, Passive Infrared (PIR) Sensors detect this infrared radiation - making it especially useful for occupancy sensing.
A PIR sensor is made of the following:
- Sensor Element: pyroelectric material that can generate a voltage when exposed to rapid temperature changes.
- Fresnel Lens: designed to focus the incoming infrared radiation onto the sensor element. It's often composed of multiple facets to enhance the sensitivity of the sensor.
- Circuitry: amplify sensor output and convert it to a usable signal (PIR sensors are very susceptible to thermal changes in the environment so cleanup is required)
It works based on the concept of detecting changes in the infrared radiation patterns in their field of view - as shown below.
GIF showcasing how the presence of a human affects the Fresnel Lens and Sensor Elements.
What is mmWave?
mmWave sensors operate between 24 GHz and 100 GHz (the millimeter frequency range). The sensors emit electromagnetic waves which bounce off objects and return to the sensor. By analyzing the reflected signals, mmWave sensors can gather information about the presence, distance, speed, and even angle of objects within their field of view.
The time it takes for the emitted waves to travel to the object and back is known as the time of flight. This measurement, along with the speed of light, allows the sensor to calculate the distance to the object accurately - this can be used just to detect an object.
What’s more interesting, is that the Doppler Effect can be used to determine the speed of an object in the sensor’s Field of View. By analyzing the frequency shift, the sensor can determine the speed of the object.
This can lead to really interesting use cases like the one below.
An example of a mmWave Sensor used for Occupancy Detection (and to ensure you don't fall asleep when you're studying for finals)
Advanced mmWave sensors often employ multiple antennas and a technique called beamforming. By controlling the phase and amplitude of the signals emitted from each antenna, the sensor can focus the emitted waves in a specific direction and receive reflected waves more efficiently. This enhances the sensor's ability to detect and locate objects.
mmWave vs PIR:
Both mmWave and PIR sensors can be used for occupancy detection. However - there are some differences between the two that should be considered.
PIR sensors tend to work better with warm bodies (more IR Radiation) whereas mmWave Radars tend to be more object-agnostic.
PIR sensors typically have a shorter detection range (a few meters) whereas mmWave radar sensors can have a longer detection range (>10 meters).
mmWave radar sensors have very high accuracy in detecting/tracking objects’ distance and speed. PIR sensors primarily detect motion.
Both PIR sensors and mmWave radar sensors can be used for occupancy detection, but they offer different levels of information and accuracy.
PIR sensors are suitable for basic occupancy detection. They are cost-effective and simple to deploy. They are commonly used in applications like turning on lights when someone enters a room or adjusting thermostat settings based on occupancy.
mmWave radar sensors offer more advanced capabilities (however, these advanced capabilities often come with the burden of much more complexity to the user). They can not only detect occupancy but also provide additional information, such as the number of occupants, their distance from the sensor, and their movement speed. This extra information can be useful in scenarios like optimizing heating or cooling based on the exact location of occupants in a room or adjusting lighting based on the number of people present. mmWave sensor data is often used in conjunction with Machine learning to produce very impressive results (for example, tracking people at a distance barely visible to the human eye).
The following table serves as a summary:
Summary table from Seeed Studio showcasing the differences between mmWave and PIR sensing.
Which one is right for you?
Ultimately - it depends on your application/how many applications.
In summary, PIR sensors are more basic and cost-effective, while mmWave radar sensors provide more detailed and accurate information about occupancy and movement. The choice between the two depends on the specific requirements of the application and the level of detail needed for occupancy detection.
I highly recommend trying out each of the sensor types and figuring out which one works best for you!
Two different, low-cost mmWave/PIR sensors that can be used to experiment and determine which one is better for your applications.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum