An ultrasonic sensor is used to measure the distance to an object using sound waves. It provides measurements of the time that takes the sound to fling something and return it to the sensor. Read More
It works on sound wave frequency like sonar. The ultrasonic sensor also cannot detect some objects.
HC-SR04 ultrasonic can measure a range of 2 cm to 400 cm (4 m).
This sensor has 2 openings on its front. One is the transmitter which transmits ultrasonic waves like a speaker and the other is a receiver that receives them like a microphone.
|Ultrasonic Pins||Arduino Pins|
|5v or Vin||5V|
Circuit Diagram for Ultrasonic Sensor With Arduino
Code For Ultrasonic Sensor Arduino
Ultrasonic Sensor and LCD 16×2 with Arduino
Now we are displaying the distance reading (sensor values) of the ultrasonic sensor on an LCD Display 16×2.
Read More about LCD 16×2:
Pin Connections of LCD 16×2 with Arduino
|Pin No.||LCD Pins||Arduino Pins|
Circuit Diagram of Ultrasonic Sensor and LCD
Here some more tutorials for you: