Go Down

### Topic: Ultrasonic Sensor to Arduino to Servo.. (Read 2871 times)previous topic - next topic

#### jenfer

##### Mar 08, 2012, 08:12 amLast Edit: Mar 08, 2012, 08:14 am by jenfer Reason: 1
I was wondering if anyone would be able to point me in the right direction/ help me out.
Is it possible to program in arduino, to follow a moving object throught the use of ultrasonic sensor?

#### AWOL

#1
##### Mar 08, 2012, 08:26 am
Most u/s sensors have a wide beam angle, so resolving the object may be difficult.
I guess the answer as usual is "it depends" - on
1) size of object
2) direction of object relative to sensor
3) speed of object.
4) reflectivity of object to ultrasound.
etc

You need to tell us what you want to do.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#### jenfer

#2
##### Mar 08, 2012, 10:18 am
Good day sir!..
I have here an ultrasonic distance sensor(attached in a servo, moving left to right). It only calculates the distance perpendicular to it. I want the sensor to identify a moving object and follow it as it moves(servo).

please give me an idea on how to do it

#### AWOL

#3
##### Mar 08, 2012, 10:35 amLast Edit: Mar 08, 2012, 10:38 am by AWOL Reason: 1
Quote
It only calculates the distance perpendicular to it

Unfortunately, because of beam-spread, that probably isn't strictly true.

You still haven't answered to the question about how fast the object is moving - remember you're going to be limited by the servo sweep rate and the maximum sample rate of the rangefinder - usually only up to about 20Hz.

Quote
(attached in a servo, moving left to right).

At some point, you'll probably need to figure out the "moving right to left" bit.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#### oric_dan

#4
##### Mar 09, 2012, 12:54 am
As AWOL mentioned, not super easy to do with only 1 sonar. The usual method for tracking
is to do some sort of "differential" measurement using 2 pickup sensors.

Typical U/S sonars have beams from about 40deg wide [Parallax Ping, Maxbotix EZ0] down to
about 20deg wide [Maxbotix EZ4]. They will sense objects anywhere in the beam, not just
perpendicular to the direction it's pointing.

If I wanted to do this, I might try using 2 sonars on the panning servo, with the beams aimed
so there is a few degrees of overlap. Have to experiment to get the angle, based on the beam
widths. Then, if the servo is not moving and an object moves into one of the beams, that sonar
will fire and the other will not.

Then you can pan the servo over so both sonars are firing the same. Then as the object keeps
moving, one sonar will stop firing, and you know which direction the object is moving, and
you can pan the servo to follow it. This should work if the object isn't too far away and not
moving too fast, as it will take roughly 200-msec to sample both sonars.

Something like that.

Go Up