2 | | * DEVICES: ultrasonic rangefinder sensor. |
3 | | * THEORY: range finding, pulse measurement |
4 | | * TOOLS: use oscilloscope or logic analyzer to observe/measure ranging |
5 | | * HANDS-ON: Connect an ultrasonic rangefinder to the protoshield (power, ground, switch to trigger). |
6 | | * Use Arduino to trigger ranging and measure result |
7 | | * Make an electronic tape measure |
8 | | * Make a Theramin. |
| 2 | |
| 3 | Your kit contains an ultrasonic range finder module. |
| 4 | [[Image(http://miniimg7.rightinthebox.com/images/384x384/201311/zoqptt1385538064132.jpg, align=right)]] |
| 5 | 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. |
| 6 | |
| 7 | 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. |
| 8 | |
| 9 | 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 |
| 10 | |
| 11 | **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). |
| 12 | |
| 13 | **Exercise**: Build a Theramin: change the tone on your speaker based on distance from target. |
| 14 | |
| 15 | **Exercise**: Use an oscilloscope to observe and measure the TRIG and ECHO signals (ask a mentor for help) |