PIR Sensor vs. Ultrasonic Rangefinder

I'm working on a project where I need to detect if a person walks past 2 motion sensors aligned against a wall. The motion sensors will be mounted against a wall in a hallway (the hallway is 8 feet wide). I would like to sense objects within this 8 foot range, but only when a person is directly in front of a sensor.

I was wondering whether a PIR or Ultrasonic Rangefinder would be better to use in this scenario, especially based on the narrow detection beam that I plan to setup.

Why not keep it simple? Two light-beam break detectors?


The Ultrasonic sensor has a limited range, 8 feet may be the outer range but it might work. They have a fairly narrow detection area. If your trying to catch someone walking perpendicular to the sensor, you will need to have a ping speed fast enough to catch someone walking past.

The PIR has a wide field of view of about 170 degrees. You would need to shield part of the sensor to prevent it from picking up movement at the outer edges of it’s field of view. PIRs detect movement best if it’s perpendicular to the sensor and not so good as you move directly at it. It will have plenty of range to pick up at 8 feet, and beyond.

Or better yet, use both. the PIR can sense someone nearing the zone and increase the ping speed. The ultrasonic sensor can trigger when the object when it is directly in front of it. You could use this combination to cut down on false triggers if both sensors need to detect the target.