To successfully connect Raspberry Pi COM devices operating on industrial RS-485 protocols, you must bridge the Pi's 3.3V TTL UART to the sensor's differential signaling using an optically isolated RS-485 HAT. For a standard Raspberry Pi 5, the direct answer is to use a board like the Waveshare 2-CH RS485 HAT, wire it to the primary UART on GPIO 14 (TXD) and GPIO 15 (RXD), and route the differential A/B lines to your sensor with a shared ground and 120-ohm termination. This guide walks through the exact schematic, terminal mappings, and bench-verification steps to get your Modbus or serial sensors online without frying your Pi's GPIO bank.

Decoding the Diagram Symbols and Physical Terminals

Before stripping wires, you need to translate the schematic symbols into the physical terminal blocks on your desk. In a standard RS-485 wiring diagram for embedded systems, you will encounter four primary symbol groups:

  • UART TX/RX: Represented by single-ended lines labeled TXD (Transmit Data) and RXD (Receive Data). On the physical HAT, these are usually routed via jumper pins or directly hardwired to the 40-pin header.
  • Differential Pair (A/B or D+/D-): Shown as two parallel lines, sometimes with a '+' and '-' or 'A' and 'B' designator. On the physical device, these are the green screw-terminal blocks. Crucial note: Some manufacturers label the non-inverting line as 'A' and the inverting as 'B', while others flip this. Always check the transceiver datasheet (e.g., MAX3485) to confirm polarity.
  • 120Ω Termination Resistor: Depicted as a standard zig-zag resistor symbol bridging the A and B lines, often with a jumper or DIP switch symbol next to it. Physically, this is a small 3-pin header with a jumper cap on the HAT.
  • Opto-isolator / Galvanic Isolation: Shown as a box with a light beam or transformer symbol between the Pi-side logic and the sensor-side transceiver. This physically separates the Pi's ground plane from the industrial sensor's ground plane.
Callout Tip: Terminal Block Identification
On the physical Waveshare 2-CH HAT, the green terminal block is numbered 1 through 5 for Channel 1. From left to right, the physical terminals are: 1: 5V, 2: GND, 3: A (RS485_A), 4: B (RS485_B), and 5: GND (Isolated). Always use the isolated GND (Terminal 5) for your sensor ground, never the Pi-side GND (Terminal 2).

Terminal and Pin Mapping Table

Use this spec-sheet-table to map the Raspberry Pi 5 GPIO to the HAT, and the HAT to the industrial sensor. Wire colors listed are standard 22 AWG stranded recommendations for breadboarding and terminal crimping.

Signal / Function Raspberry Pi 5 Pin (BCM) HAT Terminal / Jumper Sensor Terminal Recommended Wire Color
5V Power Pin 2 (5V) Terminal 1 (VCC) Sensor VCC / Vin Red
Pi Logic Ground Pin 6 (GND) Terminal 2 (GND) N/A (Do not connect to sensor) Black
UART TXD Pin 8 (GPIO 14) RXD Jumper Pin N/A (Internal to HAT) Yellow (via jumper)
UART RXD Pin 10 (GPIO 15) TXD Jumper Pin N/A (Internal to HAT) Orange (via jumper)
RS-485 A (Non-inverting) N/A Terminal 3 (A) Sensor A / D+ Green
RS-485 B (Inverting) N/A Terminal 4 (B) Sensor B / D- White
Isolated Sensor Ground N/A Terminal 5 (Iso GND) Sensor GND Blue

Node-by-Node Trace: Power, Data, and Ground Paths

A schematic is useless if you cannot trace the physical current and signal paths. Here is the exact node-by-node trace from the Raspberry Pi source to the industrial sensor load.

Trace 1: 5V Power Delivery

  1. Node 1: Raspberry Pi 5V rail (Physical Pin 2) outputs 5.1V DC.
  2. Node 2: Enters the HAT at Terminal 1 (VCC).
  3. Node 3: Passes through the HAT's onboard DC-DC isolation module (e.g., B0505S-1WR3), which steps and isolates the voltage.
  4. Node 4: Emerges on the isolated side to power the MAX3485 transceiver IC and provides up to 100mA to the sensor via the sensor's VCC pin.

Trace 2: Ground and Equipotential Bonding

Safety Callout: When wiring industrial panels, ensure the main panel chassis is bonded to earth ground. The RS-485 isolated ground must NOT be bonded to the Pi's earth-referenced ground.

  1. Node 1: Pi GND (Physical Pin 6) connects to HAT Terminal 2. This completes the primary logic circuit for the Pi's UART.
  2. Node 2: The isolation barrier breaks the physical copper path. There is no DC continuity between Terminal 2 and Terminal 5.
  3. Node 3: HAT Terminal 5 (Isolated GND) connects to the Sensor GND. This provides a local common-mode reference for the differential pair, preventing the transceiver's common-mode voltage range (-7V to +12V) from being exceeded.

Trace 3: UART to Differential Conversion

  1. Node 1: Pi GPIO 14 (TXD) sends 3.3V TTL logic high/low.
  2. Node 2: Signal crosses the optocoupler (e.g., TLP281) via light emission, protecting the Pi from voltage spikes.
  3. Node 3: The isolated logic signal hits the RO/DI pins of the RS-485 transceiver IC.
  4. Node 4: The transceiver drives the A and B terminals. When Pi TXD is HIGH, Terminal A goes high (~5V) and Terminal B goes low (~0V).

Verifying Each Connection with a Multimeter

Do not plug the Pi into mains power until you have verified the physical layer. Set your digital multimeter (DMM) to the following modes to validate the wiring.

Step 1: De-energized Continuity (DMM in Continuity/Beeper Mode)
  • Probe Pi Pin 6 to HAT Terminal 2: Must read < 1 ohm (beep).
  • Probe HAT Terminal 2 to HAT Terminal 5: Must read OL (Open Loop). If it beeps, your isolation barrier is blown or jumpered incorrectly.
  • Probe HAT Terminal 3 to Sensor A: Must read < 1 ohm.
Step 2: Energized Idle Voltage (DMM in DC Voltage Mode, Pi Booted, Serial Port Open)
  • Probe HAT Terminal 1 (Red) to Terminal 2 (Black): Should read 5.0V to 5.2V.
  • Probe HAT Terminal 3 (A) to Terminal 5 (Iso GND): Should read between 2.5V and 5.0V (idle bias voltage).
  • Probe HAT Terminal 4 (B) to Terminal 5 (Iso GND): Should read between 0V and 2.5V.
Step 3: Checking Termination Resistance (DMM in Ohms Mode, De-energized)
  • With the jumper installed on the HAT's 120Ω header, probe across Terminal 3 (A) and Terminal 4 (B). You should read exactly 120Ω (±5%). If you read 60Ω, you have two termination resistors active on the same bus (one at the Pi, one at the sensor). Remove one.

Decision Tree: Selecting Your COM Interface Hardware

Not all COM devices use RS-485. Use this decision-tree-table to select the correct physical interface for your specific sensor or peripheral. Follow the 'If' conditions down to your concrete hardware pick.

If your sensor uses... And the environment is... Required Interface Type Concrete Hardware Pick (2026)
3.3V TTL UART (TX/RX/GND) Clean bench, < 1 meter cable Direct GPIO Wiring Standard Dupont jumper wires (No HAT needed)
RS-232 (DB9 connector) Indoor, legacy lab equipment TTL to RS-232 Level Shifter Waveshare 2-CH RS232 HAT (MAX3232 based)
RS-485 / Modbus RTU Industrial, noisy, > 15 meters, outdoor Isolated RS-485 Transceiver Waveshare 2-CH RS485 HAT (Default Pick)
CAN Bus (NMEA 2000 / OBD2) Automotive or marine environments Isolated CAN Controller Waveshare 2-CH CAN HAT (MCP2515 based)

For the vast majority of makers and field engineers looking to connect Raspberry Pi COM devices to modern industrial sensors (soil moisture, weather stations, power meters), the Waveshare 2-CH RS485 HAT is the definitive choice. It provides the necessary galvanic isolation to protect your Pi 5 from ground loops and inductive kicks, while natively supporting the 3.3V logic levels of the BCM2712 processor without requiring external level shifters. Ensure you disable the Bluetooth UART overlay in /boot/firmware/config.txt by adding dtoverlay=disable-bt to free up the primary PL011 UART for your COM device, and you will have a rock-solid serial link ready for Python or C++ polling.