Skip to main content

Configuring Serial Communication

Serial communication is often required when interfacing lab machines with a computer. This guide explains how to properly configure and troubleshoot serial connections on both Windows and Ubuntu.

πŸͺŸ Windows Setup​

1. Identify Your Cable Type​

  • Direct serial (DB9 to DB9): No drivers typically required.
  • USB to Serial: Requires a driver based on the cable chipset (Prolific, FTDI, CH340, etc.).

2. Install the Correct Drivers​

🧰 Option A: Automatic via Windows Update​

  • Plug in the USB-to-Serial cable.
  • Windows may automatically find and install a compatible driver.

🧰 Option B: Manual Installation​

If Windows doesn't install the correct driver:

πŸ’‘ After installation, check Device Manager under β€œPorts (COM & LPT)” to confirm the COM port number.

🐧 Ubuntu Setup​

Ubuntu supports most serial-to-USB adapters out of the box β€” no driver installation required.

1. Grant Access to Serial Ports​

Add your user to the dialout group with:

sudo usermod -a -G dialout $USER

Then log out and log back in or reboot for the change to take effect.

2. Verify the Serial Device​

Check the connection with:

ls /dev/ttyUSB*

or

dmesg | grep tty

πŸ’‘ Typical device names: /dev/ttyUSB0 or /dev/ttyS0

πŸ§ͺ Testing the Connection (Windows)​

Use Hercules SETUP Utility β€” a free and reliable tool for testing serial and network communication on Windows.

πŸ”§ Steps:​

  1. Download Hercules
  2. Launch the app β€” no installation required.
  3. Go to the Serial tab.
  4. Select your COM port and set baud rate (e.g., 9600).
  5. Click Open to start the connection.
  6. Use the input box to send commands and view responses in the log window.

πŸ’‘ Make sure the serial device is connected before launching Hercules.

πŸ“· Screenshot:​

Hercules Serial Tab
Image Source: HW Group

πŸŽ₯ Live Demo:​

Watch a Hercules Demo on YouTube

βœ… Tips & Troubleshooting​

  • Always match baud rate, stop bits, data bits, and parity to your device settings.
  • Restart apps after switching ports or replugging the cable.
  • Avoid using hubs or extenders when troubleshooting β€” plug the cable directly into the computer.
  • If you're unsure of your cable’s chipset, use Windows Device Manager to check under Ports (COM & LPT).