×

SparkFun will be closed Nov. 28th and Nov. 29th in observance of Thanksgiving. Any orders qualifying for same day shipping placed after 2:00 p.m. MST on Wednesday, Nov 27th will be processed on Monday, Dec 1st. Wishing you a safe and happy holiday weekend from all of us at SparkFun!

Ultrasonic Range Finder - XL-Maxsonar EZ2

Replacement:SEN-09494. We are retiring this item because it has been a slow seller, but we are still carrying some other Maxsonar modules. This page is for reference only.

The XL series of MaxSonars are a super high-performance version of the easy-to-use sonar range finder from Maxbotix. The XL series of this sensor features higher resolution, longer range, higher power output and better calibration when compared to the LV version.

We are extremely pleased with the size, quality, and ease of use of this little range finder. The sensor provides very accurate readings from 0 to 765cm (0 to 25.1ft) with 1cm resolution. This sensor can be powered with anywhere between 3.3 and 5VDC.

Range information can be gathered through one of three methods - analog, serial, or PWM - all of which are active at the same time. The analog output will produce a voltage proportional to the measured distance, with a sensitivity of (Vcc/1024)V/cm. The serial interface is simple and formatted to RS-232, with voltages ranging from 0 to Vcc and terminal settings of 9600-8-N-1. Finally, the PWM pin outputs a pulse-width representation of the range with a scale factor of 58us/cm.

The Maxsonar-XL series is offered in the EZ0, EZ1, EZ2, EZ3, and EZ4 versions, each with progressively narrower beam angles allowing the sensor to match the application. Please see beam

  • 3.3V to 5V supply with very low average current draw
  • High acoustic power output
  • All interfaces are active simultaneously:
    • RS-232 serial
    • 0 to Vcc output range
    • 9600 baud, 8-N-1
    • Analog, (Vcc/1024) / cm
    • Pulse Width
  • Real-time auto calibration and noise rejection for every ranging cycle
  • Calibrated beam angle
  • Object detection includes zero range objects
  • Readings can occur up to every 100mS, (10-Hz rate)
  • Free run operation can continually measure and output range information
  • Triggered operation provides the range reading as desired
  • Sensor operates at 42KHz

Ultrasonic Range Finder - XL-Maxsonar EZ2 Product Help and Resources

"RS232" Output or Inverted TTL

If the ultrasonic range finder indicates that it has an "RS232 Serial Output" and is outputting an inverting signal with the voltage level based on Vcc, you could just use an inverting circuit using a transistor to invert the signal. This is not a standard RS232 that uses +/-12V. There are a few methods of flipping this signal through hardware or software. The resources and going further will provide specific examples.

Inverting Signal w/ Hardware

Doing a quick test using a retired NPN transistor from our storefront, I was able to get it working based on the circuit using a RedBoard Programmed with Arduino. I was using an Arduino so Vcc in my circuit was 5V. Since it's basically two diodes within the transistor, you will want to use resistors to limit the current. I just used two 330Ohm resistors just like I was turning on an LED. You probably do not need to do this but the values might need to be adjusted when using it at higher speeds or if the transistor is not fully turning ON/OFF. Testing with a multimeter, it worked as expected. An input of 5V would result in 0V (logic LOW) on the output since the transistor was turning on. With an input of 0V, the transistor would not be conducting so the output would be held HIGH at 5V. Using an Arduino serial passthrough for further testing, I was able to view the ultrasonic sensor's output data without any problems.

"RS232" Output and Inverting w/ Software

Otherwise, you could be clever in writing your code to store the value and possibly apply some sort of logical NOT operation. In Arduino, there is a special feature using software serial that inverts the signal by setting a parameter to true [ "Software Serial Constructor" – https://www.arduino.cc/en/Reference/SoftwareSerialConstructor ]. There was someone in the Arduino forums that provided example code to invert the output, parse the data, and output it through the serial monitor here => [ User "Goldthing" - http://forum.arduino.cc/index.php?topic=114808.msg864009#msg864009 ].

Connecting Ultrasonic Sensor to Raspberry Pi

There is a tutorial from MaxBotix that shows you how to connect ultrasonic sensors to Raspberry Pis => [ http://www.maxbotix.com/Raspberry-Pi-with-Ultrasonic-Sensors-144/ ]. Certain ultrasonic sensors listed in the article require an inverter. If the ultrasonic range finder's output serial output is " RS232 " like the sensors listed under "Ultrasonic Sensors that Require an Inverter" , this indicates that the signal is basically an inverted output with the voltage level based on Vcc.

Therefore, you would need to follow the tutorial and use a serial inverter in order to use it with the Raspberry Pi. If you are using a Raspberry Pi a transistor, Vcc should be 3.3V since the Pi uses a 3.3V system.



Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • austrisv / about 14 years ago / 1

    working great with one caveat - you product description says.
    "The sensor provides very accurate readings from 0 to 765cm (0 to 25.1ft) with 1cm resolution."
    I thought something is wrong w/ me when I could not get less than 16cm ... until after more careful reading of datasheet realized it's by design "Objects from 0-
    inches to 6-inches range as 6-inches.".
    Can you get product description corrected?
    (for myself will heck if I can find use or will need to replace).
    Thanks.

Customer Reviews

No reviews yet.