Skip to content
Resources

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:

  1. aIdentify the port: in the Arduino IDE, navigate to Tools › Port. You will usually see a list of available ports.
  2. 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 / functionCOM portMicrocontroller
AutopilotCOM 3Mega
RadioCOM 4Mega
ThrottleCOM 5UNO
TrimCOM 6UNO
Anti iceCOM 7UNO
ElectricalCOM 8UNO
EngineCOM 9Micro CH340
External lightsCOM 10UNO
Right EFISCOM 11Leonardo
Left EFISCOM 12Leonardo
Status panelCOM 13UNO
Radio identCOM 15UNO
TransponderCOM 16UNO
Flaps & spoilerCOM 17UNO
Leogen leftCOM 25Leonardo
2× Mega, 9× UNO, 1× Micro CH340, 3× 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.

Serial.begin() in sketch
Serial Monitor

Rate mismatch

x¿ñЦ¿§¬ñ¿x¤þØØ¤