I2C Sonar Configuration

I have a Maxbotix I2C sonar which this page seems to suggest is supported.
How do you enable these sonar sensors, and is there a way to plot their readings in QGC?


1 Like

I havent tried it but in Mission Planner - under Initial Setup - optional hardware - I see sonar option. Maybe u can enable your sensor through that interface

It seems strange to me that it would have to be enabled in mission planner.

I am having the same issue.

@jzalger, did you ever figure out how to get the sonar to work?

@pchatrath, you can turn on the sonar from Mission Planner if you are using the APM firmware but not the PX4 firmare.

@NCharabaruk I was not able to get it work.
This seems solvable though.

Hello, this is Cody with MaxBotix Inc. I do not know if you have reviewed it already, but the Ardupilot website already has this tutorial on setting up one of our I2C sensors with the Pixhawk. You can view the article at the following link.


If you have any further questions, please feel free to contact techsupport@maxbotix.com.

Thanks for the reply Cody, but we are looking at getting this running using the PX4 flight stack.

Yes. Firstly, you need to enable the params in sensors module. I cannot recall which file, but it is in the sensors folder in px4 firmware modules.
Secondly, you need to check if your sonar module is activated in rcS script, since it must be started during system boot up that kernal is able to read the sonar values returned. (not every sensor has its corresponding activation code in rcS, so you need to verify it).
You can reference the sf0x or MB12xx, which has been implemented in the rcS. If your sonar is activated, you will see its data in QGC because sonar is one kind of range finder, its data should and will be published via uORB.

Hello, this is Cody with MaxBotix Inc. I apologize, we do not have the PX4 flight stack in-house, nor have I specifically had the chance to work with it. Unfortunately, I am unable to assist you with this at this time.

I wish you luck in finding a solution.

Alright, I figured it out (a while ago, I forgot to update this :P). In the file Firmware/cmake/configs/nuttx_px4fmu-v2_default.cmake uncomment the line #drivers/mb12xx. Next, upload the firmware to the Pixhawk. Finally, using QGroundControl or Mission Planner, go to the full parameter list and set SENS_EN_MB12xx = 1.

1 Like

I am having this same issue.

I have uncommented #drivers/mb12xx from Firmware/cmake/configs/nuttx_px4fmu-v2_default.cmake and uploaded the firmware to the Pixhawk. However, I am unable to find SENS_EN_MB12xx in the full parameter list and am unable to get readings off of the sonar sensors.

Is there something that I am missing?


I’m curious on this as well. And is it just for downward-facing, or can this be used for forward-looking (collision avoidance)?

Do anyone figured it out ? I would like to configure it with QGroundControl, but I am not able to find the solution. Thank you.

Finally I was able to set:

SENS_EN_MB12xx = 1 in the full parameter list. Now could anyone help me - how can i get the real value of this sensor from the I2C interface. What is the easiest solution to look at the real time value of this sensor ?

Hi to all, im having troubles for setup the maxbotix sonar mb1202 and 1242 on my pixhawk and pixfalcon, sombody is willing to help me solve the problem pls…

@Dharma_KC https://docs.px4.io/en/sensor/rangefinders.html