DIYUltrasonic Rangefinder (HC-SR04) by bri_huang

This sketch is missing a short description
### HC-SR04 Ultrasonic ping distance sensor The HC-SR04 is a great low-cost ultra-sonic range finder. It works by sending a short pulse (10 uS) out on the Trigger pin. This creates a pulse that will reflect off of any object that is in front of the detector. When the echo is received, the echo pin will go low. The time that the echo pin is HIGH is the time it takes for a sound wave to go from your detector to the object and bounce back. Using a simple constant velocity equation, we can determine the distance. ####Hardware Connections Connect the rangefinder along the edge of the Arduino so that: GND to GND pin next to pin 13 Echo to Arduino pin 13 and Trig to Arduino pin 12 Vcc to Arduino pin 11 -- notice that you can simply insert the range finder directly along the edge of the Arduino.

Embed This Sketch

Use the following HTML code to embed the sketch code above in your blog or website.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/sketch:97524" frameborder="0"></iframe>

Embed The Serial Monitor

You can also embed the Serial Monitor section! Just use this HTML code.

<iframe style="height: 510px; width: 100%; margin: 10px 0 10px;" allowTransparency="true" src="https://codebender.cc/embed/serialmonitor" frameborder="0"></iframe>