The Ping))) sensor is a device you can use with the BASIC Stamp to measure how far away an object is.· It's measurement range is from 3 cm to 3.3 m, and it's remarkably accurate, easily detecting an object's distance down to the half centimeter. ·
How Does Ping))) Work?
Figure 2 shows how the Ping))) sensor sends a brief chirp with its ultrasonic speaker and makes it possible for the BASIC Stamp to measure how long the echo takes to return to the Ping))) sensor's ultrasonic microphone.· The BASIC Stamp has to send the Ping))) sensor a pulse to begin the measurement.· The Ping))) sensor then waits long enough for the BASIC Stamp program to start a PULSIN command.· Then, at about the same time the Ping))) sensor chirps its 40 kHz tone, it sends a high signal to the BASIC Stamp.· When the Ping))) sensor detects the echo with its ultrasonic microphone, it changes that high signal back to low.· The BASIC Stamp's PULSIN command measures the time between the high and low changes, and stores it measurement in a variable.· You can use this value and modify your program to use the speed of sound in air to calculate the object's distance in whatever measurement units you choose, centimeters, inches, feet, etc... ·
_____________________________________________________________________________ · The draft material in this Topic·is part of a forthcoming Stamps in Class text by Andy Lindsay. · (c) 2005·by Parallax Inc - all rights reserved.··
Post Edited By Moderator (Jessica Uelmen (Parallax)) : 8/25/2010 5:46:05 PM GMT