Ultrasonic Distance Measurement

 

Ingredients:

ultrasonic-distance-sensor.png

Problems:

"Detection - Pulse back signal" and distance calculation can take up to almost 20 ms.

This means this part must stay out of the void(loop) in the proview-arduino sketch
which normally has a delay of 1 ms.

Can't use Ai signal pin in the standard arduino.ino sketch

Need to "hard-code" the analog input pin (Ai0) as val=distance in the sketch

The resolution is 1 cm which can become a stability problem in a controlling process in a short distance range.

Solved:

Here are the results in a range of 2-30 cm:

By moving my hand in front of the sensor I created the "wave"

 

Todo:

But I am satisfied with the results.

Edukits