Ultrasonico

Páginas: 5 (1110 palabras) Publicado: 3 de agosto de 2012
Chapter 1: Detect Distance with the Ping))) Ultrasonic Detector · Page 1

Chapter #1: Detect Distance with the Ping)))(TM) Ultrasonic Sensor
WHAT IS THE PING))) SENSOR?
The Ping))) sensor is a device you can use with the BASIC Stamp to measure how far away an object is. With a range of 3 centimeters to 3.3 meters, it's a shoe-in for any number of robotics and automation projects. It's alsoremarkably accurate, easily detecting an object's distance down to the half centimeter.

Figure 1 The Ping))) Sensor

HOW DOES THE PING))) SENSOR 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 the time it takes the echo to return to its ultrasonic microphone. The BASIC Stamp starts by sending thePing))) sensor a pulse to start the measurement. Then, the Ping))) sensor waits long enough for the BASIC Stamp program to start a PULSIN command. At 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 commandstores how long the high signal from the Ping))) sensor lasted in a variable. The time measurement is how long it took sound to travel to the object and back. With this measurement, you can then use the speed of sound in air to make your program calculate the object's distance in centimeters, inches, feet, etc...______________________________________________________________________________________________ The draft material in this Chapter is part of a forthcoming Stamps in Class text by Andy Lindsay. (c) 2005 by Parallax Inc - all rights reserved.

Page 2 · Smart Sensors and Applications

Figure 2 - How the Ping))) Sensor Works

The Ping))) sensor's chirps are not audible because 40 kHz is ultrasonic. What we consider sound is our inner ear's ability to detect the variations in airpressure caused by vibration. The rate of these variations determines the pitch of the tone. Higher frequency tones result in higher pitch sounds and lower frequency tones result in lower pitch tones. Most people can hear tones that range from 20 Hz, which is very low pitch, to 20 kHz, which is very high pitch. Subsonic is sound with frequencies below 20 Hz, and ultrasonic is sound with frequenciesabove 20 kHz. Since the Ping))) sensor's chirps are at 40 kHz, they are definitely ultrasonic, and not audible.

ACTIVITY #1: MEASURING ECHO TIME
In this activity, you will test the Ping))) sensor and verify that it gives you echo time measurements that correspond to an object's distance. You will also modify the example program to convert these times into centimeter measurements.
PartsRequired

All you'll need is a Ping))) sensor and three jumper wires to make it work. The Ping))) sensor has protection against programming mistakes (and wiring mistakes) built-in, so there's no need to use a 220 Ω resistor between P15 and the Ping))) sensor's SIG terminal. (1) Ping))) Ultrasonic Distance Sensor (3) Jumper Wires

Chapter 1: Detect Distance with the Ping))) Ultrasonic Detector ·Page 3

Ping))) Sensor Circuit

Figure 3 shows a schematic and wiring diagram you can use to test the Ping))) sensor. √ Build the circuit.

Figure 3 - Ping))) Sensor Schematic and Wiring Diagram

Testing the Ping))) Sensor

As mentioned earlier, the Ping))) sensor needs a start pulse from the BASIC Stamp to start its measurement. A pulse to P15 that lasts 10 µs (PULSOUT 15, 5) is easilydetected by the Ping))) sensor, and it only takes a small amount of time for the BASIC Stamp to send. A PULSIN command that stores the duration of the Ping))) sensor's echo pulse has to come immediately after the PULSOUT command. The result the PULSIN command stores is the round trip time for the Ping))) sensor's chirp to get to the object, reflect and return.
Example Program - PingTest.bs2...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • ultrasonido
  • Ultrasonido
  • ultrasonido
  • -el ultrasonido
  • El ultrasonido
  • Ultrasonicos
  • Ultrasonido
  • Ultrasonido

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS