Ultra-Sound Meter HC-SR04 – What do we know?

  • Speed of sound

For the sake of simplicity, we will consider the speed of sound constant all over the travel from the transmitter to the receiver.

On many web sites one can find a formula that links the speed of sound and temperature.

V=331+0.6*t   (m/s)

t= temperature in celsius. For t=15°C; v=340 m/s or .034 cm/us

  • Senso HC-SR04

How the sensor works is quiet obvious. A trigger pin must be set to one for at least 10us, then the processor generates the ultra-sound signal and set the echo pin high. That pin will stay high until the signal is received back.

From PDF:

What I expect:

 

Thus since the signal must travel forth and back the distance is actually d=(v*t)/2

 

    1. What do we know (sensor, sound)?
    2. Connection to atmega 841
    3. Code to measure travel time
    4. Calibration process
    5. Sources of inaccuracy