In this article, we will cover how to connect any serial port (RS-232) device to your computer's USB port.
Originally, the COM port was the name of the serial port interface of IBM-PC compatible computers. While nowadays COM ports get less important for communication in favor for USB access, it is still in use as virtual ports, especially as communication protocol for maker boards, OBD2 car diagnostic tools and networking equipments.
Modern desktop or laptop computers no longer have built-in serial ports. However, if you need serial port communication (UART) between your computer and your electronic devices, simply plug a USB to RS232 converter into your computer.
Most of the time, Windows can install the USB converter driver automatically. In order to check the driver, start by going to the Device Manager. Once there, expand Ports (COM & LPT). Keep the COM port number assigned to the device by Windows, such as COM1, COM2, COM3, etc.
Device Manager is almost identical in Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10 and Windows 11. So you can find your COM port (console port) without any hassle.
A simple straight-through RS232 cable between your computer (terminal) and your electronic device will be fine. If you need PC-to-PC communication over serial port, you will need a "null modem" or "crossover" cable. For this to work, the Transmit (TX) pin of one device needs to be connected to the Receive (RX) pin of the other device, and vice versa. The RS-232 (DB9) pinout specifies that only the RX (receiver) and TX (transmitter) pins are necessary for communication. The rest of the pins are necessary only if you implement some form of hardware flow control.
On-board diagnostics (OBD) is an automotive term referring to a vehicle's self-diagnostic and reporting capability. OBD systems give the vehicle owner or repair technician access to the status of the various vehicle sub-systems. The amount of diagnostic information available via OBD has varied widely since its introduction in the early 1980s versions of on-board vehicle computers. Most cars and trucks are OBD-II compliant today.
OBD-II standard specifies the type of connector and its pinout. OBD-II pinout has 16 pins. The easiest way to get data from OBD-II is USB adapters like ELM327.
You can connect ELM327 adapter to your PC through USB, then the OBD-II socket to your car. It behaves as a COM port through your USB. You can begin retrieving data from your engine by sending AT commands using serial port software. OBD-II data protocols vary by car vendors and specs. You need to initialize your OBD-II device according to your car vendor and model.
OBD-II PIDs (parameter IDs) are codes used to request data from a vehicle, used as a diagnostic tool. The OBD commands are made up of hexadecimal codes written in ASCII characters. Usually, each value (speed, RPM, engine load, etc.) uses 4-digits hex number as identifier. You send the request with their identifier ID and it responds to you by its identifier ID.
Example:
Send command "010C"
Receive response "010C001B"
You can read more on the OBD PIDs functionality on Wikipedia. Some vehicle manufacturers also use their own proprietary parameters.
Using Vovsoft Serial Port Monitor, a simple port sniffer program, you can monitor and control any hardware compliant with RS-232 protocol, RS-485 protocol, RS-422 protocol or any other compatible serial port device. You can easily read incoming data from RX and send outgoing data to TX with the help of this serial port analyzer software. This application is an easy to use serial input/output monitor for students and electronic enthusiasts.
This software allows monitoring your computer's COM port data traffic. You can read data from any COM port and send data to any COM port. You can change connection parameters such as baud rate (bits per second), parity, data bits, stop bits and hardware flow control. This software can send and receive data in ASCII text. Hexadecimal, decimal, octal and binary formats are also supported when displaying received data. Sending text periodically is possible, you can change the interval in milliseconds. "Clear", "Save to file" and "Copy to clipboard" buttons can be used. Setting font and background color is possible by using the menu.