We connected the rangefinder to the flight controller using the I2C ports shown in the image below highlighted in yellow. We also set the following parameters:
RNGFND1_MAX_CM: 6000
RNGFND1_MIN_CM: 50
RNGFND1_ADDR: 49
RNGFND1_ORIENT: 25
RNGFND1_TYPE: 14
EK2_ALT_SOURCE: 1
We also tried connecting the rangefinder to the USART highlighted in green.
When testing the sensor with Mission Planner, the “sonarrange” does not change (always 0).
We also powered the RF with an external battery. Same result.
Since it appears you can connect the sensor to a serial interface, is it possible to use a USB-serial adapter (like an FTDI adapter) and directly monitor the serial output? Perhaps you’ve simply got some bad hardware, but it might prove difficult to narrow the cause down to that if you can’t test the sensor on something other than a flight controller.
Then you have a hardware problem and probably shouldn’t even try connecting it to the flight controller until you solve it.
Most often, the problem is the meat interface between the hardware subsystems (i.e., you…or me). It’s very easy to mistakenly reverse the RX and TX pins, in which case, no detection, input, or output is possible. Fortunately, it’s also not (usually) harmful to reverse that connection, so try swapping those pins first. DO NOT accidently swap power and ground, lest you release the one-time-use magic smoke contained within every electronic component.