Maxbotix Ultrasonic Distance Sensor

Slides:



Advertisements
Similar presentations
Why won’t my Arduino work???? living with the lab © 2012 David Hall.
Advertisements

temperature system wiring
Using the servo library living with the lab Libraries are computer programs written to add functionality to Arduino programs. A library to control hobby.
Conductivity sensor implementation living with the lab © 2011 LWTL faculty team.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2012 David Hall.
Waterproofing a thermistor ENGR 121 living with the lab © 2013 David Hall.
Using the Arduino to Make an LED Flash Work in teams of two! living with the lab digital I/O pins (I/O = input / output) USB cable plug power pins.
User-defined functions in Arduino sketches living with the lab © 2012 David Hall.
Calibration of conductivity sensors living with the lab.
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
Using Your Arduino, Breadboard and Multimeter Work in teams of two! living with the lab 1 © 2012 David Hall.
1 Ultrasonic Distance Sensor. 2 How it Works The distance sensor emits short bursts of sound and listens for this sound to echo off of nearby objects.
Thermistor calibration living with the lab © 2013 David Hall.
Cascaded switching of a solenoid valve living with the lab transistor relay solenoid valve © 2012 David Hall.
Assembly of conductivity flow loop living with the lab (in preparation for calibrating conductivity sensor)
Switches & whiskers on the Arduino living with the lab lever arm switches mounted to Arduino © 2012 David Hall.
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
Using fixed-cell references and built-in functions in Excel living with the lab © 2012 David Hall.
220  470  Gnd5V Currents Through Parallel Resistors 1 living with the lab © 2012 David Hall.
Using Hobby Servos with the Arduino living with the lab © 2012 David Hall.
Introduction to Microsoft Excel living with the lab © 2012 David Hall.
Voltage Drops Around Closed Loops 470  220  5V   220  living with the lab © 2012 David Hall.
Navigating the engineering disciplines robot challenge living with the lab © 2012 David Hall.
Kirchoff’s Current Law (KCL) living with the lab University of Pennsylvania Library and Wikipedia Gustav Kirchoff (left) and Robert Bunsen (right) Bunsen.
Adding a Barrel Jack to a Battery Pack living with the lab © 2012 David Hall.
Using for loops to control LEDs living with the lab 1 1 arduino.cc the for statement allows us to repeat a block of commands a limited number of times.
Controlling Servos with the Arduino
Connecting Switches.
Series and Parallel Resistors
Introduction to the Arduino
Why Won’t My Arduino Work?
Using servos.
calibration of conductivity sensors
Servo Library and Functions
Ultrasonic Distance Sensor
Line Following Tips photoresistor circuits
Robot Assembly.
How to Use Dial Calipers
Controlling a Motor with Cascading Switches
Introduction to Transistors
RGB LEDs.
Conservation of Mass Problem
Conductivity Sensor.
Schedule 8:00-11:00 Workshop: Arduino Fundamentals
Introduction to Transistors
Servo Library and Functions
Ultrasonic Distance Sensor
a few of my favorite sensors
using for loops to control LEDs
using the Arduino to make LEDs flash
Acquiring Data from an ADXL335 Accelerometer
Using Photoresistors with an Arduino
Line Following Tips photoresistor circuit
Data Types.
analog and digital measurements
Using “if” statements.
Controlling the Heater
Digital Input from Switches
Implementing Switches Using Interrupts
Arduino: For Loops.
Non-Concurrent Force Systems
IR Object Detection IR detector IR LED IR light reflected off object
Radio Frequency Transmitter and Receiver
Interfacing a Rotary Encoder with an Arduino
Non-Concurrent Force Systems
Evaluating Design Alternatives
Counting Servo Gear Teeth (FS90R Servos)
Static Equilibrium Problem
Reservoir Loop.
Ultrasonic Distance Sensor
Presentation transcript:

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)

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.

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 𝜇𝑠

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

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 

Arduino connection to an Arduino MB 1261 DIGITAL ANALOG POWER AREF GND 13 12 PMW 11 PMW 10 PMW 9 8 7 PMW 6 PMW 5 4 PMW 3 2 TX 1 RX 0 RESET 3V3 5V GND GND Vin 0 1 2 3 4 5 DIGITAL ANALOG POWER Arduino

connection to an Arduino

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 }

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)