Connecting Raspberry Pi to a USB sonar sensor
There is yet another way to sense the presence of objects: using a sonar sensor. But, before you add this capability to our system, here's a little tutorial on sonar sensors. This type of sensor uses ultrasonic sound to calculate the distance from an object.
The sound wave travels out from the sensor as illustrated in the following diagram:
The device sends out a sound wave at the rate of 10 times per second. If an object is in the path of these waves, then the waves are reflected off the object, sending waves that return to the sensor, as shown in the following figure:
The sensor then measures any return ...