Connecting the Pixhawk - Offset-official/Nautilus-One GitHub Wiki
Connecting to the PixHawk
Please make sure to read this, as you could damage the electronics!
There are 2 main ways to communicate to the PixHawk: one is by connecting the Raspberry Pi to the PixHawk and using MAVROS commands. This is the way the robot should always be controlled. The other is by connecting a laptop to the PixHawk and using QGroundControl. This second option is for debugging purposes only, and we use it to configure the Pixhawk during setup.
Raspberry Pi-to-PixHawk
To connect the Raspberry Pi to the PixHawk we'll use the TELEM2 port on the PixHawk. On the Raspberry Pi (pinout here), use pins 2 (5V), 6 (GND), 8 (TXD), and 10 (RXD) to connect to the respective pins on the PixHawk (pinout here). This connection is for normal LoCO operation.
Source(https://www.researchgate.net/publication/334707975_A_Full_Distributed_Multipurpose_Autonomous_Flight_System_Using_3D_Position_Tracking_and_ROS)
Telemetry Cable
Pin Connections
Red - 2 (5V), Blue - 8 (Tx), Green - 10 (Rx), Black - 14 (GND).
Fabrication
Choose a 6 wire cable from your bag of cable harnesses.
If there are already female terminators on one end, shorten the cable to an ideal length by cutting it, then soldering it back together.
If there are no female terminators cut one of the connectors off, strip the wire, crimp on female terminators, solder them, then heatshrink them.
Cut off the unused wires.
Power Cable
Pin Connections
Connect 5V to the red wire, and GND to the black wire.
Fabrication
Select a 6 wire cable from the bag of cable harnesses. Cut off the connector at one side, then measure how long you need the cable to be. Cut the wire to size. We will be using only the red and black wires, so feel free to cut the other colored wires down to the connector. Crimp, solder, and heatshrink male terminals onto the red and black wires.
Depth Sensor Cable
Pin Connections
Use the picture above and connect Red to Red (5V), White to White (SCL), Blue to Green (SDA), and Black to Black (GND).
Fabrication
Select a 4 wire cable from the bag of cable harnesses. Cut off the connector at one side. Strip and solder the appropriate wires together as described in Pin Connections. Remember to heatshrink the connections.
Laptop(QGroundControl)-to-PixHawk
This connection is for debugging, to configure and calibrate the PixHawk, and to view the status of the PixHawk. We'll use a micro USB cable to connect to the PixHawk.
Before plugging in the micro USB cable, make sure that either:
The robot is powered on, the Raspberry Pi has power, and the power cable is connected to the PixHawk, OR
The robot is powered off, the power cable is disconnected from the PixHawk, and the Raspberry Pi TELEM2 cable is disconnected from the PixHawk.
If the Raspberry Pi is connected to the PixHawk and there is no robot power, the Raspberry Pi will receive power though the TELEM2 port of the PixHawk. This isn't enough power for the Raspberry Pi, so it will continuously brownout and potentially reboot randomly.