= Ultrasonics = Your kit contains an ultrasonic range finder module. [[Image(http://miniimg7.rightinthebox.com/images/384x384/201311/zoqptt1385538064132.jpg, align=right)]] Being able to measure the distance to an object has obvious application in robotics, particularly for navigation. The module in your kit is very inexpensive and detects distances between 2 and 400cm with up to 3mm accuracy (400cm is a little optimistic, but it's generally good for at least 200cm). For longer distances or greater accuracy, you can use [https://www.sparkfun.com/products/13680 LIDAR], but that's a lot more expensive. You can find detailed instructions on how to use the ultrasonic module in this [http://www.instructables.com/id/Simple-Arduino-and-HC-SR04-Example/ instructable]. [https://electrosome.com/hc-sr04-ultrasonic-sensor-pic/ The module's operation] is pretty straightforward: you generate a 10us pulse on the TRIG input and the module transmits a burst of ultrasonic sound pulses; it responds with a pulse on the ECHO output whose length is proportional to the time it took for the sound pulse's echo to be received (after bouncing off the object in front of it). Using the echo time and the [http://www.sengpielaudio.com/calculator-speedsound.htm speed at which sound travels in air] (approximately 343m/s), you can calculate the distance. When you build your mini-bot, you will mount an ultrasonic sensor on the front to help it navigate. You can scan the environment in front of the robot by periodically having the robot turn on its axis while range finding; this will let it build a map of what's in front of it (Thanks to Ed Garner for that method!). Other robot designs often mount the ultrasonic module [http://www.instructables.com/id/Arduino-HC-SR04-Ultrasonic-Rover/ on a servo motor] that continuously scans the area in front of the robot Potential problems: The ultrasonic sensor transmits a burst of ultrasonic sound and then listens for the echo. The echo is received by a transducer that converts sound energy to electrical energy. The further away the target is, the weaker the received signal. To accurately measure long distances, the sensor must be able to measure the very small voltages generated by the reflected signal and if the power supply to the sensor is fluctuating rapidly (a noisy supply line) it is tough to do (try making fine measurements while bouncing on a trampoline). You can reduce noise on the power supply lines by adding a decoupling capacitor: a small capacitor placed between +5v and Gnd as close to the ultrasonic sensor as possible. The capacitor serves as a reservoir that absorbs spikes in supply voltage and supplies current when the supply voltage dips. For more information on power supply decoupling, see [DecouplingCapacitor here]. NOTE: some capacitors are polarized (ask a mentor if you are not sure), if you are using a polarized capacitor, you '''must''' connect the '-' lead to ground and the other lead to +5v...otherwise, the capacitor will turn into a firecracker. To see what happens when capacitors are used incorrectly, watch this [https://youtu.be/sW0a9d_vWoc video] Other problems: The ultrasonic pulses emitted by your sensor will bounce off any objects they encounter, resulting in echoes reaching your sensor from many directions (not just from the objects directly in front of the sensor). The sensor essentially consists of a speaker that emits the ultrasonic pulses and a microphone that receives the echoes and converts them to electrical signals. If you want your sensor to be more directional and only hear things directly in front of it, you can use a tube of paper or cardboard in front of your sensor to deflect echoes coming at it from the sides. Doing this properly can be complex (see an [http://mail.blockyourid.com/~gbpprorg/mil/shotgun/Super_Directional_Microphone.pdf example here] or some other [http://mail.blockyourid.com/~gbpprorg/mil/shotgun/Build_the_Shotgun_Sound_Snooper.pdf retro designs]). **Exercise**: Use your arduino to trigger the ultrasonic module and convert the resulting pulse duration into a distance; change the blink rate of your LED based on the distance to the target (faster=closer). **Exercise**: Build a Theramin: change the tone on your speaker based on distance from target. **Exercise**: Use an oscilloscope to observe and measure the TRIG and ECHO signals (ask a mentor for help)