KEY TAKE AWAY POINTS:
Typically with 2 "heads", one as sender (transmitter), one as receiver
The distance is calculated by looking at how much the delay of hearing the reflected sound
Measure distance in cm/inch
START A BIT > Knowledge Base > This page
Ultrasonic = sound above human hearing
Humans hear: ~20 Hz – 20 kHz
HC-SR04 uses: 40 kHz
Speed of sound ≈ 343 m/s (at room temperature)
343 m/s = 0.0343 cm/µs
Divide by 2 → because it’s a round trip
TM019: Ultrasonic sensor HC-SR04 works with 5V voltage supply, normally it integrates with Arduino board easily, but not directly working with Micro:bit, a voltage level convertor is needed. TM015: Kitronik :MOVE Motor for Micro:bit also uses this sensor.
pic from dronebotworkshop.com.
E.g. if time cost for go-back is 500us, how long distance is it away?
pic from dronebotworkshop.com
38ms is timeout to indicate nothing detected, or "too far away"