Hardware interfacing
COM ports & Arduino
How the physical switches and lights in the flightdeck reach the simulator, one serial port at a time.
- Boards
- 15 microcontrollers
- Ports
- COM 3 – COM 25
- Link
- USB virtual serial
What is a COM port?
What is a COM port?
A COM port (Communication Port) is the original name for the serial port interface on IBM PC-compatible computers. It acts as a digital doorway that allows your computer to send and receive data one bit at a time, sequentially.
Historically, computers had physical 9-pin connectors (DB9) on the back labelled COM1 and COM2 to connect mice or modems. In modern computing we rarely use physical serial ports. Instead, we use virtual COM ports: when you plug a USB device (like an Arduino) into your computer, the operating system emulates a legacy serial port over the USB connection and assigns it a number (e.g. COM3, COM4, etc.).
COM ports & Arduino
Using COM ports with Arduino
For projects like Learsim, where physical switches and lights must talk to the flight simulator software, the Arduino acts as the bridge. The COM port is the pipeline for this data.
1. The hardware connection
When you connect an Arduino via USB, a "USB-to-Serial" chip on the board converts USB signals into serial data that the Arduino's processor can understand. Your computer sees this simply as a new COM port.
2. Configuring the IDE
To upload code or read data, you must tell the software exactly which door to knock on:
- aIdentify the port: in the Arduino IDE, navigate to
Tools › Port. You will usually see a list of available ports. - bSelect the correct port: if you unplug the Arduino, one port will disappear from the list. That is your Arduino's COM port.
System configuration
System configuration
The hardware assignment for the flight simulator, mapping each aircraft system to its COM port and microcontroller type.
| System / function | COM port | Microcontroller |
|---|---|---|
| Autopilot | COM 3 | Mega |
| Radio | COM 4 | Mega |
| Throttle | COM 5 | UNO |
| Trim | COM 6 | UNO |
| Anti ice | COM 7 | UNO |
| Electrical | COM 8 | UNO |
| Engine | COM 9 | Micro CH340 |
| External lights | COM 10 | UNO |
| Right EFIS | COM 11 | Leonardo |
| Left EFIS | COM 12 | Leonardo |
| Status panel | COM 13 | UNO |
| Radio ident | COM 15 | UNO |
| Transponder | COM 16 | UNO |
| Flaps & spoiler | COM 17 | UNO |
| Leogen left | COM 25 | Leonardo |
Baud rate
Serial communication (baud rate)
Once the port is open, both the computer and the Arduino must agree on the speed of conversation, known as the baud rate (e.g. 9600 or 115200 bits per second). If these speeds do not match, the data transmitted over the COM port will look like gibberish.
Rate mismatch
x¿ñЦ¿§¬ñ¿x¤þØØ¤