One of the useful sensors in robots are the range sensors. One of the cheapest range sensors is the ultrasonic distance sensor. The ultrasonic sensor has two pins for handling input and output, called Echo and Trigger. We are using the HC-SR04 ultrasonic distance sensor, which is shown in the following image:
The ultrasonic sound sensor contains two sections: one is the transmitter and the other is the receiver. The ultrasonic distance sensor works like this: when a trigger pulse of a short duration is applied to the trigger pin of the ultrasonic ...