Ultrasonic Distance Sensor with I2C Interface - RCWL-1601

via Adafruit
$8.02
SKU AF-4742

If you're like me, you've dreamed of being a dolphin - smoothly gliding through the water. Using your echo-location abilities to detect tasty fish treats. Until genetic modifications catches up with our desires, we'll just have to make do with these handy 3V Ultrasonic Sonar Distance Sensor with I2C Interface and a pair of flippers. These ubiquitous sensors are really common in robotics projects, but they can also be used for automation, interactive art and motion sensing. They work at about 2cm to 450cm away, but we think 10cm-250cm will get you the best results.

These sensors are fast, fairly easy to use, and low cost. Unlike the more common HC-SR04 series, this model can be powered by 3V or 5V and the logic level will be the same. This makes this model great for use with just about any microcontroller or microcomputer. And this sensor has been set up to use I2C instead of trigger/pulse or UART.

The I2C interface is very simple: the sensor listens on 7-bit address 0x57 (address cannot be changed). After writing a '1' to I2C to start a ranging session, wait a few milliseconds, then read the 3 byte response which is appended together for the distance in um (divide by 1000 to get mm). Pin order from Left to Right: Power, SCL, SDA, Ground - also written on the top of the PCB. Note that there's no built-in pullup resistors so we toss in two 10Ks for you to wire it up on a breadboard.

We noticed that while this sensor does work with I2C it's not very 'friendly' - it doesn't like to share the I2C bus, we think it gets confused by other commands and can lock up the bus. So best used when you either don't have other I2C sensors or devices, or there's more than one I2C bus. Still, despite this restriction, we think it's probably still useful for some folks who are using a microcomputer or controller that can't do fast GPIO toggling for trigger/pulse or don't have a hardware UART available. 

You can use this sensor with Arduino, CircuitPython (for microcontrollers or Raspberry Pi) 

We carry a large variety of distance sensors here if this fellow isn't what you're looking for.