I am planning to arrange stationary sensors in a circle to detect movement in 360 degrees out from center. I will either use PIR or ultrasonic sensors. The specific choice depends on experiments- I am not entertaining using one sensor that spins. That is not desireable in my application.
Regardless, I am looking for an algorithmic process to detect this movement and move a servo to point to this corresponding movement. Anyone have an effective flowchart/ process to get me started?
PIR will tell you if something warm is moving past but won't tell you what or where that thing is.
Ultrasonic range finders will tell you how far away something is in a roughly 15° arc. It won't tell you direction more precise than that and it won't identify the object.
For identifying and accurately locating something you probably have to go with computer vision and a much more capable processor.
I am aware of the capacities and limitations of various kinds of sensors and generally I am pretty good at programming, interfacing and have experience constructing electronic and physical objects. No problem. What I need help with is the methodology. I have looked on the internet for solutions but have only found really high math from research papers which looks pretty foreign to me.
I cannot have any moving parts in this project so I have several(not sure how many yet) stationary ultrasonic sensors arranged in a circle pointing outward. PIR sensors were considered but unfortunately I think they are too slow to recover from their reading (I am still looking into this.)
I need to detect people moving around the sensor and to identify what direction they are moving in real time. I need to ROUGHLY track the movement around the sensor array. I am not concerned with how far people are. The specific distance from the sensor is not being used in my application. I will be using a servo that points to them as they walk around it. I will use only the most movement and ignore the rest.
If I have several sensors arranged as described above what is a good approach to track this motion? I am really looking for a flowchart or method so I can convert that to code. I expect I have to have some kind of filtering and thresholds that I can adjust for optimal functioning. Boy I hope I was specific enough.
The control system involved a lens.... projecting an image of the target to a screen inside, while one to three pigeons trained (by operant conditioning) to recognize the target pecked at it. As long as the pecks remained in the center of the screen, the missile would fly straight, but pecks off-center would cause the screen to tilt, which would then, via a connection to the missile's flight controls, cause the missile to change course and slowly change the flight path towards its designated target.
OK... If you just need to detect angular position, PIRs are probably your best bet. You can use masking or baffles to narrow the "vision" of the PIRs. As far as I know, PIRs are not inherently slow... The motion sensors on my home alarm system seem pretty fast. There may be a delay on some motion-sensing lights to prevent false triggers.
Multiple ultrasonic sensors will probably interfere with each other as the sound waves bounce around the room and sound doesn't bounce off people very well. You could "fire" one sensor at a time but I have a feeling that the complexity of reflections in a room will be a problem.
Tracking "people" is also a lot more complicated than tracking "a person", especially with a low-resolution system.
Or like John says, an overhead camera with some sophisticated image analysis software (running on something more powerful than an Arduino).
Thermal sensors like the Melexis 90614 (or models with a narrower cone of vision) can detect the IR emission from people, and arrays of them (mlx90620 or cheaper: Omron D6T-44L-06, Panasonic AMG8832) have been used to track and count people passing through doors, etc.
If you use sensors with digital output (0/1) the best static resolution you can achieve is 1/2 of the distance between sensors. With analog output that can be narrowed down a bit. That might be ok if you want to take photographs, if you want to shoot the target you will have to use a blunderbuss.
One alternative to the sensors would be using (infra-) sound to detect step noise.
How do you intent to handle the possibility of multiple targets?
It's silly, but I got permission to talk about the project with you-
Project overview:
This is a sculptural, Steampunk/Hobbit-style role-playing game prop. It is a mechanical eyeball that is constructed to go on the cover of an ancient-looking book on a table. The eye faces up and the sensors will be mounted in a circle around the eye pointing outward from the center in a raised portion what makes up the front cover. When you walk by the eyelid opens and the eyeball tracks your general motion around the room.
Output:
I have broken down the eye movements down to 9 positions; N,NE,E,SE,S,SE,W,NW and straight ahead with the eylid closed when nothing is detected. Pre-programmed servo movements to position the eye and the (randomly blinking) eyelid.
From what you all said I have agreed to use PIR sensors.I am going to acquire and experiment with the Parallax mini PIR sensors. (https://www.parallax.com/product/28033)
They have a digital output which I hear is quite sensitive. Enough for what I need. I could use 4 of them to cover 100 degrees each compass direction with a little overlap between. Abot 12 foot range. Good enough for me. I hope the recovery time will be fast enough to work with though the system could afford to be a bit sluggish.
I am planning to sort out multiple people and everything else by software. Sensing, storing, sensing, storing, comparing and analyzing the data to send off to my servo. A kind of fuzzy logic or wieght system used in AI perhaps. It could be as simple as choosing the largest general movement when it comes to multiple people. Still looking for good ideas on how to handle that. That is my challenge.
You guys are very helpful. Thanks and keep it coming!
Do you really need 2D scanning.
I mean, detect in an arc only for people walking past, and let the eye randomly move up/down like it's scanning a stationary person head to toe.
There are PIR movement, and PIR direction sensors.
Leo..