Interfacing Arduino with Pixhawk

Hi everybody,

I'm working on a project with a Pixhawk on a DJI Phantom. We substituted the proprietary NAZA controller with the Pixhawk because we want to edit the firmware, adding new sensors and changing the way to control it. We need to interface the Pixhawk with an Arduino, because we're trying to automate the landing through ultrasonic sensors and Pixhawk seems to be limited on the number of sensors. So our idea is to read the sensors through the arduino and send data to Pixhawk through the serial port.

At the moment I just found how to hardware interface them (;wap2 ) and what to write on the Arduino to let it send data through serial (TX, RX pins), but I have no idea about what to write on the Pixhawk firmware and, above all, where.

Hope someone can help me, once the landing system will be ready I'll post all the codes and the documentation I can.



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

Join diydrones

Email me when people reply –


  • Hi, I would be much interested by the result aswell, please share.

  • Hi Marco,

    I am currently working through converting my Phantom 2 over to a Pixhawk and was wondering if you managed to get yours up and running?

    I was thinking of using the DJI battery but it wont stay on, did you have any luck with this?

    I have found this site with the circuit diagram for the ESC and main board

    and this shows the (and also testing) that the ESC is a direct connection through the main board so that is nice and easy.

    If the smart battery can't be used then I was thinking of removing the main board and putting a in just a power distribution board.

    Has anyone made any progress or thoughts on the Phantom to Pixhawk mod?

    • I am just starting this process of connecting the pixhawk to the Phantom 2... any pointers would be great! 



  • Did you use a phantom 2 with a smart battery?  Im building a phantom 2 with a pixhawk  and I'm not sure were to plug in the 2 pin wire coming out of the battery.  

  • Hi Marco did you have any success with arduino to pixhawk communication? Im currently trying to read data from arduino with pixhawk through tx rx ports but I have no luck. Any pointers on how make this work?

    • Hey BertoMora, did you manage to achieve the above? I am trying to do something similar

  • Hi Marco,

    Definitely possible to do. I have interfaced a number of sensors to the APM and Pixhawk both directly attached and via an external Arduino. There are a number of I/O pins available on the Pixhawk as well as serial ports - TELEM2 can be used with alteration to the code (Mavlink by default)

    • Hey James, you said to use TELEM2 as serial port to let the pixhawk communicate with the arduino, but I cannot even enable this port. I mean, I set from the mission planner: BRD_SER2_RTSCTS param to 1 (i.e. enable) but I still don't get anything from this port. What should I alter on Mavlink code?
      Thank you so much.

    • Thank you so much James, I'm starting immediately to work on it!

  • You may have already seen this (I'm not sure how many sensors you're looking to use), but 3DR does sell an I2C splitter which allows for an additional 4 sensors (whether they be GPS, compasses, range finders, etc).

This reply was deleted.


Liam left a comment on Agricultural UAVs
I'm Liam from T-MOTOR. I would like to reach out to see if there is any possibility for us to work together.
We are a propulsion system manufacturer who offers motors, propellers and ESCs for all kinds of drone applications which vary from secur…"
Jun 30
Richard Cox left a comment on Australia
"Anyone in the DIYDRONES Australian subgroup based in Alice Springs, NT?
I am experimenting with Ardupilot (standard Arduplane), Pixhawk 4 FC in a 4-ch
RC "AXN Floater Jet" foamy plane..."
Jun 29
Omar Sykes left a comment on Australia
"Hi everyone, I am looking for someone who is good at drone building, repair and software in Adelaide. Please give me a call on 0477 319 219."
Jun 29