Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: vidam on February 28, 2008, 12:05:50 PM

Title: LV-MaxSonar - EZ1 Sonar Range Finder
Post by: vidam on February 28, 2008, 12:05:50 PM
I want to gain an overall understanding for the pinouts on the MaxSonar-EZ1 and so I read the datasheet. I am sorry to say that I'm still confused. I don't understand the need for TX, RX, AN, PW, and BW.

Pin BW-leave open or hold low for TX serial output,
Question, why do I read TX output?

Pin PW-outputs pulse width with representation for range, To calculate distance use the scale factor of 147uS per inch
Question: still not sure how to convert a PW by using the scale factor?

Pin TX: delivers asynchronous serial with an RS232 format that outputs a range 0-255 (range in inches)

Do I read the TX pin to get the rnage or the PW pin to get the range. If so how exactly do I parse/conver them?

Title: Re: LV-MaxSonar - EZ1 Sonar Range Finder
Post by: Asellith on February 28, 2008, 01:57:41 PM
Quote
Pin BW-leave open or hold low for TX serial output,
Question, why do I read TX output?

The EZ1 outputs in ttl level serial as well as PWM so yes you need TX if your using the serial option

Quote
Pin PW-outputs pulse width with representation for range, To calculate distance use the scale factor of 147uS per inch
Question: still not sure how to convert a PW by using the scale factor?

If your object is 5 inches away the width of the pulse will be 735 uS long. It varies with the distance measured.

Formula would be
Pulse width / 147 = Range in Inches

I think it also outputs an analog voltage. Thats the easiest to read is the analog 0-5v signal not sure been a while since I look at the datasheet

Quote
Pin TX: delivers asynchronous serial with an RS232 format that outputs a range 0-255 (range in inches)

Do I read the TX pin to get the range or the PW pin to get the range. If so how exactly do I parse/conver them?

The TX pin would go straight into your UART input at the TTL level on the controller and then you will just have to pull the value from the register when it receives a number. Of hand not sure about the Pulse width pin. You could set a timer to turn on whenever that pin was high and then report how many cycles it was on. Then convert that based on your clock speed to a time value. How you do that is better answered by someone else :)
Title: Re: LV-MaxSonar - EZ1 Sonar Range Finder
Post by: hgordon on February 28, 2008, 03:40:53 PM
How do you plan to interface to the EZ1 - via UART, PWM, or analog ?

I have used the EZ1 with the PWM output.  In this case, I only connect to the PW signal to receive the PWM and the RX signal to trigger the sonar reading.
Title: Re: LV-MaxSonar - EZ1 Sonar Range Finder
Post by: vidam on February 28, 2008, 06:03:51 PM
Based on the responses, I can interface my micro-controller via GND, +5V, and read the output at AN? Or do you have to make use of TX, RX, and PW?

Title: Re: LV-MaxSonar - EZ1 Sonar Range Finder
Post by: paulstreats on February 28, 2008, 06:16:21 PM
it sounds like its not an EZ sonar module at all. Is there no option for i2c control and reporting? most sonar have i2c
Title: Re: LV-MaxSonar - EZ1 Sonar Range Finder
Post by: vidam on February 28, 2008, 06:21:00 PM
www.maxbotix.com/uploads/LV-MaxSonar-EZ1-Datasheet.pdf
www.maxbotix.com/MaxSonar-EZ1__FAQ.html
http://www.pololu.com/catalog/product/726?tab=resources
Title: Re: LV-MaxSonar - EZ1 Sonar Range Finder
Post by: Asellith on February 28, 2008, 06:34:54 PM
Yes connect gnd and 5+ to the sensor and then run your AN pin into an ADC port and your good to go at 5 volts the ratio is 9.8 mv/in so 1 in = 9.8 volts. The other connections leave alone. RX is internally held high so the sensor will run constently. If you want to save battery life and turn the sensor on and off then go ahead and attach that to an output pin. Pulling the pin low will disable the sensor and then set it high and wait a few seconds to take a reading. It takes 100 ms to get the first reading if you do this so keep that in mind.
Quote
it sounds like its not an EZ sonar module at all. Is there no option for i2c control and reporting? most sonar have i2c

I don't think any of the EX series module shave i2c. just ttl level serial uart PWM and Analog. Easy sensor to use.
Title: Re: LV-MaxSonar - EZ1 Sonar Range Finder
Post by: JesseWelling on February 28, 2008, 06:39:06 PM
Just it has Inverted TTL serial. Unless you are going to a RS232 port you need to invert it back.