The HY-SRF05 is an ultrasonic emitter/receiver used to measure distance with a precision of ~0.3cm. It sends out a 40 KHz square wave signal that reflects on objects in front of the sensor. This signal is then read back by the sensor and the duration of the received signal is reflected on the ECHO pin.
- Supply voltage: 4.5V to 5.5V (VCC)
- Supply current: 10 to 40mA
- Trigger pin format: 10 uS digital pulse
- Sound frequency: 40 KHz
- Echo pin output: 0V-VCC
- Echo pin format: digital
- Send a 10Us wide pulse (low to high) to the Trigger pin.
- Monitor the ECHO pin.
- When the ECHO pin goes HIGH, start a timer.
- When the ECHO pin goes LOW, stop the timer and save the elapsed time.
- Use the elapsed time in the following formula to get the distance in cm:
Distance (in cm) = (elapsed time * sound velocity (340 m/s)) / 100 / 2
There is a fantastic library for Arduino called NewPing that will do all the required work. More info here: