You are on page 1of 3


Theory of Operation
The PING sensor detects the hurdles or distance to objects by emitting a 40Khz ultrasonic
burst and then "listening" for the echo. This burst will be controlled by our microcontroller.

The sensor requires a 2uS – 5uS pulse from the host ( In our case the PIC microcontroller) to
start its operation. After getting the go ahead signal , the sensor will emit a 200uS pulse in
the ultrasonic range (40kHz).The burst will travel through the air at about 1130 feet/s, and
as soon as it hits an object it will reflect back to sensor again (time ranging from 18.5uS –
115uS ), the sensor will terminate an output pulse back to the microcontroller and make its
pin ‘HIGH’. It remains HIGH for a period that indicates the distance to the target. The
width of the pulse it sends to controller when its ‘HIGH’ will be proportional to the distance.
This pulse signal is TTL compatible so we don't need A/D converter.

The Base of all our programming regarding PING will be the Get Sonar subroutine. This will
cause the PULSOUT to be low-high-low as required for triggering the PING))) sensor. After
the trigger pulse falls the sensor will wait about 200 microseconds before transmitting the
ultrasonic burst. The instruction, PULSIN, is used to measure the high-going pulse that
corresponds to the distance to the target object.

The value from PULSIN will be converted to microseconds and will be divided by 2 as the
burst covered return trip. From Now on we will have the distance to our object in
microseconds and it’s all a matter of converting it in our desired form like inches/cm. The
value for the speed-of-sound is 1130 feet per second. This works out to 13,560 in/s or 1 inch
in 73.746 ms.