Great instructions about how to make sensor like this. I see that you put in distance 0.034 it is because of sound speed in air?
!1UP
Great instructions about how to make sensor like this. I see that you put in distance 0.034 it is because of sound speed in air?
!1UP
Thanks @kwskicky for the nice comments 🤝.
By default, the speed of sound is 340m/s (Meters per second).
Our time is in microseconds and to calculate distance,
since Speed = Distance / Time
Therefore, Distance = Speed * Time
i.e, D = s * t
converting Microseconds to seconds = 1x10^6
Distance per second equals,
D = 340 * 10^6 D = 0.00034 m/s D = 0.034cm/s
The distance calculated above is the distance the sound wave takes to hit an object and also the distance it takes to return back.
To get distance it uses to return back or reflect back. we divide the distance by 2.
d = D/2
Which is the exact distance at which the ultrasonic sensor senses the water level.