The comment that I added to the previous post was not the full solution to having a row of touchless buttons, but it set me on the way. A second pinger IS necessary to discriminate against anomalous readings.
In the following video, I turn off the yellow lights but retain a comparison between the distances from the finger to the lower (or ‘green’) pinger and the upper (or ‘yellow’) pinger.
1. There is still some confusion between readings for buttons. This might be corrected by setting the buttons farther apart and increasing the separation of the pingers.
2. You can see the light flicker as the finger hovers over the button. This is the equivalent of ‘bounce’ for a mechanical switch, and the solution is likely to be ‘debounce’ code.
Anyhow, it looks like the best way to use pingers for touchless technology is one pinger per button. That’s where I’m going next.
Available on Amazon:
Vivotech Hc-sr04 Arduino Ultrasonic Distance Measuring Sensor
Arduino Cookbook (2014 edition)
And still trying to sell my stories on Kindle: