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 ( http://forum.arduino.cc/index.php?topic=188222.5;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.

Thanks

Marco

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

Join diydrones

Email me when people reply –

Replies

  • 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

    http://www.phantompilots.com/threads/wip-phantom-2-pcbs-schematics-...

    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! 

      cheers

      Alex

  • 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)

    http://diydrones.com/forum/topics/custom-sensors-and-real-time-logging

    http://diydrones.com/forum/topics/using-a-drone-to-measure-light-ov...

    • 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.

Activity