Stabilizing Ultrasonic Sensor Readouts
Under certain conditions, ultrasonic sensors can produce erratic readings. This happens more often in applications with either rapidly changing levels, or irregular shaped targets. To get an accurate measurement, stable readouts are absolutely essential.
To counteract such readings and smooth an output, the sample rate and average parameters can be manually adjusted on IRU ultrasonic sensors to steady the signal.
Their basic definitions are as follows:
Sample Rate: Sets how many times per second the sensor takes a reading. The sample rate is expressed in Hertz (Hz). The IRU ultrasonic sensors allow rates from 1 to 50 Hz.
Average: Defines the number of target samples (readings) that will be averaged together to become the distance reading. Each sample is placed into a first-in, first-out (FIFO) buffer and averaged with previous samples to generate a steady output.
In rapid moving applications, a high sample rate will produce a more rapid response, but it will decrease the stability of the measurement. Lowering the sample rate will help increase sensor life and decrease the chance of detecting errant echoes.
It is recommended that the sample rate be only as high as necessary for the application.
To gain the greatest smoothing effect with the sensor’s readings, the averaging should be increased as necessary. The only drawback is this will result in a slower response to rapid changes in the target distance.
The best course of action is to use the lowest sample rate possible for the application (1-2 Hz is usually appropriate for slow moving targets) and set the average for the fastest response time with the greatest smoothing effect for the sensor.
Adjusting these two parameters together will allow for peak measurement performance of your IRU ultrasonic sensor in any type of application.