Getting the best value possible from many measures of several HC-SR04

Hi everybody !

Here is my issue : I would like to get a very precise measure of a distance with the HC-SR04 : for that, I use more than one of them but now I would like to know how I can use them to get the best value with the minimum of resources.
Do I do a lot of measures from each HC-SR04 and use them all?
Do I get 10 value from each sensor and delete the min and the max?
Do i do one measure from each sensor with a good filter so that it will be quicker?
Do I add sensors?
Any better idea?

What is the best solution knowing that it does not have to be real-time (I can wait 1-2 seconds), that the place taken by the sensors is not an issue neither and I can add as many as I want (up to 5). By the way, the precision should at least be of half a mm.
Of course, whatever the solution chosen, I will then filter the result.

Thanks in advance for your help and have all a nice day :slight_smile:

Half a mm is a big ask

I know but with enough optimal measures and sensors, with a good filter,... Actually I am already to this precision but I am not sure it is optimal and I am looking for a better "fit".
For now what I do is that each time, I get 20 value from each sensor (I have 3 of them), I don't use half of them (he max and the min) and then I filter the average of what I have left. But I am not sure I could not do better.

I don't think 0.5mm precision is possible with those sensors. Even the official spec of 3 mm resolution is pretty hard to achieve. The object you're trying to sense also makes a difference, at the very least you need a clear reflection.

How would multiple sensors help with getting better precision?

If you're capable of and willing to do some hacking, you may be able to get close to 1 mm:

Using phase the HC-SR04 can reliably resolve distance changes less than 1 mm.

https://www.davidpilling.com/wiki/index.php/HCSR04

Whatever the best precision i can get, my question is : how to get the most accurate value from 5 sensors when all of them can at each loop take a lot of measures ? What is the best treatment I can do to get the best accuracy?