The HC-SR04 ultrasonic sensor uses sonar to measure distance to an object. It offers excellent range accuracy and stable readings in an easy-to-use package. It operation is not affected by sunlight or black material like Sharp rangefinders are (soft materials like cloth can be difficult to detect). Module main technical parameters: 1.Working Voltage : 5V(DC) 2.Static current: Less than 2mA. 3.Output signal: Electric frequency signal, high level 5V, low level 0V. 4.Sensor angle: Not more than 15 degrees. 5.Detection distance: 2cm-450cm. 6.High precision: Up to 0.3cm 7.Input trigger signal: 10us TTL impulse 8.Echo signal : output TTL PWL signal Mode of connection: 1.VCC 2.trig(T) 3.echo(R) 4.GND The basic operation principle is below : use IO port TRIG to trigger ranging. It needs 10 us high level signal at least Module will send eight 40kHz square wave automatically, and will test if there is any signal returned. If there is signal returned, output will be high level signal via IO port ECHO. The duration of the high level signal is the time from transmitter to receiving with the ultrasonic. Testing distance = duration of high level*sound velocity(340m/s) / 2 You can use the above calculation to find the distance between the obstacle and the ultrasonic module.