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
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Connecting the Ultra Sonic Sensor to You Arduino Uno
- Plug your sensor into the Bread board so there are still open holes behind it.
- Insert 3 different colored jumper wires behind the connecting pins of the Sensor in the Bread Board.
- 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)
Step 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.
- Check your Port by going to Tools > Serial Port
- I found that Com 5 works best for me
- Click on the Check mark to verify there are no issues with the sketch
- If there are no errors you can Click on the Arrow to upload to the Arduino
Step 3: Checking the Values
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