Control Handheld Ultrasonic Rangefinder | Controller Circuit

Thursday, April 14, 2011

Control Handheld Ultrasonic Rangefinder

Our ultrasonic rangefinder is capable of allowing the user to determine his or her distance from an object or wall. When deciding on what type of project to design and construct, we decided that we wanted to create something that would have some practical use in life. Many groups in the past created video games, but we wanted to be different. We considered issues such as safety, user interface, and ease of use, and came up with the idea of making an ultrasonic rangefinder. A rangefinder can be used in various applications such as a measuring device or an obstacle detection device.

As stated earlier, we wanted to create something that would be of practical use to people of various walks of life. For instance, our rangefinder could be used in the case of a blackout where a person needs to find his way through a dark building and cannot see where the walls are. Alternatively, it could be used by surveyors that are preparing a site for construction. Our project is different in the fact that we built the rangefinder from the ground up.

The basic principal of the rangefinder is based on the simple concepts of SONAR (Sound Navigation and Ranging). First, an ultrasonic pulse is transmitted by a transducer (a device that converts a voltage signal into a sound wave and vice versa). This pulse then reflects off an object and is received by another transducer. Using the known speed of sound (340.29 m/s) and the time between the transmitted pulse (the ping) and the received pulse (the pong), one can simply calculate the distance traveled by the pulse.

In addition to determining the distance between the device and an object using the known speed of sound, our initial design included two additional modes of operation. One mode was a calibration mode while the other was a speed detection mode.

Since the speed of sound varies with altitude and atmospheric conditions, a calibration mode is quite useful. Our program is designed such that if in calibrate mode, the user can place the device a known distance 5 centimeters and send a pulse. The device then uses the time necessary for the pulse to reflect off the object and calculates a new value for the speed of sound. This new value is then used for all future distance calculations until the device is powered off.

The original speed detection mode was used to indicate to the user how quickly he or she is moving towards or away from an object. Since speed is determined by the change in distance divided by the change in time (dx/dt), speed can be determined quite simply using two pulse transmissions. When initiated, a first pulse is sent and received by the device. The distance is calculated and stored by the device. A second pulse is then sent and received by the device 0.25 seconds later and the results stored by the device. The MCU can now take the difference in distance, divide that by 0.25 seconds, and display the speed to the user on the LCD. We had initially considered using Doppler shifts in frequency to calculate speed, but we decided against it since measuring frequency is a completely new task we would have to program (compared to just detecting a pulse) and would have required much more complicated and CPU intensive math. We also felt that the velocity of a handheld device would not be fast enough to actually incur significant Doppler shifts that would make calculations doable.

Due to noise issues while testing our original program, the method of calculating distance was changed. We are now taking multiple distance samples and calculating the average. This enables more accurate readings. Obviously, the larger the number of samples, the higher the accuracy. Since we are now taking multiple samples, it is possible to measure the speed of the device in the same operating mode.

No comments:

Post a Comment