Pixhawk & Sonar

My pixhawk came in the mail today for my APMRover!

I have 2 MB1240 Sonars and was wondering where I can find a cable to hook them up to the PixHawk. I am assuming I will need to power it one way and then connect the other pins 2-5 to the I2C bus. 

Has anyone done dual sonar with Pixhawk yet?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • @thomas coyle, what were your pin assignments in pixhawk for the sonar to connect to ADC3.3V. i was not able to connect sonar to pixhawk using ADV3.3 V.

    • Sonar is broken on pixhawk without modified code.

      Supposed to be implemented in appx 4 weeks with final release of arducopter 3.2

  • were u able to get maxbotic 1240 sonar work on pixhawk. i connected the three wires form sonar to ADC3.3 port with signal pin to pin 13 (4) and GND to GNDand Vcc to Vcc. but the sonar does not works.

  • Also note the sensors will interfere with each other, review the data on Maxbotix site, on how to sync them :)



  • Admin


    Just like before with the APM2.5/2.6, you are going to have to make your own.

    Here is a link to the Pixhawk ADC3.3vdc connector pin-out: ADC pinout Pin 1 is 5vdc and pin 5 is rtn.

    If you want to trigger the sonars sequentially, like I do, you will need two digital pins for the sequential triggers. The Pixhawk digital output Wiki section describes how to define the digital pins. 

    Tridge has verified that the ADC3.3vdc analog input port does work with a MB1240 Maxbotix sonar.


    TCIII ArduRover2 Developer

    • After reading this I got the impression that you should use the 6.6v ADC or one of two pins on the 7 pin SPI interface?  Adding sonar to my pixhawk is my next project so hopefully somone has figured it out and posts more details soon. 


      Connecting the Sonar Sensor on PX4

      You will need to assign the Sonar (signal line) to an appropriate PX4 pin in Mission Planner – Configuration – Advanced Params – Adv Parameter List using the SONAR_PIN parameter.  The following PX4 “Pins” are available for SONAR use.

      SONAR_PIN = 11 – (recommended)
      The “airspeed” pin. Located on a 3 pin DF13 connector on the PX4IO
      board, but directly visible to the ADC on the PX4FMU. This pin can
      take voltages up to 6.6V (it has an internal voltage divider).

      SONAR_PIN = 12
      A general analog input pin. Located on pin 3 of the “FMUSPI” port on the
      PX4IO board, this pin is directly visible to the PX4FMU analog input
      code. This can take voltages up to 3.3V.

      SONAR_PIN = 13
      A general analog input pin. Located on pin 4 of the “FMUSPI” port on the
      PX4IO board, this pin is directly visible to the PX4FMU analog input
      code. This can take voltages up to 3.3V.  It is being worked on and will be included in this section when it is available.

      • Admin

        @A Stanley,

        Do whatever you want to do. My post above was based on actually using the 3.3v ADC and having the sonar work.


        TCIII ArduRover2 Developer

        • Does that mean the 6.6v ADC will work or that Im intitled to ruin my pixhawk if I feel like it ;)  Wasn't doubting you but the (recommended) in the post caught my attention.  Im not experienced enough to know one way or the other. 

This reply was deleted.


Laurie J. Troy liked Jasper Kueppers's profile
Apr 1