Serial connection basics for PX4 flight controllers
A serial connection lets you link a PX4 flight controller to a ground station, companion computer, or telemetry module using a physical cable or wireless serial bridge. The PX4 autopilot uses serial ports to send flight data, receive commands, and communicate with external devices. Most flight controllers have multiple serial ports labeled UART1, UART2, UART3, and so on — each can be configured for a different purpose.
The most common setup is connecting your flight controller to a computer running QGroundControl (the standard ground station software for PX4) through a USB cable, a telemetry radio, or a serial-to-USB adapter. Before you plug anything in, you need to know which serial port you're using, what baud rate it expects, and what protocol it should speak — MAVLink is the standard for most PX4 setups.
Key Takeaways
- Serial ports on PX4 controllers are labeled UART1, UART2, and so on; each port can be assigned a different function like telemetry, GPS, or companion computer communication.
- Connection speed (baud rate) must match on both ends — common rates are 57600 for telemetry and 115200 for USB, and mismatched rates will produce garbage data or no connection.
- MAVLink is the protocol PX4 uses to package flight data and commands; QGroundControl and most telemetry radios speak MAVLink by default.
- You configure which port does what in the PX4 parameter list using QGroundControl, not by physically moving wires.
- A serial-to-USB adapter is required if your flight controller has no built-in USB port, and the adapter must support the voltage and baud rates your controller needs.
Identifying your flight controller's serial ports
Every PX4-compatible flight controller has a pinout diagram in its manual or on the manufacturer's website. This diagram shows which physical pins correspond to which UART port. For example, a Pixhawk 4 has UART1 (telemetry), UART2 (GPS), UART3 (serial 3), UART4 (serial 4), UART5 (serial 5), and UART6 (debug). Some boards also have a USB port built in, which acts as a serial connection without needing an adapter.
Each UART port has at least four pins: TX (transmit), RX (receive), power (usually 5V), and ground. When you connect an external device, you cross the TX and RX lines — the flight controller's TX goes to the device's RX, and the flight controller's RX goes to the device's TX. Ground must also be connected. If you connect TX to TX or RX to RX, data will not flow.
Consult your specific flight controller's manual to find the exact pin locations. Pixhawk boards, Cube Orange, Matek F405, and other common controllers all have different physical layouts. Connecting to the wrong pins will either do nothing or damage the board.
Setting baud rate and protocol in QGroundControl
Baud rate is the speed at which data travels over the serial line, measured in bits per second. PX4 uses different rates for different purposes: 57600 baud is standard for telemetry radios, 115200 for USB and high-speed companion computers, and 9600 for some GPS modules. If your ground station and flight controller disagree on the baud rate, you will see no data or corrupted characters.
To set the baud rate and protocol, open QGroundControl, connect your flight controller via USB, and go to Vehicle Setup → Parameters. Search for the parameter name that matches your port — for example, SER_TEL1_BAUD for UART1 (telemetry port) or SER_GPS1_BAUD for the GPS port. Change the value to match your device. Then search for the protocol parameter — SER_TEL1_PROTOCOL for UART1 — and set it to 2 (MAVLink 2) if you want standard telemetry, or to another value if your device uses a different protocol like SBUS or CRSF.
After you change a parameter, QGroundControl will ask you to reboot the flight controller. Do so, and the new settings take effect. If you still see no data, double-check the physical connections and verify that both ends are set to the same baud rate.
Wiring a telemetry radio to your flight controller
A telemetry radio is a wireless serial bridge that lets you monitor and control your aircraft from the ground. The radio module itself has a serial port that connects to your flight controller's telemetry port (usually UART1). The radio's TX pin goes to the flight controller's RX pin, the radio's RX pin goes to the flight controller's TX pin, and both grounds connect.
Common telemetry radios include the 3DR Radio, HolyBro SiK Radio, and RFD900. Most come with a connector that matches your flight controller's telemetry port, so you may not need to solder. If you do need to solder, use thin wire and a small soldering iron — the pins are close together and easy to bridge by accident.
Once wired, set the telemetry port baud rate to 57600 in QGroundControl (the standard for most radios), set the protocol to MAVLink 2, and reboot. Plug a USB cable from the radio's ground module into your computer, and QGroundControl should detect the connection. If it does not, check that the radio is powered and that the serial port is not already in use by another program.
Connecting a companion computer via serial
A companion computer is a separate single-board computer (like a Raspberry Pi) that runs custom code and communicates with the flight controller over serial. This setup lets you run computer vision, advanced navigation, or custom automation without overloading the flight controller itself.
Connect the companion computer's serial port (or a USB-to-serial adapter) to one of the flight controller's available UART ports — often UART3 or UART4. Set the baud rate to 115200 (faster than telemetry) and the protocol to MAVLink 2. On the companion computer side, open the serial port at /dev/ttyUSB0 (Linux) or COM3 (Windows) and configure it to 115200 baud. Your code can then read MAVLink messages from the flight controller and send commands back.
The PX4 documentation and the MAVSDK (MAVLink SDK) library provide code examples for companion computers in Python, C++, and other languages. Start with a simple example that just reads and prints the flight controller's heartbeat message to confirm the connection is working before you add your own logic.
Using a serial-to-USB adapter for direct computer connection
If your flight controller has no built-in USB port, a serial-to-USB adapter bridges the gap. The adapter has a USB connector on one end and serial pins (TX, RX, ground) on the other. Connect the adapter's TX to the flight controller's RX, the adapter's RX to the flight controller's TX, and both grounds. Then plug the USB end into your computer.
Common adapters include the FTDI FT232RL and the CH340. The FTDI is more reliable but more expensive; the CH340 is cheaper and works well for most purposes. Make sure the adapter supports the voltage your flight controller uses — most PX4 boards run at 3.3V or 5V, and the adapter must match. Using a 5V adapter on a 3.3V board can damage the board's RX pin.
Install the adapter's driver on your computer (FTDI drivers are built into most operating systems; CH340 drivers must be downloaded from the manufacturer). Once installed, QGroundControl should detect the adapter as a serial port. Set the baud rate to 115200 and the protocol to MAVLink 2, and you should see telemetry data flowing.
Troubleshooting serial connection problems
If QGroundControl shows no connection, start with the physical layer. Verify that TX and RX are crossed (not parallel), that ground is connected, and that all wires are seated firmly in their connectors. Loose connections are the most common cause of serial failures.
Next, check the baud rate. Open QGroundControl's Analyze Console (Analyze menu → MAVLink Inspector) and look at the raw serial data. If you see repeated characters or gibberish, the baud rate is wrong. Try 57600, 115200, and 9600 in sequence until the data becomes readable.
If the port is not detected at all, check that the serial port is not already open in another program — QGroundControl, Mission Planner, and serial terminal programs cannot share the same port. On Windows, open Device Manager and look for the port under Ports (COM & LPT). On Linux, run ls /dev/tty* in a terminal. If the port does not appear, the adapter driver is not installed or the adapter is not recognized by the operating system.
Frequently Asked Questions
What is the difference between UART and serial?
UART (Universal Asynchronous Receiver-Transmitter) is the hardware protocol that sends data one bit at a time over two wires (TX and RX). Serial is the general term for any one-way-at-a-time communication. All UARTs are serial, but not all serial connections use UART — some use other standards like RS-485. For PX4, UART and serial are used interchangeably.
Can I use multiple devices on the same serial port?
No. Each UART port can only connect to one device at a time. If you need to connect multiple devices, use different UART ports on your flight controller. If your controller does not have enough ports, you can use a serial multiplexer, but this adds complexity and is rarely necessary for standard setups.
Why does my telemetry radio work but QGroundControl shows no data?
The radio is connected but QGroundControl is not listening to it. Make sure you have selected the correct serial port in QGroundControl's connection settings (top left, where it says "PX4" or "Pixhawk"). Also verify that the baud rate in QGroundControl matches the radio's baud rate — most radios default to 57600.
Do I need to solder, or can I use connectors?
Most flight controllers come with pre-soldered connectors that match standard telemetry radios and GPS modules. If your device has a different connector, you can buy an adapter or solder the wires directly. Soldering is more reliable than loose connectors, but it requires a soldering iron and some practice.
What happens if I connect TX to TX instead of crossing them?
Nothing will happen — no data will flow. Both devices will be transmitting on the same line and listening on different lines, so they cannot hear each other. If you see no data and you have checked the baud rate, verify that TX and RX are crossed.