Ardunio project advice for a newbie

Hey,

I posted earlier about a project i was working on, however it has now completely changed and i could do with some advice please!

I need to detect proximity from an object and the distance from the object determines the position of servo.

What sort of sensor is needed? And can anyone point me to some relevant Processing code snippets?

Greatly Appreciated!!

What is the range of distances you want to detect? 0 to 20cm? 3 to 8ft? What level of accuracy? +/- 0.5mm or +/- 3 ft?

What kind of object(s)? Stationary or moving?

What kind of servo? What are you rotating with the servo?

Processing code snippets?

To run on the Arduino?

No answers, today. Just questions...

range : 3 to 8ft
accuracy more like 0.5 - 2 ft something like that
moving objects , specifically a person moving towards it
it's a hs-422 servo, the servo is used at a joint to rotate an arm, it's basically the elbow joint.

Hope that paints a clearer picture,

Thanks for the reply!

For that kind of application I think that ultrasonic ranging sensors are the most popular. Here is one example:

Lefty

Keep in mind, though, that these sensors work best with hard, flat, stationary objects like walls. Soft, rounded, moving objects, like people will be harder to get an accurate reading on.

If all you are interested in doing is waving as a person gets near the sensor, the ultrasonic sensor will work. If you're aiming for greater precision, the accuracy of the output may disappoint you.

Thanks for the replies guys, it really is to just sense as a person moves closer to it, the closer they get the higher the senso will raise the arm.