Electronic – What sensor (or sensor strategy) would detect the presence of a human within a defined radius of a fixed point in a room

proximity-sensorsensor

I would like to reliably detect the presence of a human within a defined radius of a fixed place in a room. Think of a diamond in an art museum — if there's a person within 5 feet of it, I could use the sensor to output a signal as a continuous 1 otherwise 0. Further, would it also work for a half-circle (such as a portrait on the wall in the museum)?

I am currently doing this with OpenCV and a webcam, but there's too much delay > 200 ms in processing. I'm hoping for a better approach that can provide latency < 20 ms.

enter image description here

Best Answer

This should be a relatively simple problem, as much as the comments and answers are saying otherwise. Just to give my background before I go into the answer and also ask more questions, I work with sensors every day to detect positions of objects (humans, or fixed objects).

Going off of your diagrams:

  1. I am going to assume the "detector" (all hardware for detecting your person) is right under or above the art picture. So it is at a fixed height above the ground
  2. You are only detecting people above a certain height. So you can not determine if there is a mouse within 5 feet, but can detect a small child.
  3. You are only interested in detecting a semi-circle from the picture, so you are looking out from a wall. This is not an unbreakable assumption, just changes the hardware a bit.

The first solution I would propose is a 2D LiDAR. This is literally what its designed for. There are many, many, many 2D lidars. Ranging from $100 to over $10,000. I personally have this lidar. So if you are just looking at doing this for a school project (not a product), I would go with that lidar, and a raspberry pi. Maybe 4-8 hours of some python code running and you are up and running. This should be almost near real time, with the biggest limitation coming from the OS on the pi, and python vs something like C/C++ (so basically no delays unless you programmed it terribly).

A bit about lidar:

  1. They fire multiple lasers (or a single laser spinning) and measure the time it takes to get back. So they are super fast, and super accurate on range.
  2. They will either provide you exact x/y locations of targets, or distance and an angle which you then turn into x/y locations (search polar coordinates).
  3. They have a fixed interval or gap between angles. So it will fire a laser at 0 degrees, and then maybe 1 degree later, and 2, etc. So it is possible to have something in between the firing angles, however that really only comes to play for long long distances. A big object (a person) at a small distance (5 feet) will almost definitely be detected

So all you would need to do is say "if lidar returns distance <5ft, there is a person there". The lidar I have and recommended talks over USB but looks like serial data, and there are some open source drivers to connect/read the data from it.

Edit: Also with a 2D lidar you have the ability to detect if there are multiple people/objects. This is exactly how self driving cars and robots (my area of work) detect obstacles. Just with fancier versions of lidars and computers.