Reports.SonarRanger History

Hide minor edits - Show changes to output

Changed lines 159-160 from:
to:
(:source lang=arduino:)
Changed lines 215-216 from:
to:
(:sourceend:)
Added lines 221-222:
(:source lang=arduino:)
Added lines 259-260:

(:sourceend:)
Changed lines 25-30 from:
NYU Computer Store 27.00
SparkFun 25.95-27.95
Adafruit 25.00
Solarbotics 23.95-24.95
MaxBotix 21.95-29.95
to:
NYU Computer Store 27.00\\
SparkFun 25.95-27.95\\
Adafruit 25.00\\
Solarbotics 23.95-24.95\\
MaxBotix 21.95-29.95\\
Changed lines 36-45 from:
Assistive Parking - Toyota
Water Measurement

Projects which have Used it
Melissa’s Project
Hannah Kang Brown
Robbie Tilton
Manuela Donoso & Dong Ik Shin
to:
Assistive Parking - Toyota\\
Water Measurement\\

Projects which have Used it\\
Melissa’s Project\\
Hannah Kang Brown\\
Robbie Tilton\\
Manuela Donoso & Dong Ik Shin\\
Changed lines 53-58 from:
http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Commanded_Loop_.pdf
http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Constantly_Looping_.pdf
http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Simultaneous_Operation_.pdf

Simultaneous
Operation
to:
http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Commanded_Loop_.pdf \\
http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Constantly_Looping_.pdf \\
http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Simultaneous_Operation_.pdf \\

'''Simultaneous
Operation'''
Changed lines 61-62 from:
Daisy Chaning with Constant Looping
to:
'''Daisy Chaning with Constant Looping'''
Changed lines 71-72 from:
Daisy Chaining with a Commanded Loop
to:
'''Daisy Chaining with a Commanded Loop'''
Changed line 94 from:
Filtering the data
to:
Filtering the data\\
Changed line 8 from:
%rframe% http://www.maxbotix.com/pictures/LV/LV-EZ%20Ultrasonic%20Range%20Finder.jpg
to:
%rframe% http://www.maxbotix.com/pictures/LV/LV-EZ%20Ultrasonic%20Range%20Finder_200px.jpg
Changed line 8 from:
ThisWiki:/uploads/Reports/sonar2.jpg
to:
%rframe% http://www.maxbotix.com/pictures/LV/LV-EZ%20Ultrasonic%20Range%20Finder.jpg
Changed line 6 from:
Modified by Mark Breneman and Melissa dela Merced
to:
Modified by Mark Breneman and Melissa dela Merced January 2012
Added lines 6-7:
Modified by Mark Breneman and Melissa dela Merced
Added lines 22-30:

Where to Buy '''''new'''''

NYU Computer Store 27.00
SparkFun 25.95-27.95
Adafruit 25.00
Solarbotics 23.95-24.95
MaxBotix 21.95-29.95
Added lines 35-74:
'''''New'''''
Assistive Parking - Toyota
Water Measurement

Projects which have Used it
Melissa’s Project
Hannah Kang Brown
Robbie Tilton
Manuela Donoso & Dong Ik Shin


http://www.instructables.com/id/Getting-started-with-the-Maxbotix-sonar-sensor-q/step4/Wire-it-up/ -QUick Start 2

http://www.maxbotix.com/tutorials.htm - Quick Start Guide

Using Multiple Sensors '''''new'''''
When using multiple utrasonic sensors there is the possibility of crosstalk or interference where one sensor may be receiving the information sent by another sensor. Maxbotix has posted solutions to avoid this problem.

http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Commanded_Loop_.pdf
http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Constantly_Looping_.pdf
http://www.maxbotix.com/uploads/Chaining_Application_Notes__AN_Output_Simultaneous_Operation_.pdf

Simultaneous Operation

You can also run them all at the same time (and for some uses this is preferred as the measurement speed is maximum, but it is only for selected applications). Just tie all of the RX pins together and command them with a pin from your microcontroller. Hold the RX pin high for more than 20uS and up to 400uS. Do not continuously leave this pin high, as then all of the sensors will free run. Command the sensors every 50mS or whenever a new range reading is desired.

Daisy Chaning with Constant Looping

If you want them to keep running and constantly loop and always provide the latest range reading you will have to do two things.

First, add a resistor between the last sensor's TX back to the Rx of the first unit through a 1K resistor.

Second, then you will have to "kick start" them, (at least 250mS or more after power is applied to the sensors to give the sensors this time to boot-up). To do this, pull the RX pin high on the first sensor for at least 20uS. Then the micro controller will have to return it's pin to a high impedance state so that the next time around the TX output from the last sensor will make it's way to the RX of the first sensor. Then all of the sensors in the chain will run in sequence. This "ring of sensors" will cycle around and around, constantly maintaining the validity of their analog values.

You can then read the latest range reading (i.e. the analog value) at any time. This is the easiest way to use them. After pulling the RX pin low, you can read the analog pin about 50mS (100mS if this is the first time reading the sensor as it calibrates upon the first commanded range cycle after power up, i.e. the sensor must complete a range cycle). In addition, the most recent range reading is always ready to be read on the analog voltage pin, so once you start the chain, and if you are using it in continuous mode, you can read the values at any time.

Daisy Chaining with a Commanded Loop

To chain the sensors, and have them to operate in sequential daisy-chained fashion, you do so by linking the TX of unit 1 to RX of unit 2 and so on. The BW pin is tied high on all of the parts. Then just strobe the first sensor's RX pin and all of the sensors will read the range in sequence. The analog values can then be read. The example above would use one pin to command the chain, and three analog to digital inputs.
Changed lines 93-94 from:
to:
'''''New'''''
Filtering the data

Maxbotix recommends not to average the readings from the sensor or else it will provide incorrect data. Users should instead use the following filtering methods:

Median Filter
The median filter would take the last group of readings and first sort them and then pull out the center reading. Here one might take three or more readings (up to say about 11 for people sensing) and after sorting the readings in order of range, pull out and use only the middle (median) reading. Fairly good filtering.

Mode Filtering
The mode filter would take the largest group of the same readings out of a set of even larger readings. Very robust filtering. Filtering for most applications, the Very Simple Mode Filter

The simplest mode filter, is simple as this question, "Do the last two readings agree?" (with in a certain distance, and the certain distance depends upon how much variation one expects in the actual use. Even so most use the logic of "are these readings exactly the same")? If so, use the readings, otherwise throw away to oldest reading, and compare the next reading with the most current reading and do this again. Obviously with very noisy data, one might have to sample a larger group of readings, and pull out the most common reading, but for most applications, this simple two reading filter works very well.
Added lines 159-254:

Code Sample for Arduino C: (by Bruce Allen http://www.arduino.cc/playground/Main/MaxSonar)

//Feel free to use this code.
//Please be respectful by acknowledging the author in the code if you use or modify it.
//Author: Bruce Allen
//Date: 23/07/09

//Analog pin 1 for reading in the analog voltage from the MaxSonar device.
//This variable is a constant because the pin will not change throughout execution of this code.
const int anPin = 1;

//variables needed to store values
long anVolt, inches, cm;
int sum=0;//Create sum variable so it can be averaged
int avgrange=60;//Quantity of values to average (sample size)

void setup() {
//This opens up a serial connection to shoot the results back to the PC console
Serial.begin(9600);

}
void loop() {
pinMode(anPin, INPUT);

//MaxSonar Analog reads are known to be very sensitive. See the Arduino forum for more information.
//A simple fix is to average out a sample of n readings to get a more consistant reading.\\
//Even with averaging I still find it to be less accurate than the pw method.\\
//This loop gets 60 reads and averages them

for(int i = 0; i < avgrange ; i++)
{

//Used to read in the analog voltage output that is being sent by the MaxSonar device.
//Scale factor is (Vcc/512) per inch. A 5V supply yields ~9.8mV/in
anVolt = analogRead(anPin);
sum += anVolt;
delay(10);

}

inches = sum/avgrange;
cm = inches * 2.54;
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

//reset sample total
sum = 0;

delay(500);

}

*****************************************

PW

//Feel free to use this code.
//Please be respectful by acknowledging the author in the code if you use or modify it.
//Author: Bruce Allen
//Date: 23/07/09

//Digital pin 7 for reading in the pulse width from the MaxSonar device.
//This variable is a constant because the pin will not change throughout execution of this code.
const int pwPin = 7;
//variables needed to store values
long pulse, inches, cm;
void setup() {
//This opens up a serial connection to shoot the results back to the PC console
Serial.begin(9600);

}
void loop() {
pinMode(pwPin, INPUT);

//Used to read in the pulse that is being sent by the MaxSonar device.
//Pulse Width representation with a scale factor of 147 uS per Inch.

pulse = pulseIn(pwPin, HIGH);
//147uS per inch
inches = pulse/147;
//change inches to centimetres
cm = inches * 2.54;

Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();

delay(500);

}
Changed lines 4-5 from:
Initial Summary by Rebecca Bray, February 2006
to:
Initial Summary by Rebecca Bray, February 2006. [[http://www.overainslie.org/rbray/itp/sensors/datasheet-sonar.html | See original report]] with photos and diagrams.
Deleted line 0:
Changed lines 6-7 from:
ThisWiki:/uploads/Reports/sonar100.jpg
to:
ThisWiki:/uploads/Reports/sonar2.jpg
Changed lines 1-2 from:
ThisWiki:/uploads/Reports/sonar100.jpg
to:
Added lines 7-8:
ThisWiki:/uploads/Reports/sonar100.jpg
Changed lines 1-2 from:
ThisWiki:/uploads/Reports/sonar1.jpg
to:
ThisWiki:/uploads/Reports/sonar100.jpg
Changed lines 1-2 from:
ThisWiki:/uploads/Reports/flex-photo1.jpg
to:
ThisWiki:/uploads/Reports/sonar1.jpg
Changed lines 1-2 from:
[[thiswiki:/uploads/Reports/sonar1.jpg]]
to:
ThisWiki:/uploads/Reports/flex-photo1.jpg
Added lines 1-2:
[[thiswiki:/uploads/Reports/sonar1.jpg]]
Changed lines 8-11 from:
[[http://www.maxbotix.com | MaxSonar-EZ1 High Performance Sonar Range Finder from Maxbotix]]

On this page
: Intro | Applications | Electrical | Output Pins | Analog Output | Circuit | Code Example | Questions
to:
[[http://www.maxbotix.com | MaxSonar-EZ1 High Performance Sonar Range Finder from Maxbotix]]

See [[http
://www.maxbotix.com/uploads/MaxSonar-EZ1-Datasheet.pdf | Datasheet]]

On this page: Intro | Applications
| Electrical | Output Pins | Analog Output | Circuit | Code Example
Added line 3:
Changed lines 14-15 from:
This sensor gives short to long range detection and ranging. It detects objects from 0 inches to 254 inches and ranges from 6 inches to 254 with a one-inch resolution.The ability to give meaningful output at such close range is rare, as is this sensors' small size and relatively low price. It is comparable in price to the Devantech Ranger, but has a greater range and more types of output.
to:
This sensor gives short to long range detection and ranging. It detects objects from 0 inches to 254 inches and ranges from 6 inches to 254 with a one-inch resolution.The ability to give meaningful output at such close range is rare, as is this sensors' small size and relatively low price. It is comparable in price to the [[http://www.acroname.com/robotics/parts/R93-SRF04.html | Devantech Ranger]], but has a greater range and more types of output.
Changed lines 20-21 from:
Electrical Characteristics
to:
'''Electrical Characteristics'''
Changed lines 24-25 from:
Output Pins
to:
'''Output Pins'''
Changed lines 40-41 from:
The circuit
to:
'''The circuit'''
Changed lines 55-56 from:
Code Sample: (from product FAQ)
to:
'''Code Sample''': (from product FAQ)
Changed lines 93-116 from:

Questions:

- How do i choose a LM324 operational amplifier from the many available kinds?

- Can I create my own diode array for this or should the BAV99DA be used, since that's in on the circuit diagram?

- Why does analog in go in to 2 pins on the circuit diagram on the datasheet? Same for RX and TX. Is that just showing options?

- Apart from the one analog connection, the op amp and diode array are not arranged between the microcontroller and sensor. If I'm using the PW to get readings, do I need the op amp and diode array?

- What does "Learns ringdown pattern when commanded to start ranging" mean?

- What does "High output 10V PP square wave sensor drive" mean?



Links:

Go to the Maxbotix site for more information on the FAQ

Back to my main Sensors page

Up to Top ^
to:
[[http://www.maxbotix.com | Go to the Maxbotix site]] for more information on the FAQ
Changed lines 5-6 from:
MaxSonar-EZ1 High Performance Sonar Range Finder from Maxbotix
to:
[[http://www.maxbotix.com | MaxSonar-EZ1 High Performance Sonar Range Finder from Maxbotix]]
Changed lines 15-16 from:
Applications
to:
'''Applications'''
Added lines 1-115:
Sonar Range Finder
DataSheet Summary
Initial Summary by Rebecca Bray, February 2006

MaxSonar-EZ1 High Performance Sonar Range Finder from Maxbotix

On this page: Intro | Applications | Electrical | Output Pins | Analog Output | Circuit | Code Example | Questions

This is a brand new product released in January 2006 that Bob Gross designed when his daughter's robot lost a race because it misjudged distance to a wall. According to current discussions about it on various robotics forums, it's a comparatively good product.

Sonar rangers work by sending out ultrasonic beams and receiving the waves that it receives, like bats. In this way it can detect both the presence and distance of objects. This particular sensor operates at 42KHz. The signal from the transducer in the sensor is amplified and goes through an analog to digital converter integrated into a microcontroller within the sensor. The microcontroller is continuously processing the signal.

This sensor gives short to long range detection and ranging. It detects objects from 0 inches to 254 inches and ranges from 6 inches to 254 with a one-inch resolution.The ability to give meaningful output at such close range is rare, as is this sensors' small size and relatively low price. It is comparable in price to the Devantech Ranger, but has a greater range and more types of output.

Applications

This sensor was designed for use in robotics, but could be used in a range of applications, including deep sea fishing, industrial production (finding flaws in factory parts), simple object detection, etc.

Electrical Characteristics

This sensor requires 5VDC +/- 0.5VDC. Current capability of 3mA capacity is recommended. It outputs 0 to 2.55 volts with a scaling factor of 10mV per inch.

Output Pins

The sensor gives output as pulse width, analog, and serial digital, and can give all 3 simultaneously. It can give readings every 50mS.

The serial output characteristics on the TX pin are a little atypical with RS232 format with 0-5 V. This caused some consternation on some of the robotics forums.

The RX pin is pulled high, and the sensor will measure data if it's kept there. To do triggered readings instead of continuous, bring this pin low until you want a reading and then bring high for 20uS.

The analog output is scaled. It outputs 0 to 2.55 volts and scales to 10mV per inch. To reduce the noise on the output, a 0.1uF capacitor can be placed between the analog pin on the microcontroller and then a 10K ohm resistor in series with the analog voltage output from the sensor to that capacitor. The analog output needs to be buffered by the op amp in the circuit.

The FAQ on the product web site says that pulse width and serial output give the most accurate numbers.

Pulse width output gives range and the numbers can be used to calculate distance using the scale factor of 147uS per inch. Pulse width is set high internally after the sonar waves are sent, and if something is detected, the PW pin is pulled low.



The circuit

Parts:
PIC16F676
LM324 Operational Amplifier (14 pin)
BAV99DA diode array
8 100K resistors, 2 10K, 1 each - 1K, 33K, 75K, 2.7K
1 u, 5 0.1u,3 600pcapacitors

The data sheet shows that the circuit for the analog readings requires a LM324 Low Power Quad Operational Amplifier and a BAV99DA diode array. On Tom's site there's an example of an op amplier and diode array, used there with a piezo as sensor.

Operational amplifiers serve to amplify the voltage. If there are very small changes in the readings, you need to amplify them to get good data. There are various resisters in this circuit, and I believe that by adjusting them you can adjust the scale of the readings. The LM324 has 14 pins.

The switching diode array helps to ensure that voltage does not flow in the wrong direction and that the readings are always positive.

Code Sample: (from product FAQ)

'BX24
'MaxSonar-EZ1 Code Example
'By Chris Harriman
'01/09/2006
'The program below continues to read the MaxSonarEZ1
'It uses the AD to read, and debug to output the data.

Const RX As Byte = 10
Const AN As Byte = 13
Dim AnalogOutPut As Byte
Dim SerialOutPut As Byte
Dim PWOutPut As Byte
''**********************************************************************************************
Sub Main()
Do
AnalogOutPut = RangeA ' Get the Range
Debug.Print "Analog " & CStr(AnalogOutPut) ' Print the Range
Call SLeep(512)
Loop
End Sub

'**********************************************************************************************
Function RangeA() As Byte
' Reads the Analog output of the MAXSonar EZ1 (AN Pin) and returns the target range as a Byte
Dim AValue As Integer

Call PutPin (RX, 0) ' Turn off the EZ1 just in case we started with it on
Call PutPin (RX, 1) ' Turn on the EZ1
Call Sleep(40) ' Wait about 50 ms

AValue = GetADC(AN) ' Read the ADC
RangeA = Cbyte(AValue \ 2) ' Convert value to Byte and return
End Function
'**********************************************************************************************



Questions:

- How do i choose a LM324 operational amplifier from the many available kinds?

- Can I create my own diode array for this or should the BAV99DA be used, since that's in on the circuit diagram?

- Why does analog in go in to 2 pins on the circuit diagram on the datasheet? Same for RX and TX. Is that just showing options?

- Apart from the one analog connection, the op amp and diode array are not arranged between the microcontroller and sensor. If I'm using the PW to get readings, do I need the op amp and diode array?

- What does "Learns ringdown pattern when commanded to start ranging" mean?

- What does "High output 10V PP square wave sensor drive" mean?



Links:

Go to the Maxbotix site for more information on the FAQ

Back to my main Sensors page

Up to Top ^