Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maxbotix Ultrasonic Distance Sensor

Similar presentations


Presentation on theme: "Maxbotix Ultrasonic Distance Sensor"— Presentation transcript:

1 Maxbotix Ultrasonic Distance Sensor
The distance sensor emits short bursts of sound and listens for this sound to echo off of nearby objects. The frequency of the sound is too high for humans to hear (it is ultrasonic). The sensor measures the time of flight of the sound burst and determines distance using the time of flight and the speed of sound (1,126 ft/s). ultrasonic pressure waves leave sensor (sensor acts like a speaker) ultrasonic wave reflects off object and returns to sensor (sensor acts like a microphone)

2 DISCLAIMER & USAGE The content of this presentation is for informational purposes only and is intended only for students attending Louisiana Tech University. The author of this information does not make any claims as to the validity or accuracy of the information or methods presented. Any procedures demonstrated here are potentially dangerous and could result in injury or damage. Louisiana Tech University and the State of Louisiana, their officers, employees, agents or volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation. If you do not agree, then do not view this content. The copyright label, the Louisiana Tech logo, and the “living with the lab” identifier should not be removed from this presentation. You may modify this work for your own purposes as long as attribution is clearly provided.

3 computing distance The Maxbotix sensor measures the time required for the burst of sound to travel to the target and back. The speed of sound is 1,126 𝑓𝑡 𝑠 in dry air at 68°F, which means that sound can travel 1 inch in 74 μs: 𝑠𝑝𝑒𝑒𝑑 𝑜𝑓 𝑠𝑜𝑢𝑛𝑑=1,126 𝑓𝑡 𝑠 ∙ 12 𝑖𝑛 𝑓𝑡 ∙ 𝑠 1,000,000 𝜇𝑠 = 1 𝑖𝑛 74 𝜇𝑠 Since the sound wave must travel out to the target and back again, a factor of 2 must be incorporated into distance calculations. If a variable “duration” records the time of flight of the sound wave, then the distance to the target in inches is computed as follows: 𝑖𝑛𝑐ℎ𝑒𝑠=𝑑𝑢𝑟𝑎𝑡𝑖𝑜𝑛 (𝜇𝑠)∙ 𝑟𝑜𝑢𝑛𝑑 𝑡𝑟𝑖𝑝 2 𝑜𝑛𝑒 𝑤𝑎𝑦 𝑡𝑟𝑖𝑝𝑠 ∙ 1 𝑖𝑛 74 𝜇𝑠

4 specifications for MB1261 MB 1261
reliable measurement range: 50cm to 10m (20 inches to 35 feet) supply voltage: 3.3V to 5V (we will use 5V) frequency: 42kHz (human hearing = 20Hz to 20kHz) 10 readings can be taken per second (10Hz sampling) analog voltage output of Vcc/1024 for every 2cm (for Vcc=5V and a 10-bit ADC, an output change of 1 = 2cm) MB 1261

5 11-inch wide board beam pattern sensor can see a 0.25-inch diameter dowel 6-feet away if it is straight ahead 3.5-inch diameter dowel 1-inch diameter dowel 0.25-inch diameter dowel can’t see me 

6 Arduino connection to an Arduino MB 1261 DIGITAL ANALOG POWER
AREF GND PMW 11 PMW 10 PMW PMW 6 PMW PMW TX 1 RX 0 RESET 3V3 5V GND GND Vin DIGITAL ANALOG POWER Arduino

7 connection to an Arduino

8 Arduino sketch void setup() { Serial.begin(9600); // use a baud rate of 9600 bps when printing to the monitor } void loop() { int output = analogRead(0); // read the voltage at analog pin 0 int distanceCM = output * 2; // compute distance in centimeters float distanceIN = distanceCM / 2.54; // compute distance in inches float distanceFT = distanceIN / 12.0; // compute distance in feet Serial.println(distanceCM); // print out distance in centimeters on LCD delay(1000); // wait 1000ms between readings }

9 example application A piezospeaker is installed on the breadboard to allow the device to output an irritating noise whose frequency is proportional to the distance from the sensor to a target. void setup() { Serial.begin(9600); // use a baud rate of 9600 bps when printing to the monitor pinMode(12,OUTPUT); // declare pin 12 as an output for speaker } void loop() { int output = analogRead(0); // read the voltage at analog pin 0 int distanceCM = output * 2; // compute distance in centimeters float distanceIN = distanceCM / 2.54; // compute distance in inches float distanceFT = distanceIN / 12.0; // compute distance in feet int tone_freq = distanceCM*40; // a freq of 40*cm is good tone(12,tone_freq); // send a tone out of pin 12 } digital output (pin 12)


Download ppt "Maxbotix Ultrasonic Distance Sensor"

Similar presentations


Ads by Google