Introduction: Arduino HC-SRo4 Ultrasonic Range Finder

I'll show you how to use a HC-SR04 Ultrasonic Sensor to find distance measured in inches and feet. With
a wonderful Arduino Uno R3 Clone created by Elegoo

From the Elegoo UNO R3 Project Complete Starter Kit with Tutorial for Arduino MEGA2560 NANO (63 Items)

I will be using my own code that I will up load later in this Instructable.

I hope you enjoy :)

Step 1: Gather Parts

Elegoo UNO R3 Project Complete Starter Kit with Tutorial for Arduino MEGA2560 NANO (63 Items)

Has everything you need!

  1. 1 - Arduino uno R3
  2. 1 - Ultrasonic Sensor
  3. 1 - LCD Liquid Crystal Screen
  4. 2 - 10K Potentiometer
  5. 1 - Breadboard
  6. About 20 - Male to Male Jumper Wires
  7. 1 - 9 Volt Battery if you want to make it portable.

Step 2: Wire Everything Up.

First start with the LCD screen.

LCD - Arduino

  1. VSS - Ground
  2. VDD - +5VDC
  3. VO - Middle of Potentiometer Left side to +5VDC and Right side to Ground (Controllers Contrasts)
  4. RS - Arduino Pin 12
  5. RE - Ground
  6. E - Arduino Pin 11
  7. D4 - Arduino Pin 5
  8. D5 - Arduino Pin 4
  9. D6 - Arduino Pin 3
  10. D7 - Arduino Pin 2
  11. A - +5VDC
  12. K - Middle of Potentiometer Left side to +5VDC and Right side to Ground (Controllers Brightness)

Then wire up the Ultrasonic Sensor

Ultrasonic Sensor - Arduino

  1. VCC - +5VDC
  2. Trig - Arduino Pin 6
  3. Echo - Arduino Pin 7
  4. Gnd - Ground

Step 3: Upload Code

I included the Code I used in this instructable.

Just click on the .ino file and open with the Arduino IDE and upload to you Arduino.

Step 4: Take You Project Farther

You can replace the 10K Potentiometer with a resistor by using a multimeter you can find the resistance between the middle pin one of the outer pins. In my case a 9.5K Ohm resistor is needed for my brightness (Yours may vary).

Now you wont have to worry about turning the Potentiometer. You can solder all parts to a prototyping board and make you own shield for you Arduino if you would like.

Or you could even build you own Arduino and this project or its own board and enclose it into a case.