go_away

Author Topic: LV-MaxSonar - EZ1 Sonar Range Finder  (Read 4597 times)

0 Members and 1 Guest are viewing this topic.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
LV-MaxSonar - EZ1 Sonar Range Finder
« 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?


Offline Asellith

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 648
  • Helpful? 9
  • "I'm a leaf on the wind. Watch how I soar"
Re: LV-MaxSonar - EZ1 Sonar Range Finder
« Reply #1 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 :)
Jonathan Bowen
CorSec Engineering
www.corseceng.com

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
Re: LV-MaxSonar - EZ1 Sonar Range Finder
« Reply #2 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.
Surveyor Corporation
  www.surveyor.com

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
Re: LV-MaxSonar - EZ1 Sonar Range Finder
« Reply #3 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?


Offline paulstreats

  • Supreme Robot
  • *****
  • Posts: 1,381
  • Helpful? 21
Re: LV-MaxSonar - EZ1 Sonar Range Finder
« Reply #4 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


Offline Asellith

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 648
  • Helpful? 9
  • "I'm a leaf on the wind. Watch how I soar"
Re: LV-MaxSonar - EZ1 Sonar Range Finder
« Reply #6 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.
Jonathan Bowen
CorSec Engineering
www.corseceng.com

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: LV-MaxSonar - EZ1 Sonar Range Finder
« Reply #7 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.

 


Get Your Ad Here

data_list