Sensing distance
There are two basic sensors that will return information on the distance to an object: sonar and infrared. In the case of sonar, the sensor uses ultrasonic sound to calculate the distance to an object. The sensor consists of a transmitter and receiver, the transmitter creates a sound wave that travels out from the sensor, as illustrated here:
The device is triggered by an electronic signal to send out a sound wave. If an object is in the path of these waves, then the waves reflect off the object, sending waves that return to the sensor, as shown here:
The basic sensor then measures the received sound wave and sends out an electronic signal. The user can then calculate the time difference between when the sound wave was sent out and when it returns to measure the distance to the object. Unfortunately, the return time must be measured with precision for this type of sensor to work. This is challenging for a processor such as the Galileo, that runs Linux as the base operating...