In this chapter, you'll need some sensors. There are three choices:
- Sonar
- LiDAR
- Infrared
Let's take a brief look at each.
This type of 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 in the following figure:
The device sends out a sound wave 10 times a second. If an object is in the path of these waves, then the waves reflect off the object. Then, this returns sound waves to the sensor, as shown in the following figure:
The sensor then measures any returning sound waves. It uses the time difference between when the sound wave was sent out and when it returns to measure the distance to the object. The advantages of the sonar sensor are that it is simple, inexpensive, and works well in all types of lighting. The disadvantages of this sensor are that it doesn't work well at longer distances and...