The HC-SR04 is an ultrasonic distance sensor for Arduino projects. It uses sonar to find the distance to an object, much as a bat does. It detects objects without touching them, from 2 cm to 400 cm (1 inch to 13 feet), with accuracy up to 3 mm.
The module has an integrated ultrasonic transmitter and receiver. Sunlight and black material do not affect it, unlike optical rangefinders. Acoustically soft materials such as cloth can be difficult to detect.
To take a reading, supply the module with 5 V and apply a 10 us high-level TTL signal to the Trigger pin. The module sends out an ultrasonic signal and listens for the return. If a signal comes back, the Echo pin goes high for the time between transmit and receive. Distance to the object = duration of the Echo high level × sound velocity (340 m/s) ÷ 2.
- Working voltage
- 5 VDC
- Static current
- Less than 2 mA
- Output signal
- Electrical frequency signal, high level 5 V, low level 0 V
- Detection range
- 2 cm to 400 cm (1 inch to 13 feet)
- Accuracy
- Up to 3 mm
- Sensor angle
- Not more than 15 degrees
- Trigger input
- 10 us TTL impulse
- Echo output
- TTL PWL signal
- Pins
- VCC (5 V DC supply input), Trigger (T, control signal input), Echo (R, echo signal output), GND (ground)
- Dimensions
- 44 mm x 20 mm x 15 mm
- Weight
- 11 g net
- In the box