# Question about sonar sensor(distance sensor) in voxl2

Source: https://forum.modalai.com/topic/5137/question-about-sonar-sensor-distance-sensor-in-voxl2
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2026-03-27 10:04:24 UTC by Daehan Won
Replies: 7 · Views: 2842

## Daehan Won · 2026-03-27 10:04:24 UTC

I’m trying to integrate a MaxBotix MB1242 (I2C sonar) with VOXL2 and use it in PX4, but I’m running into some issues and would appreciate your guidance.

Hardware setup:

VOXL2
VOXL 2 Ethernet and USB Hub Add-on (MDK-M0062-3-00)
MaxBotix MB1242 (I2C)
Connected via VOXL2 J19 I2C port

Current situation:

voxl-rangefinder-server is disabled / not running
In QGroundControl, I cannot find the parameter SENS_EN_MBXX
As a result, PX4 does not seem to receive any rangefinder data

Questions:

Does VOXL2 currently support MaxBotix I2C sonar sensors like the MB1242 through voxl-rangefinder-server?
Is additional configuration or driver support required to enable MB12xx sensors on VOXL2?
Are there any recommended steps to make the sensor visible (e.g., enabling specific services, modifying config files, where to connect)?
Any guidance or example setups would be greatly appreciated.

Thanks in advance!

## Reply by Eric Katzfey (ModalAI staff) · 2026-03-27 15:14:56 UTC

@Daehan-Won The mb12xx px4 driver is not in our build so you would need to add it to the voxl2-slpi build. Which pins are you attaching it to on J19?

## Reply by Daehan Won · 2026-03-28 13:04:47 UTC (in reply to Eric Katzfey)

@Eric-Katzfey
Thank you for your response. I would like to connect to pins 7 and 8 of J19.

7: I2C3 SDA 3.3V
8: I2C3 SCL 3.3V

## Reply by Daehan Won · 2026-04-08 09:37:32 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Hi!
Are there any examples, case studies, or helpful resources on modifying or adapting VOXL2 to use a different sonar sensor?

## Reply by Eric Katzfey (ModalAI staff) · 2026-04-09 16:15:59 UTC (in reply to Daehan Won)

@Daehan-Won You would need to add the support to PX4 since you are using the DSP I2C pins and only PX4 can access those while it is running. There is some useful developer documentation here: https://docs.modalai.com/voxl-px4-dev-build-guide/. Also visit the PX4 documentation as well. At a high level you'll need to fork our repo, make a branch off of voxl-dev, add the driver to the default.px4board file for voxl2-slpi, build the image, and add a start command into the startup script voxl-px4-start

## Reply by Daehan Won · 2026-04-13 08:30:33 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Thank you for reply!

I will try creating a custom build using the document you provided.

## Reply by Daehan Won · 2026-07-09 09:00:55 UTC

@eric-katzfey Hello!

I modified the boards/modalai/voxl2-slpi/default.px4board file in the PX4 firmware as shown below:

CONFIG_PLATFORM_QURT=y
CONFIG_BOARD_TOOLCHAIN="qurt"
CONFIG_DRIVERS_ACTUATORS_VOXL_ESC=y
CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP101XX=y
CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L0X=y
CONFIG_DRIVERS_DISTANCE_SENSOR_VL53L1X=y
CONFIG_DRIVERS_DISTANCE_SENSOR_MB12XX=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_DRIVERS_LIGHTS_RGBLED_NCP5623C=y
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8308=y
CONFIG_DRIVERS_MAGNETOMETER_ISENTEK_IST8310=y
CONFIG_DRIVERS_MAGNETOMETER_QMC5883L=y
CONFIG_DRIVERS_POWER_MONITOR_VOXLPM=y
CONFIG_DRIVERS_RC_CRSF_RC=y
CONFIG_DRIVERS_QSHELL_QURT=y
CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_EKF2=y
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_LAND_DETECTOR=y
CONFIG_MODULES_LOAD_MON=y
CONFIG_MODULES_MANUAL_CONTROL=y
CONFIG_MODULES_MC_ATT_CONTROL=y
CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
CONFIG_MODULES_MC_POS_CONTROL=y
CONFIG_MODULES_MC_RATE_CONTROL=y
CONFIG_MODULES_MUORB_SLPI=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_SENSORS=y
CONFIG_MODULES_SIMULATION_PWM_OUT_SIM=y
CONFIG_SYSTEMCMDS_UORB=y
CONFIG_SYSTEMCMDS_PARAM=y
CONFIG_ORB_COMMUNICATOR=y
CONFIG_PARAM_REMOTE=y

I also added the following line to boards/modalai/voxl2/target/voxl-px4-start:

qshell mb12xx start -X -b 4

After uploading the firmware, setting SENS_EN_MB12XX to 1, and rebooting, the MB1242 I2C sonar sensor works correctly.

However, I would like to use two sonar sensors.

I changed the I2C addresses of the two MB1242 sensors to 0x70 and 0x66, respectively. However, when both sensors are connected to the I2C bus at the same time, PX4 detects only one of them.

Could you please let me know how to configure PX4 on the VOXL2 so that it can detect and use multiple MB1242 I2C sensors simultaneously? Is there any additional configuration to support more than one I2C sonar sensor?

The MB1242 sonar sensors are connected to the J19 I2C port on the VOXL2.

## Reply by Eric Katzfey (ModalAI staff) · 2026-07-09 15:11:17 UTC

What commands did you use to start each one? I would try `qshell mb12xx start -X -b 4 -a 0x66` and `qshell mb12xx start -X -b 4 -a 0x70`
