Introduction: Simple Distance Measuring Device

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 3: Upload the Code

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 ; )

Comments

author
ManideepS1 (author)2017-02-20

Can u please make a how to make video

author
TaisH (author)2016-12-22

How will this react if the surface is not parallel? Can i read it then?

author
kenengineboy12 (author)2016-10-13

please i will like to get your contact, I need to discuss with you

author
Neiljams (author)2016-07-25

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.

author
nipon4666 made it! (author)2016-01-12

Good job.

DSCF2524.JPG
author
nageshwararvi (author)2015-12-23

LCD display connection?
which is ping sensor here?
thank?

author
RishabhM18 (author)2015-12-09

I can connect phone in the place of LCD screen

author
RishabhM18 (author)2015-12-09

I can connect phone in the place of LCD screen

author
RishabhM18 (author)2015-12-09

I can connect phone in the place of LCD screen

author
ApoorvC1 (author)2015-11-22

Awsm bro

author
ApoorvC1 (author)2015-11-22

Awsm bro

author
laith mohamed (author)2015-09-02

Good work ....am make it and its funny

author
anthonyjclarke (author)2015-06-27

Thanks, nice and easy!

author

Thanks :)

author
Safiul islam safi (author)2015-06-25

simple but useful too!
thanks for sharing :-)

author

Thanks!

author
akashs10 (author)2015-06-15

i have ir sharp sensor (range- 20cm-150cm).will it work instead of the ping sensor used here????

author

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 :)

author

Solanki.akash786@gmail.com
Pls reply soon

author
rampothineni (author)2015-06-15

up to how much distance it will measure

author

The hc-sr04 ultrasonic PING))) sensor can measure 2cm-400cm

author
navinr (author)2015-06-13

hey sam! is potentiometer really necessary?

author
Samuel_Alexander (author)navinr2015-06-13

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.

If you are still confused, you can click the link below

http://forum.arduino.cc/index.php?topic=99182.0

http://blog.rastating.com/using-a-jhd162a-lcd-scre...

Hope this helps ;)

author
irpan (author)2015-06-12

nice tutorial thank's for sharing :)

author
Samuel_Alexander (author)irpan2015-06-12

Thanks! I will post more projects soon :)

author
MohamedK13 (author)2015-06-12

thank you !!

author

Your welcome...

author
Electron_flow (author)2015-06-11

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!

author

You can download my code from the bottom part of step 3. Hope this helps ;)

author
seamster (author)2015-06-10

Great tutorial! Nice and simple too. Very well done!

author

Thanks!

author
jallson (author)2015-06-10

Good Sam, good n simple instructables. video please

author
Samuel_Alexander (author)jallson2015-06-10

Thaks :)

Yep, I will post the video soon!

About This Instructable

16,082views

277favorites

License:

Bio: I am Samuel Alexander, a 11th 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:REAL 3D Wireframe Acrylic Table LampMeasuring Height Using Trigonometry (Measuring Tape Hack)Smart Home Power Strip
Add instructable to: