The ultrasonic sensor is a device that can measure the distance to an object by using sound waves. It measure distance by sending out a sound wave at specific frequency and listening for that sound wave to bounce back. By recording the time between the sound being generated and the sound bouncing back it is possible to calculate the distance between sensor and object using this formula below
Distance=Time*speed of sound divided/2 (as it travelled in two ways)
1)VCC: it power the sensor typically with +5V
2)Trigger: Trigger pin is an Input pin . This pin has to be kept high for 10us to initialize measurement by sending ultrasonic waves. It will connected analog pin of arduino.
3)Echo: Echo pin is an output pin. This pin goes high for a period of time which will equal to the time taken for the Ultrasonic waves to return back to the sensor. It will connected to analog pin of arduino.
4)GND: This pin is connected to ground of the system.
- It is used to avoid and detect obstacles with robot like obstacle avoider robot, line follower robot etc.
- Used to measure the distance within a wide range of 2cm o 400cm
- Can be used to map the object surroundings the sensor by rotating it.
- Depth of certain places like wells, pits etc can be measures since the waves can penetrate through water.
- It has sensing capability to sense all the material type.
- This sensor is not affected due to atmospheric dust, rain, snow etc.
- it has higher sensing distance compare to other proximity sensor type.
- It provide good readings in sensing large sized objects with hard surfaces.
- It is very sensitive to variation in the temperature.
- It has more difficulties in reading reflection from soft, curved, and small objects.