Arduino - HC SR04 Ultrasonic Distance Sensor/ Ultrasonic Range Sensor

Introduction: Arduino - HC SR04 Ultrasonic Distance Sensor/ Ultrasonic Range Sensor

About: Hello world! I make simple & Advanced projects for people who want to learn programming and electronics. Most of my Instructables are about arduino and the wide range of sensors you can use with it. I ma...

Hello world! Today i made a pretty handy thing. A Distance meter with a ultrasonic distance sensor. it works perfect and can be used for a lot of things, like robot positioning etc. Don't mind the phone and Bluetooth module you don't need it, i'm just displaying the value on my phone with my android serial monitor app. Follow the next step for the Schematic Code & parts list.

Step 1: Schematic, Code & Parts List

Just wire it up like the schematic and it should work after uploading the code.

If you are using a LCD with a I2C then make sure you use the right address, i already set the lines

for using a I2C, you just need to uncomment them, and remove or comment this line below:

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

Here are the most common addresses. Look at the back of your lcd which screen you have.

//PCF8574 = 0x20, PCF8574A = 0x38, PCF8574AT = 0x3F.

You do not need the bluetooth module! i just used it to display values on my android app.

Parts list.

  1. Arduino uno, I used the RobotDyn uno. A Uno with 7 analog pins.
  2. HC-SR04 Ultrasonic Distance/range sensor.
  3. LCD 1602A, i used blue screen. (The code also has a setup for a I2C, you need to uncomment that part.)
  4. Potentiometer 10k
  5. Set of jumper wires MM/FF/MF
  6. (OPTIONAL)HC-06 Bluetooth module. To display values on my app.

Good luck!

Be the First to Share


    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020