HRLV-MaxSonar-EZ sensor

Overview

The high resolution HRLV‑MaxSonar‑EZ senors are high performance ultrasonic sensors with noise rejection, improved automatic calibration, and factory calibrated beam patterns. The HRLV‑MaxSonar‑EZ sensors have three outputs: Analog Voltage, Pulse Width, RS232 or TTL serial data.

Documentation for this sensor is available here.

Connecting to Arduino

HRLV Sensor Pins Arduino Pins
GND GND
AN A0
+5V 5V

Code example

/********************
* HRLV EZ Max sonar 
* Reading analog voltage
* http://www.maxbotix.com
****************/

int sonarPin = A0;
float mm = 0.0;

void setup() {
  Serial.begin(38400);
}

void loop() {
  mm = analogRead(sonarPin) * 5;
  Serial.print(mm);
  Serial.println("mm");
  delay(100);
}

The raw source of the sketch example is visible here.

Enjoy!