SparkFun will be closing early at 3:30 Friday 5/27 and remain closed Monday for Memorial Day (5/30). Orders placed after 2pm MT on Friday (5/27) will process and ship out on Tuesday (5/31).
Congratulations on your purchase of a Maxbotix LV-EZ1 ultrasonic rangefinder. This unique sensor uses sound pulses to detect the range of nearby objects, opening all kinds of possibilities for your project.
Like a bat, the EZ1 sends out pulses of ultrasonic sound (at a frequency of 41KHz, higher than humans can hear), and listens for the reflection of the sound off nearby objects. By recording the time between the initial pulse and when the reflection is heard, the distance to the object can be determined. Sound travels at about 1126 feet per second (or 343 meters per second), so for an object 10 feet away from the sensor, the round-trip time would be 20 feet / 1126 feet per second = 0.0178 seconds or 17.8ms. The EZ1 does some clever signal processing to filter out false data to give the best possible range estimate.
Because the EZ1 uses sound to sense nearby objects, it is subject to real-world acoustics and may not work well in every situation, such as extremely noisy environments. It works best for detecting large, solid objects such as walls that provide a strong reflection. Small objects may not reflect enough sound for the sensor to pick up, and soft objects may absorb the sound rather than reflecting it back to the sensor. Oblique surfaces may cause glancing bounces to objects further away, giving erroneous readings. The Maxbotix FAQ has information on obtaining the best readings from the device.
The EZ1 has a range of 6" to 254" (6.45 meters) with 1" resolution. Objects closer than 6" will be reported as 6" away (but beware of glancing bounces to further objects). If no object is detected within the sensor's range, the output will stay at the maximum range.
Be aware that the sound pulse spreads out as it leaves the sensor, so it's more like a flashlight than a laser beam. See the documentation for diagrams on beamwidth and the sizes of objects that can be sensed reliably. Other ultrasonic sensors in the same area may interfere with each other; see the Maxbotix website for ideas on how to coordinate multiple sensors.
The EZ1 requires a power supply from 2.5V to 5.5V. The current requirement is only 3mA., which is easily supplied by an Arduino or other microcontroller with a built-in voltage regulator. Although the sensor will work at 3.3V, a 5V supply will provide the best output power for long-range operation.
The EZ1 has a header area with seven holes. You can solder a header to this area, or solder wires directly to the device. The signals are labeled in the copper on the back side of the board. A full description of the signals is available in the datasheet.
The EZ1 can provide range data in a number of different ways, which makes it easy to interface to almost any project. The available outputs are serial (see the datasheet for format), analog, and pulse-width modulation (PWM). The simplest interface is the analog output, which generates a voltage that is proportional to the distance to the object. The voltage output will be half of the positive supply voltage (VCC) at maximum EZ1 range (254 inches). If you're using an Arduino, an ADC value of 512 will equal full range (254 inches) on the sensor.
To connect the EZ1 to a microcontroller, you only need three connections: +5V, GND, and AN (analog out). If you're using an Arduino, connect the +5V and GND to the respective pins on the Arduino, and connect AN to an analog input (0, for example). The following sketch will read the sensor and print the range in inches. Note that the output may show inaccuracies based on the above limitations (object size, shape and material, ambient noise, etc.).
We hope this sensor is a valuable addition to your projects. If you have any questions or problems (or want to show us your project!) you can always contact us at firstname.lastname@example.org.