Ultrasonic Ping With Arduino (Basic)

by chris.kelusak in Circuits > Arduino

2967 Views, 28 Favorites, 0 Comments

Ultrasonic Ping With Arduino (Basic)

20141009_163938.jpg

This Instructable will go over how to get the Arduino software to read a Ping from an Ultrasonic Sensor and an Arduino Uno.

What you'll need:

  • Arduino software
  • Arduino Uno
  • Bread Board
  • 3 jumper wires
  • USB A to B
  • Ping.ino

Connecting the Ultra Sonic Sensor to You Arduino Uno

20141009_163944.jpg
20141009_163955.jpg
20141009_163938.jpg
20141009_164130.jpg
20141009_164201.jpg
20141009_163915.jpg
  1. Plug your sensor into the Bread board so there are still open holes behind it.
  2. Insert 3 different colored jumper wires behind the connecting pins of the Sensor in the Bread Board.
  3. Noting which cable corresponds to which sensor insert the correct wire into the Arduino Uno Board
    • GND to GND
    • VCC to the correct power (in my case 5V)
    • SIG to a Digital Pin (I am using Digital Pin 2)

Upload the Ping.ino to Arduino

Upload the Ping.ino file to your device using the Arduino software. You can either open the file or copy the text and paste it into the editor.

  1. Check your Port by going to Tools > Serial Port
    • I found that Com 5 works best for me
  2. Click on the Check mark to verify there are no issues with the sketch
  3. If there are no errors you can Click on the Arrow to upload to the Arduino

Downloads

Checking the Values

Baud.PNG

Once uploaded you can check the values by clicking on the Magnifing glass on the top right of the window or by using the keyboard shortcut.

  • PC = ctrl+shift+m
  • MAC = CMD+shift+m

When the monitor is open, if you are not getting any data make sure the Baud rate is set to the same as in the code