motion tracking using PIR sensors and a ping sesnor

Hi guys, I am very new to the world of micro controllers and I'm currently busy with a project and i need some advice from someone a bit more experienced than me :)

Basically the project involves real time motion tracking and will be similar to a modern day security camera which will track a human than moves in the specified region surrounding the camera. However i am only interested in the tracking part for the time being.

In my project i use to PIR sensors configured to detect motion within a range of 5m.The two PIR sensors are place on two separate sides of the enclosure.Initially when there is no motion detected on both PIR sensors a servo motor is sweeping from 0-180 degrees and back again. However when motion is detected the servo motor will then either sweep from 0-90 degrees if its the Left hand PIR which is trigger or 90-180 degrees if the right hand PIR is triggered. While the servo is going through this 90 degree sweep is is in my hopes to pick up the human using the HC-SR04 ultrasonic sensor and continue to accurately track the human.

My question is : Will it possible to accurately track a human using only one ultrasonic sensor ? In fact is it possible to track at all using only one Ultrasonic sensor ? and if so how would i go about doing it ?

Or should I just use 2 ultrasonic sensors,measure the distance of each and subtract them from each other in order to drive the servo is a particular direction to track the human?

Sounds strangely similar to this post:

Does sound similar ,however is not very helpful.

If the ultrasonic sensor is mounted on a pan & tilt servo driven mount and you scan up and down WHILE scanning LEFT to RIGHT, WHEN you detect an object, save the distance and save the tilt position and hold the tilt while scanning back and forth left to right looking for another hit. If you get another hit to the left or right of the first hit save that pan position make that center and scan left and right of that. Each time you get a new hit in a different pan position make that your center and repeat the routine. If the center position keeps changing, it is probably a moving object.

Hi raschemmel,

Thanks for the info ,it was a great help to the project and very solid advice !

Just completed a version of the project recently where I just track along the X-axis using 2 PIR’s and 2 Ultrasonic modules and it is working very well.

Basically just picks up the motion on a particular side then scans that particular side 0-90 or 90-180 degrees depending on the side motion was detected.Then once the object is found, using the ultrasonic modules while scanning( 0-90 or 90-180). I then just implement a control loop by comparing the two distances received from each ultrasonic module and drive the servo according to the difference between the two distances.

I’m currently busy with a 2 dimensional (X,Y-axis) tracking system at the moment which you described to me,its proving to be quite a challenge but is very enjoyable :slight_smile:

Thank for taking the time to reply.