Ultrasonic Range Finder - LV-MaxSonar-EZ1

This is the fantastically easy to use sensor from Maxbotix. We are extremely pleased with the size, quality, and ease of use of this little range finder. The serial interface is a bit odd (it's RS232 instead of standard TTL), but the PWM and Analog interfaces will allow any micro to listen easily enough. The sensor provides very accurate readings of 0 to 255 inches (0 to 6.45m) in 1 inch increments with little or no dead zone!

Maxbotix is offering the EZ0, EZ1, EZ2, EZ3, and EZ4 with progressively narrower beam angles allowing the sensor to match the application. Please see beam width explanation below.

Control up to 10 sensors with only two pins! Checkout the Maxbotix FAQ listed below.

  • 42kHz Ultrasonic sensor
  • Operates from 2.5-5.5V
  • Low 2mA supply current
  • 20Hz reading rate
  • RS232 Serial Output - 9600bps
  • Analog Output - 10mV/inch
  • PWM Output - 147uS/inch
  • Small, light weight module

Ultrasonic Range Finder - LV-MaxSonar-EZ1 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.



Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

1 Soldering

Skill Level: Noob - Some basic soldering is required, but it is limited to a just a few pins, basic through-hole soldering, and couple (if any) polarized components. A basic soldering iron is all you should need.
See all skill levels


Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

2 Programming

Skill Level: Rookie - You will need a better fundamental understand of what code is, and how it works. You will be using beginner-level software and development tools like Arduino. You will be dealing directly with code, but numerous examples and libraries are available. Sensors or shields will communicate with serial or TTL.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

3 Electrical Prototyping

Skill Level: Competent - You will be required to reference a datasheet or schematic to know how to use a component. Your knowledge of a datasheet will only require basic features like power requirements, pinouts, or communications type. Also, you may need a power supply that?s greater than 12V or more than 1A worth of current.
See all skill levels


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.

  • sgriset / about 8 years ago / 1

    Having trouble making this sensor work hooking it up to Raspberry Pi. Using the inverter based on Simon Monks rangefinder tutorial and connecting it into raspirobotboard version one everything works fine. However when I remove the board connect the inverter and sensor directly into rpi using pin 10 (RXD) nothing happens. Is there any suggestions? They would be greatly appreciated. Kind of frustrated can't figure out what is wrong.

  • Member #779951 / about 9 years ago / 1

    Check out our tutorial

    http://www.instructables.com/id/Arduino-Project-in-5-Minutes/

  • Member #742399 / about 9 years ago / 1

    got to be careful. you have to use it in a very open setting, any obstruction within a +-70degrees view would cause the wave to reflect back. so in essence be in mind that this is a very wide angle sonar.

    but once you use it in a clear view, the reading is very accurate, within 1 inch for a range of about 100inches

  • ChristheCarpenter / about 14 years ago / 9

    Wow, what a great item. And accurate? This thing is so precise, I even found Jesus! --He's 1st, you know.

    • SomeGuy123 / about 13 years ago * / 3

      While I am not strongly against the placement of the religious logo on this product, I do believe that putting an unprofessional logo on their product suggests that the product itself is unprofessional. That combined with the logo's potential to offend Maxbotix's customers makes the logo a bad business decision.

      On a side note, putting religious logos on products is not a very effective way to spread one's religion.

      • Dougie / about 13 years ago / 3

        You know those silly evangelists....

      • tweedius / about 13 years ago / 3

        Lighten up. It is a great sensor.

        • wlewis / about 13 years ago / 2

          This reminds me of how paypal can close out an account or the US government arrest anyone for any reason whatsoever - and get away with it. Would people buy chinese products if a star was on all their components? How about Allah gas logos at American gas stations where you don't get gas until you say allah three times while balancing a ball on your nose. Why hasn't someone figured out how to trick the subconscious Gee.. something tells me that wouldn't go over too well with medical industry. I read somewhere about interference problems with this sensor when used with a servo - and it was "not" an easy fix.

  • Member #45249 / about 13 years ago / 8

    Whoa, hey...
    I just discovered a brilliant solution to this problem.
    If you attach your sensor to a panel, or anything really, so that the sensor is facing away from it......... you won't be able to see the symbols etched on the back! you can forget about them and be happy and never have to look at them.

  • Dougie / about 13 years ago / 6

    So this sensor tells me how far I am from Jesus?

  • johndavid400 / about 15 years ago / 6

    I personally prefer this company because they put the Jesus 1st fish and cross logo. I hardly call a barely-visible logo pushing religion, but to each his own.
    They also have a far superior product to the Parallax ping sensors, which require that you change the state of the pin from an Output to send the pulse, back to an Input to read it again after waiting for it to return. This causes much un-needed overhead for your code which is avoided by the Maxbotics sensors.
    I have the PVC outdoor model from here and love it. I plan to buy several more of the EZ-1 models.

    • Coming from a die-hard atheist, I say "don't buy it if you don't want to support religion". That said, it's a good product.

    • Zak / about 14 years ago / 2

      Wow - just looked at the Ping sensors: they're rubbish compared to the Maxbotix ones.
      Have just hooked my EZ0 up to an Arduino - one of the easiest doodads I've ever used with it. It was more work (MUCH more work) to set up the 4x7-segment display as a readout.
      Using PWM is easy on the Arduino, too. The pulseIn function handles everything nicely.

    • Squalor / about 11 years ago / 1

      I know this is outdated, but the EZ-1 is not nearly as accurate as the Ping series. The extra code is worth ten times the detail in data.

  • GreyGnome / about 13 years ago * / 5

    I was not going to get this product. Then I saw reference to Jesus, realized that a private company can put anything they want on the bottom of their product, and decided to purchase it.

    If these guys wanted to put that little fish with feet that says "Darwin" on it, I'd be cool with that too. Maybe I'd order 2.

    So long as the government keeps religion bias out of U.S. government business, I'm comfortable. Put the little fish and the cross on whitehouse.gov, and watch my blood boil... now THAT is worth a complaint, boycott, protest, or what have you.

    Heck, maybe I'll order 3. Or maybe ordering or not ordering any based on the manufacturer's private* religious beliefs and the expression thereof in an (arguably) public place is just silly. Yes, that's it- that's what I really think. It's silly. I'm not ordering any. Unless I need one. Then I'll buy one of these. Printed howsoever the manufacturer sees fit.

    (* private as in, "...belonging to or concerning an individual person, company, or interest...", not as in "not known or intended to be known publicly")

  • Econaut / about 13 years ago / 5

    I was also about to get this product but noticed the ridiculous jesus crap on the bottom. Thanks commenter's.

  • Member #343492 / about 12 years ago / 3

    LOL @ all the 12 year old theophobes bashing the religious icon on the PCB.... Apparently it's not considered intolerant or bigoted to bash a company for having a positive view towards Christianity, but I am sure that every one of you conflicted theophobes would have a problem with someone bashing a company for having a positive view towards gays!

    It's the idiots of this world (like you theophobes) that make normal people feel better about themselves :-)

    I'm gonna buy a couple of these things... Not because I subscribe to any religion, but because I am not a theophobe nor homophobe (nor any other type of -phobe except for maybe an arachnaphobe!) and it makes me happy to know that I am not like the freaks that are bashing this company!

  • yan_g / about 13 years ago / 3

    The most shocking thing about this Jesus print is that is says "1st". It's quite disrespectful to anyone believing he's only second (like Muslims for instance), or third, or last. But well bigotry is the only weapon you have when you can't prove your prophet right. Out of my cart too :(

  • SomeGuy123 / about 13 years ago * / 2

    Maxbotix should fix up the routing on their boards. It's a bit haphazard at the moment.

  • Member #3132 / about 19 years ago / 2

    If you are wondering if you can use this sensor with the Arduino board,
    http://www.sparkfun.com/commerce/product_info.php?products_id=666
    Yes you can. Here's example code that works with a similar ultrasonic sensor:
    http://www.arduino.cc/en/Tutorial/UltrasoundSensor
    then you can load up the Processing code from this page:
    http://webzone.k3.mah.se/projects/arduino-workshop/projects/arduino_meets_processing/instructions/ultrasound.html
    and it should work.

  • elahd / about 10 years ago / 1

    Has anyone used this around dogs? Can someone test this around their dog for me?

    According to this, dogs can hear sound waves between 40 Hz and 60 kHz, so they should be able to hear this 42kHz sensor.

    I'm looking for a proximity sensor that won't drive dogs nuts.

    • M-Short / about 10 years ago / 1

      I don't think we've ever intentionally used this around dogs. But we have used these in the building, and with 40ish dogs here on a daily basis we've never had problems.

  • Member #16335 / about 11 years ago / 1

    I sent this to a friend that has done much work in the micro/ultrasonic area back when you had to use raw transducers and design your own electronics. And he was impressed. I want to use these to shut down a machine if something gets into its work area. And about the Jesus 1st symbol. Are you so weak in your atheism that seeing a tiny symbol is going to rock your world? Symbols of atheism don't get my panty's in a bunch. Relax.

  • Member #478748 / about 11 years ago / 1

    hello, I need some help, I got a IOIO OTG board and I wan to know if this sensor works with it, thank you

  • Member #458939 / about 11 years ago / 1

    hi, does this measure only in one line, or it can cover wider areas, too? i mean: http://s22.postimg.org/j2afb5r8x/photo.jpg

  • Sir. MiDri / about 12 years ago / 1

    Does anyone know if this type of ultrasonic emitter is able to be used to measure volume inside a container? All of my research into the topic has shown that there's not a huge difference in the design of the $300 ones designed to sense volume in a container and these.

    • You might be able to get a rough size estimate using one of these, but depending on how small the container was, you would likely get some noise in the readings as the signal bounced off different sides of the container. I imagine you'd have to measure readings at different angles and do some serious data processing to get a good idea of the shape/volume of the container. However, if you try this out and are able to get it up and running, please let us know! We'd love to see it, and I'm sure it would benefit some other customers as well.

  • krdarrah1234 / about 12 years ago / 1

    Really nice and accurate sensor that delivers the reading in many easy to use technologies. Did a tutorial with this one and an Arduino to help back your car up into your garage (using the goofy 232), ha! http://www.youtube.com/watch?v=U4D_c3fflLU

  • tom jennings / about 12 years ago / 1

    i'm choosing EZ-3 based on beam width (i used an EZ-1, which worked just great, but found the beam wider than i wanted) and puzzled out the datasheet (which is dense, but complete).

    the key is the diagram at the bottom lower right of the first page.

    there's a paragraph that ought to be there maybe, stating 'principle of operation', but you should google sonar sensors and work out how they work yourself. they assume you know that: sonar (sound) has to reflect off the thing you want it to "see" and, intuitively, if the thing is very thin it is hard to see at a distance.

    the four diagrams show the result of "seeing" the target (A, B, C, D) described. A, the 1/4" rod -- very thin!! -- can be seen out to about 4 feet (at 5V). It can see it not only when pointed directly at it, but when the thing is up to approx. 1 foot to either side of straight ahead. The implication is that beyond 4 feet, it cannot see something that thin. this is entirely reasonable, and excellent performance.

    For D, the 11" wide board, the EZ can see it up to 20 feet.

    They imply -- and i can verify -- that their test of side-to-side beam width applies also to up-and-down, in other words, the beam is more or less like a... q-tip? propane torch flame? the beam pattern is a 3-dimensional space, hard to represent on paper.

    its a great product. I'm using PWM and interrupts on the trailing edge and getting very good haptic feedback from an EZ-1. I will buy the EZ-3 for the narrower beam.

    Cross-posting this to the EZ-1 comments because that part seems more popular.

  • Member #368777 / about 12 years ago / 1

    Hi everyone, Is it possible to use this sensor and connect the TX pin to an XBee? and will the data be displayed in decimal?

  • Hopworks / about 12 years ago / 1

    How does this technology react to water? I mean, specifically, if I aim it at a tub of water, will a change in water level be something this device can detect? I fear the water will absorb the emitted energy and not reflect back at all. Has anyone tried this?

    I want to use this device to detect my expensive malfunctioning G.E. washer's water level in the washing tub, from the lid.

  • Member #77749 / about 12 years ago / 1

    I don't understand the "The serial interface is a bit odd (it's RS232 instead of standard TTL)" I looked at the data sheet and it says the UART levels are 0 and 5 volts. That is TTL. RS232 standard +-(3 to 15) volt.. (bipolar). So, shouldn't I be able to interface it to an Arduino UART, which uses 0 to 5 volts without the need for an RS232 level shifter such as a MAX232?.. Please let me know if I am wrong about this.

    • MikeGrusin / about 12 years ago / 1

      Many RS-232 ports will correctly read TTL-level (0/5V) serial signals, BUT note that the data is inverted from normal TTL-level serial data, and thus a TTL serial port will be quite confused by the data. Tutorial. A possible workaround with the Arduino is that the soft serial library has an initialization option to read and write inverted data, so you might be able to use that to get it working.

      • Mike, is this why my serial port emulator (RealTerm, what else?!) is getting very garbled data? I've checked and rechecked all the settings. But it's total garbage out.

        Frustrating thing is that RealTerm has an "invert" checkbox but it doesn't seem to be doing anything to the displayed data. I guess I could just put it in hex mode, do an inversion manually on the bytes to confirm?

        • MikeGrusin / about 11 years ago / 1

          There are a lot of places in this chain of events where things could be going wrong. If you contact our tech support department they'll be happy to take a closer look at your project and help you get up and running.

  • Member #115000 / about 13 years ago / 1

    What exactly is the difference between EZ0 and EZ4? I cannot figure out how to read these datasheets.

    I am looking for something with a long range (15 feet) and a narrow beam. Like, I am mounting it on a servo and scanning for trees in my yard. As I turn the servo I want to create a map.

  • Member #313588 / about 13 years ago / 1

    is it possible somehow to connect this to a blinkm so that the blinkm is only active when someone is in proximity? Sorry if noob question but really need help thanks

  • MattAztec / about 13 years ago / 1

    Would I be able to attach this product to a sound sensor that makes a sound that changes when I move closer or further away from a wall or large object.

  • dc / about 13 years ago / 1

    I was a bit misled by the description "The sensor provides very accurate readings of 0 to 255 inches (0 to 6.45m) in 1 inch increments with little or no dead zone!". In the data sheet it says "Objects from 0-inches to 6-inches range as 6-inches" and this is in fact the case. I don't consider this to be giving an "accurate reading" when an object at 0.5 inches reads as 6 inches. If you need a sensor that will allow you to accurately stop very close to an object, this is not that sensor. I (now) understand this is a common limitation of ultrasonic sensors, and I can't blame Sparkfun for the speed of sound, but this should really be worded better.

    • Dougie / about 13 years ago / 1

      use two of them, in line, 6 inches apart. the rear sensor measures everything from 0" to 6", and the front sensor reads everything from 6" out.

  • A.G. / about 14 years ago / 1

    These are really good. A pong game I made with these sensors
    http://www.youtube.com/watch?v=ctI6i5C6A84

  • dafoink / about 14 years ago / 1

    anyone weather proof one of these to be used as collision avoidance for a car/truck?

  • johnparker / about 14 years ago * / 1

    How about a parts list..Or better yet..How about a kit?
    Please forgive my ignorance but I'm a 60 year old just beginning to get involved with the details of electronics as a hobby.
    I like this idea and would love to see some detailed instructions on assembly along with a detailed parts list of what to buy. I know the video is pretty informative but a hard copy of instructions would be helpful.
    Also, Is it possible to create a program to respond to the different ranges?
    Incidently, I like your website and your products.
    Thx

  • Member #202960 / about 14 years ago / 1

    My i send and receive signal between two modules.

  • kanurys / about 14 years ago / 1

    I want to use one of these as a backup-monitor for my car. Will the 20Hz sample rate be affected by the low frequency vibration through the chassis from my engine? (I'm worried about inaccurate readings due to comb filtering or other artifacts)

  • KingKnocker / about 14 years ago / 1

    Can you list the code you used in the video, my seven segment display reads the right numbers, but the numbers are scrolling from right to left...

  • hi 2 all, i am looking to find some pdf files or internet sites in order to understand how rangefinders works in order to work in my project.i am not really familiar with how this electronic devices work so i would like to start with the basics. Thanks for your time

  • briGHT / about 14 years ago / 1

    Hi guys
    Can someone tell me if this sensor can measure the proximity of a person through a glass window? thanks

    • As the window will bounce all the ultrasonic sound right back to the sensor, no it will not. You will be able to tell with remarkable accuracy how far away the window itself is, though!

    • rocketblast / about 13 years ago / 1

      Use the Sharp IR sensors

      • ...although many types of glass have IR-reflective coatings, which would interfere with an IR sensor. (House windows, for example, usually have IR-reflective coatings for increased energy efficiency.)

  • mowcius / about 15 years ago / 1

    "I was going to buy this but I noticed there is a "Jesus 1st" image on the PCB. I will find an alternative that doesn't push religion."
    I did not realise until you had said that, the relevance of the logo.
    I think it is possibly a bit off but you cannot beat these ultrasonic sensors. They are great!
    Mowcius

  • Praveen / about 16 years ago / 1

    This product was used on a "Sumo Robot" to find objects around it. I read the analogue output of the sensor using a A/D converter of a microcontroller. Once you get the A/D converter started on any microcontroller, this sensor can be interfaced very easily.

    • rocketblast / about 13 years ago / 1

      The analog output and the PWM don't agree. The analog output is all over the place and they admit it does not respond quickly to sudden changes. PWM seems better but also jumps sometimes.

Customer Reviews

4.5 out of 5

Based on 6 ratings:

Currently viewing all customer reviews.

Works great

Super easy to hook up and start using in my project

Excellent product

The range finding is very accurate. Its doing a wonderful job for its size and price

Great

Worked as advertised. Really nice.

Very Good but tricky in multiples

When using more than one on a project, some trial and error may be necessary to get them to work using the Maxbotix wiring schemes. Micro and millisecond timing using Arduinos and other controllers is not accurate so actual pulse timing may not correspond to your coding.

Best option I came across

I tried a few sensors and this was the most consistent. Works great on walls and other flat surfaces. I'm using it to detect people, which is a more abstract object, so the range is less and sometimes gives bad readings. But for the most part, I'm happy with the purchase. Would buy again.

It is not accurate for me

The sensor I bought can not measure the distance below 14cm or 5 inches. In other words, if the distance below it, the value always show "14cm or 5 inches", but the another sensor EZ4 works fine.

something wrong with my code?

value = pulseIn(sensorPin, HIGH) ;
cm = value /58; 
inches = value / 147;