loading

In this project we are going to learn how to use the HC-SR04 PING))) ultrasonic sensor to measure distance. This sensor is also often used on robots to detect obstacles.

Difficulty level: Easy

Time needed: ±10 minutes

Step 1: Things You'll Need

HC-SR04 PING sensor (x1)

Arduino UNO (x1)

LCD 16x2 (x1)

9V battery + dc adaptor (x1)

Potentiometer 10kΩ (x1)

Set of jumper wires

Step 2: Plug the PING Sensor and LCD

HC-SR04

GND (pin 1) to potentiometer (left pin)

VCC (pin 2) to potentiometer (right pin)

VO (pin 3) to potentiometer (center pin)

RS (pin 4) to arduino digital pin 12

RW (pin 5) to potentiometer (left pin)

E (pin 6) to arduino digital pin 11

D4 (pin 11) to arduino digital pin 5

D5 (pin 12) to arduino digital pin 4

D6 (pin 13) to arduino digital pin 3

D7 (pin 14) to arduino digital pin 2


Potentiometer

left pin to arduino GND

right pin ro arduino 5V


PING Sensor

VCC to arduino 5V

Trig to arduino digital pin 7

Echo to arduino digital pin 6


9V battery

To arduino DC power socket

Step 4: Have Fun! Show It to Your Friends :)

Yay! you have finished making your own measuring device. Now you can measure things without using a ruler! You can adjust the LCD brightness using the potentiometer. Feel free to give comments or ask questions and stay tune for my next project ; )

Can u please make a how to make video
<p>How will this react if the surface is not parallel? Can i read it then?</p>
<p>please i will like to get your contact, I need to discuss with you </p>
How can i get the LCD display to show the the distances more clearer? Mine seems to be pretty dark even with the 10k trim pot adjusted the best it can be.
<p>Good job.</p>
LCD display connection?<br>which is ping sensor here?<br>thank?
I can connect phone in the place of LCD screen
I can connect phone in the place of LCD screen
I can connect phone in the place of LCD screen
<p>Awsm bro</p>
<p>Awsm bro</p>
<p>Good work ....am make it and its funny</p>
<p>Thanks, nice and easy!</p>
<p>Thanks :)</p>
simple but useful too!<br>thanks for sharing :-)
<p>Thanks!</p>
<p>i have ir sharp sensor (range- 20cm-150cm).will it work instead of the ping sensor used here????</p>
You can replace the ping sensor with your ir sensor, but you'll have to modify your code and the wiring. if you let me know your email I can help you :)
Solanki.akash786@gmail.com<br>Pls reply soon
<p>up to how much distance it will measure</p>
The hc-sr04 ultrasonic PING))) sensor can measure 2cm-400cm
<p>hey sam! is potentiometer really necessary?</p>
<p>Nope, you can replace the potentiometer with a resistor, but you must find the right resistance so the lcd contrast is not too high or too low.</p><p>If you are still confused, you can click the link below</p><p><a href="http://forum.arduino.cc/index.php?topic=99182.0" rel="nofollow">http://forum.arduino.cc/index.php?topic=99182.0</a></p><p><a href="http://blog.rastating.com/using-a-jhd162a-lcd-screen-with-an-arduino-uno/" rel="nofollow">http://blog.rastating.com/using-a-jhd162a-lcd-scre...</a></p><p>Hope this helps ;)</p>
<p>nice tutorial thank's for sharing :)</p>
<p>Thanks! I will post more projects soon :)</p>
<p>thank you !!</p>
<p>Your welcome...</p>
Thank you for sharing your project! Do you have a link to the full code? I've had difficulty getting consistency when using the Ping ultrasonic sensor, so I'd love to see what you're doing differently than i have been. Nice, easy to follow instructable, thanks again!
<p>You can download my code from the bottom part of step 3. Hope this helps ;)</p>
<p>Great tutorial! Nice and simple too. Very well done!</p>
<p>Thanks!</p>
<p>Good Sam, good n simple instructables. video please</p>
<p>Thaks :)</p><p>Yep, I will post the video soon!</p>

About This Instructable

15,679views

276favorites

License:

Bio: I’m Samuel Alexander, a 10th grade student at Cita-Hati High School in Surabaya, Indonesia. Since I was kid I have been interested in making ... More »
More by Samuel_Alexander:Measuring Height Using Trigonometry (Measuring Tape Hack) Smart Home Power Strip Simple Distance Measuring Device 
Add instructable to: