Component guide · Intermediate · 4 min read
Raspberry Pi RS485, CAN and Serial HATs

Waveshare Isolated RS485 CAN, 2-Ch RS485, 2-Ch CAN and CAN FD, RS232, DFRobot RS485 and Serial Expansion
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
These HATs connect a Raspberry Pi to industrial buses. RS485 talks Modbus RTU to meters, sensors and PLCs; CAN and CAN FD talk to vehicles, motor drivers and robot joints; RS232 reaches older machines. Isolated versions protect the Pi from ground loops and surges on long cables. Most use an SC16IS752 UART chip or MCP2515 / MCP2518FD CAN controller over SPI.
Key specs at a glance
- Buses
- RS485, RS232, CAN 2.0, CAN FD
- Channels
- 1 or 2 per HAT
- Chips
- SC16IS752 UART, MCP2515, MCP2518FD
- Isolation
- Isolated power and signals on isolated versions
- Speed
- RS485 up to about 1 Mbit/s; CAN 1 Mbit/s; CAN FD 5 Mbit/s data
- Interface
- SPI or UART to the Pi
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Waveshare Isolated RS485 CAN HAT (B) for Raspberry Pi₹2,229
Option 2Waveshare 2-Channel Isolated RS485 HAT₹1,609
Option 3DFRobot Dual-channel Isolated RS485 HAT for Raspberry Pi₹2,409
Option 4Waveshare Isolated RS485/RS232 HAT for Raspberry Pi, SPI₹1,719
Option 5Waveshare Isolated RS232/RS485/CAN/CAN FD HAT for Raspberry Pi₹5,770
Option 6Waveshare 2-Ch Isolated CAN Bus HAT for Raspberry Pi₹2,459
What the Raspberry Pi RS485, CAN and serial expansion HATs is
Raspberry Pi RS485 and CAN HATs add isolated or non-isolated RS485 and CAN bus ports, letting a Pi talk Modbus to meters and PLCs or read CAN data from vehicles and machines.
CAN boards use SocketCAN: add the mcp2515 or mcp251xfd overlay, bring up can0 and use candump and cansend. RS485 boards appear as /dev/ttySC0 or /dev/ttyS0 with automatic direction control.
Terminate both ends of a bus with 120 ohm resistors; most HATs have a jumper for this.
Raspberry Pi RS485, CAN and serial expansion HATs pinout
The pins on the Raspberry Pi RS485, CAN and serial expansion HATs and what each one does.
| Pin | Function |
|---|---|
| A+ / B- | RS485 differential pair |
| CAN_H / CAN_L | CAN bus pair |
| GND / isolated GND | Reference for the bus |
| SPI + INT | SC16IS752 or CAN controller to the Pi |
| 120R jumper | Bus termination |
- A+ / B-
- RS485 differential pair
- CAN_H / CAN_L
- CAN bus pair
- GND / isolated GND
- Reference for the bus
- SPI + INT
- SC16IS752 or CAN controller to the Pi
- 120R jumper
- Bus termination
Wiring the Raspberry Pi RS485, CAN and serial expansion HATs
Check the oscillator value printed on the CAN chip (8, 12 or 16 MHz) and use it in the overlay. Swapping A and B on RS485 is the most common no-data fault.
| Raspberry Pi RS485, CAN and serial expansion HATs pin | Connection | Note |
|---|---|---|
| RS485 | A+ to A+, B- to B- on the device | Twisted pair, terminate both ends |
| CAN | CAN_H to CAN_H, CAN_L to CAN_L | 120 ohm at each end |
| Ground | Connect GND on long runs | Isolated HATs prevent ground loops |
- RS485
- Connection:
- A+ to A+, B- to B- on the device
- Note:
- Twisted pair, terminate both ends
- CAN
- Connection:
- CAN_H to CAN_H, CAN_L to CAN_L
- Note:
- 120 ohm at each end
- Ground
- Connection:
- Connect GND on long runs
- Note:
- Isolated HATs prevent ground loops
Example code
Overlays: dtoverlay=sc16is752-spi1,int_pin=24 for SC16IS752 RS485 HATs and dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25 for MCP2515 CAN HATs. Check each board's wiki for the exact pins.
# pip install minimalmodbus
import minimalmodbus
dev = minimalmodbus.Instrument("/dev/ttySC0", 1) # port, slave address
dev.serial.baudrate = 9600
dev.serial.timeout = 1
temp = dev.read_register(0, 1) # register 0, one decimal
print("Temperature:", temp)
# CAN test from the shell:
# sudo ip link set can0 up type can bitrate 500000
# candump can0Setup and tuning
enable the SPI CAN controller (MCP2515) overlay with the right oscillator value in config.txt.
bring the interface up with ip link set can0 up type can bitrate 500000.
use the HAT's UART with automatic direction control, or toggle DE/RE in code.
set 120 Ω termination jumpers at bus ends.
choose isolated HATs for industrial and vehicle use.
What you need
Shop this list12 of 12 found in our store · ₹32,440
Waveshare Isolated RS485 CAN HAT (B) for Raspberry Pi: the part this guide coversWaveshare Isolated RS485 CAN HAT (B) for Raspberry Pi₹2,229
Waveshare 2-Channel Isolated RS485 HAT: another version this guide coversWaveshare 2-Channel Isolated RS485 HAT₹1,609
DFRobot Dual-channel Isolated RS485 HAT for Raspberry Pi: another version this guide coversDFRobot Dual-channel Isolated RS485 HAT for Raspberry Pi₹2,409
Waveshare Isolated RS485/RS232 HAT for Raspberry Pi, SPI: another version this guide coversWaveshare Isolated RS485/RS232 HAT for Raspberry Pi, SPI₹1,719
Waveshare Isolated RS232/RS485/CAN/CAN FD HAT for Raspberry Pi: another version this guide coversWaveshare Isolated RS232/RS485/CAN/CAN FD HAT for Raspberry Pi₹5,770
Waveshare 2-Ch Isolated CAN Bus HAT for Raspberry Pi: another version this guide coversWaveshare 2-Ch Isolated CAN Bus HAT for Raspberry Pi₹2,459
Waveshare 2-Ch Isolated CAN HAT for Raspberry Pi: another version this guide coversWaveshare 2-Ch Isolated CAN HAT for Raspberry Pi₹1,939
Waveshare Serial Expansion HAT for Raspberry Pi: another version this guide coversWaveshare Serial Expansion HAT for Raspberry Pi₹1,153
Raspberry Pi GPIO UART HAT V1.0: another version this guide coversRaspberry Pi GPIO UART HAT V1.0₹769
Raspberry Pi 4 Model B (4 GB): the most common HAT hostRaspberry Pi 4 Model B with 4GB RAM₹11,461Closest match, check the specs
Raspberry Pi 5 (4 GB): runs the modem, bus or GNSS softwareRaspberry Pi 5 RTC Battery (Rechargeable, JST)₹149Closest match, check the specs
Waveshare industrial USB to RS485 converter: to test the bus from a PCWaveshare Industrial USB to RS485 Bidirectional Converter, CH343G₹774Closest match, check the specs
Alternatives and when to choose them
- MAX485 module: for Arduino and ESP32.
- MCP2515 CAN module: CAN for microcontrollers.
- USB to RS485: no HAT needed.
Common mistakes to avoid
- Wrong oscillator value in the overlay.
- Missing termination.
- Non-isolated HATs on noisy buses.
- Transmitting on a car CAN bus blindly.
Frequently asked questions
How do I enable CAN on a Raspberry Pi?
Add the mcp2515 overlay with the correct oscillator, then bring up can0.
Why do I get no CAN messages?
The bitrate, the oscillator value in the overlay, or the termination is wrong.
Can I read Modbus energy meters?
Yes. Use RS485 with Python libraries such as pymodbus or minimalmodbus.
Do I need isolation?
Yes for industrial or vehicle buses, to protect the Pi.
Can I sniff my car's CAN bus?
Yes, via OBD-II, but never transmit on a vehicle bus unless you know the effects.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

