Ultrasonic Distance Measurement
Ingredients:
- Arduino Uno
- Proview Development Station 5.2.1-1
- Sensor
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:
- Distance calculation outside the void(loop) from arduino.ino
- A filter in Proview
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:
- Find another timer solution because a buffer overflow will occur...
- After a reboot the sketch need to be up-loaded to the Arduino again
But I am satisfied with the results.