Rebecca Bray : ITP : Spring 2006 : Sensor Workshop Class : DataSheet Assignment

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 ^