32 SERVO 04.2016
There are a LOT of different ultrasonic distance
sensors on the market. They usually use a pulse
width output to indicate the distance to the nearest
object in their field of view. More expensive units
with an I2C interface are also available.
The HC-SR04 is the least expensive ultrasonic
distance sensor on the market. It is available from
several online vendors for prices ranging from $2-
$10. For the price, it’s a great buy, but it has a
shorter range than other more expensive sensors.
The HC-SR04 requires a separate TRIGGER pin,
and provides an ECHO output. Since it’s a five volt
device, you need to add a simple voltage divider
when using it with a Raspberry Pi (refer to the
You will find Python source code at
Three SirMorph's used as a line sensor for 1/2” black tape.