Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hardware Wiring: CAN Transceiver Breakout Setup

This section walks you through physically wiring an ESP32 to a CAN transceiver breakout board, ready to connect to your LCC network.

What You’ll Need

  • ESP32 DevKit (same as Chapter 3)
  • CAN Transceiver Breakout Board (SN65HVD230 or MCP2551 based, with 6-pin header)
  • RJ-45 breakout board (for connecting to your LCC bus via Cat-5e/Cat-6 cabling)
  • Jumper wires (22 AWG, solid core) — a set of 6 for ESP32 to CAN breakout, plus 3 from CAN breakout to RJ-45 breakout

Breakout Board Header Pinout

CAN transceiver breakout boards provide a standard 6-pin header interface:

PinFunctionESP32 Connection
VCC (3.3V)Power3.3V rail
GNDGroundGND rail
CRX (CAN RX)Receive signalGPIO4
CTX (CAN TX)Transmit signalGPIO5
CANHCAN high lineTo RJ-45 breakout
CANLCAN low lineTo RJ-45 breakout

Wiring

The CAN transceiver breakout board connects directly to your ESP32 with six jumper wires, then to an RJ-45 breakout board for your LCC bus connection.

Visual reference:

ESP32 with CAN Breadboard Layout

CAN Transceiver to RJ-45 Breakout (LCC Bus):

CAN TransceiverRJ-45 Breakout PinLCC Signal
CANLPin 1CANL
CANHPin 2CANH
GNDPin 3CAN_GND
GNDPin 6CAN_SHIELD

Ground connection: For learning, you can rely on USB providing a common ground. For a production or multi-device setup, also connect the breakout’s GND to both the LCC bus GND (RJ-45 Pin 3) and CAN_SHIELD (RJ-45 Pin 6) via the same RJ-45 connector.

Bus Topology and Termination

The CAN bus is a linear topology (not a star). Devices are chained in a line, with termination at the physical ends:

graph LR
    A["RR-CirKits LCC Power-Point<br/>(120Ω terminator added)"] -->|CANH, CANL| B["RR-CirKits LCC Buffer-USB"]
    B -->|CANH, CANL| C["Your ESP32 Node<br/>(120Ω terminator added)"]

Critical: Terminating resistors go at the physical ends of the bus, not in the middle. You need exactly one 120Ω terminator at each end. Extra termination in the middle causes signal reflections and errors.

Which Transceiver Includes Termination?

TransceiverBuilt-in TerminationWhen to Use
SN65HVD230No (external 120Ω required)You’re adding nodes in the middle of a bus
MCP2551Yes (built-in 120Ω)You’re a single node at the end of a bus

For this section: If your ESP32 is a standalone node (one transceiver on the bus), the MCP2551 saves you the hassle of adding a resistor. If you’re building a multi-node setup later, the SN65HVD230 gives you full control. Either choice works fine—pick what suits your immediate needs.

Important: Never put multiple transceivers with termination on the same bus (whether built-in or external). Termination belongs only at the physical ends.

Next: Let’s modify the code to use CAN instead of WiFi.