Distance on LCD display using Arduino and HC-SR04 Ultrasonic Sensor

Distance On LCD 

In this blog the distance measured by the Ultrasonic Sensor is Displayed on the LCD display using Arduino.

Ultrasonic Sensor (HC-SR04)


Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non- contact measurement function, the ranging accuracy can reach to 3mm. The modules includes ultrasonic transmitter, receiver and control circuit. 

The basic Principle of work:
  • Using IO trigger for at least 10us high level signal.
  • The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back.
  • IF the signal back, through high level, time of high output IO duration is the time from sending ultrasonic to returning.
The total distance = (high level time x velocity of sound)/2
velocity of sound = 340 m/s

Wire connections for the Module
Complete circuit

The module have 4 pins :
  • VCC power supply
  • Trigger Pulse Input
  • Echo Pulse Output
  • Ground 0V

Connection with Arduino

  • Connect Vcc to 5 V power supply from Arduino
  • Connect Trigger pin to pin no 8 of Arduino
  • Connect Echo pin to pin no 9 of Arduino
  • Connect Ground to Ground of Arduino
The trigger pin is INPUT for the module so it is OUTPUT for the Arduino and Similarly The Echo pin is OUTPUT for the module so it is INPUT for the Arduino.

Distance on the LCD:


Code for the Arduino, LCD and Module Interface

For the self Explanatory Elaborated Code click Here

In this only The module is added rest is same as the LCD display.
So if You have no Read LCD Arduino Interface click on link below.
For LCD interface with Arduino Click Here.

Here is a video 



Feedback 

Is the material helpful. Please provide Feedback in the comments.
For more help for your concerned project comment in the comment box.

Comments

Popular posts from this blog

Arduino with Speakers Project #01 a

Speakers with Arduino

QUADRATURE ENCODER