Skip to main content
Two campers parked in a pine forest at night with a small fire between them and silhouetted mountains beyond

Switchback

Eight relay channels and eight Picket-format digital inputs in one screw-mount module. Drive pumps, fans, and awnings on the outputs; watch doors, cabinets, and switches on the inputs. One module, two jobs.

Caution: high-voltage wiring

The relay outputs are rated up to 250 V AC and 30 V DC at 10 A. AC mains and high-current DC circuits can shock, burn, or start fires. If you are not comfortable wiring mains or a vehicle's high-current DC, hire a qualified electrician. Always disconnect power at the source before working on the relay terminals, install fuses or breakers sized below the relay rating on every load circuit, and verify your work with a meter before energizing.

Disclaimer. The information presented on this page, including all schematics, wiring diagrams, bills of material, assembly steps, and protocol references, is published by TrailCurrent, LLC for educational and informational purposes only. Nothing on this page constitutes professional engineering, electrical, or safety advice. The TrailCurrent hardware designs and firmware are provided "AS IS" and "AS AVAILABLE," without warranties of any kind, express or implied, including but not limited to merchantability, fitness for a particular purpose, non-infringement, or freedom from defects. To the maximum extent permitted by applicable law, TrailCurrent, LLC and its contributors disclaim all liability for any direct, indirect, incidental, special, consequential, or exemplary damages, including personal injury, property damage, vehicle damage, fire, data loss, or any other downstream effect arising from or related to your use of, or reliance on, this information. You assume full responsibility for verifying suitability for your application, complying with all applicable codes and regulations (including but not limited to electrical, RV, marine, automotive, and building codes), and obtaining any required permits or inspections. By using this information, you agree that TrailCurrent, LLC is not responsible for the outcome of your build or installation.

What's Inside  /  Module

The Relay & Input Module

Switchback runs on the Waveshare ESP32-S3-ETH-8DI-8RO-C: an ESP32-S3 carrier with eight 10 A relay outputs, eight optocoupler-isolated digital inputs, on-board CAN, Ethernet, and a finished plastic enclosure with four corner screw holes for floor or wall mounting. No custom PCB.

The eight relays are toggled over the TrailCurrent CAN bus, the same way Torrent's PWM channels are. The eight digital inputs broadcast back in the Picket message format, byte-for-byte identical, so Headwaters decodes them through the same path it already uses for Picket sensors. Up to three Switchback modules can share the bus, addressed individually.

ESP32-S3 ESP-IDF 8 Relays 8 Inputs CAN Bus Ethernet Screw-mount OTA
View on GitHub
Switchback module: black plastic enclosure with four corner mounting holes, green terminal blocks, and Waveshare ESP32-S3 ETH 8DI 8RO controller

At a Glance

What's inside the case and what comes out of the terminals.

Compute

Waveshare ESP32-S3-ETH-8DI-8RO-C, built around an ESP32-S3-WROOM-1U-N16R8 module. Dual–core Xtensa LX7 up to 240 MHz running pure C on ESP-IDF 5.x, with isolated on-board CAN, W5500 Ethernet, USB Type-C, an RTC with battery backup header, and a microSD (TF) card slot. 16 MB flash and 8 MB PSRAM, with dual OTA partitions for safe rollback.

Eight Relay Outputs

Eight independent relay channels, 1NO/1NC each, rated 10 A at 250 V AC or 10 A at 30 V DC. Toggle individually or all at once over the bus. Status broadcasts back at ~30 Hz so dashboards and other modules always know which channels are hot.

Eight Picket Inputs

Eight optocoupler-isolated digital inputs, debounced for 50 ms and broadcast at 5 Hz in the Picket message format. Wire dry-contact reed switches between each input and DGND. The board's internal isolated rail biases the optocouplers, so no external supply is needed.

Bill of Materials

One off-the-shelf board, the connectors of your choice, and any sensors you want to wire to the inputs.

Qty Part Description Source
1 Waveshare ESP32-S3-ETH-8DI-8RO-C Pre-housed industrial controller built around an ESP32-S3-WROOM-1U-N16R8 module (16 MB flash, 8 MB PSRAM). Eight relay outputs (TCA9554PWR I2C expander driving 1NO/1NC relays rated ≤10 A 250 V AC or ≤10 A 30 V DC), eight optocoupler-isolated digital inputs, on-board isolated CAN with a 120 ohm matching resistor (NC by default, enabled via jumper), W5500 10/100 Mbps Ethernet over SPI, USB Type-C, PCF85063ATL RTC with battery header, microSD (TF) card slot, buzzer, and WS2812 RGB LED on GPIO38. Includes an external 2.4 GHz SMA antenna for WiFi and Bluetooth in the box. Black plastic enclosure with four corner mounting holes. 7–36 V DC input. Waveshare
Varies Insulated Wire Ferrules Crimp one ferrule onto every stripped wire end before landing it in a Waveshare screw terminal. Count depends on how many relay channels and inputs you wire: figure roughly three per relay channel (NO, COM, NC), one per digital input plus the shared DGND, two for power, and three for the CAN H/L/G trio. An assorted kit covering 20 AWG to 14 AWG (0.5–2.5 mm²) handles every wire size on the board. Keeps stranded wire from fraying or backing out under vibration. Hardware store / Amazon
0–8 Reed Switches (or other dry contacts) Magnetic reed switches for door and cabinet sensing, or any other normally-open dry contact. One leg to DIn, other leg to DGND. No external supply required. Hardware store
4 Mounting Screws or Bolts Length varies with the install. Four screws or bolts pass through the four 4.5 mm corner mounting holes in the Waveshare case to attach Switchback to a wall or the floor of an equipment bay. M4 machine screws fit cleanly through the holes; #8 wood or sheet-metal screws also work for plywood or thin steel. Match the type and length to your mounting surface, and leave clearance below the unit for the input terminals and above for the output terminals. Hardware store

No 3D printed enclosure for Switchback. The Waveshare board ships pre-housed in a finished plastic case with four corner screw holes. Mount it to a wall, the floor of an equipment bay, or any flat surface in the rig.

Hardware

One board does it all. Power, CAN, Ethernet, eight relays, and eight inputs in a single screw-mount enclosure.

Switchback wiring diagram: relay outputs across the top, digital inputs across the bottom, CAN, power, USB-C, and Ethernet on the side

MCU Module

ESP32-S3-WROOM-1U-N16R8: dual–core Xtensa LX7 up to 240 MHz, 16 MB flash, 8 MB PSRAM, 2.4 GHz WiFi and Bluetooth LE. Relays are driven through a TCA9554PWR I2C I/O expander at address 0x20 on SDA=GPIO42, SCL=GPIO41. Digital inputs land on GPIO 4–11. CAN TX/RX on GPIO 17/18, WS2812 RGB status LED on GPIO 38, buzzer on GPIO 46.

Power

7–36 V DC into the 7–36V screw terminal pair, or 5 V over USB-C for bench work. The board's wide-input regulator feeds the ESP32-S3, the I/O expander, the Ethernet PHY, and the relay coils, so there's only one power path in the whole module.

Eight Relay Outputs

Eight 1NO/1NC mechanical relays rated 10 A at 250 V AC or 10 A at 30 V DC. Wired through the green top-row terminal blocks as NO, COM, NC per channel, with each channel galvanically independent. Mixing AC and DC across channels on one unit is electrically supported but not recommended; for serious mixed installs, dedicate one Switchback to vehicle DC loads and a second to AC. Status bitmask broadcasts on the bus at ~30 Hz so dashboards stay in sync.

Eight Digital Inputs

Eight optocoupler-isolated inputs on the bottom-row terminals (DI1–DI8 + DGND). Connect each NO reed switch between its DIn terminal and DGND; the board biases the optocoupler LEDs from its internal isolated rail. State is debounced for 50 ms and published in Picket format at 5 Hz.

CAN Interface

On-board isolated CAN with an onboard 120 ohm matching resistor that's NC (open) by default and enabled via a jumper for end-of-bus installs. 500 kbps, no-ACK mode, standard 11-bit identifiers. Wired through the CAN H/L/G terminal block into the same TrailCurrent bus that carries Headwaters, Torrent, Bearing, and the rest.

Ethernet & WiFi

W5500 10/100 Mbps Ethernet over SPI for installs that want wired connectivity, plus 2.4 GHz WiFi and Bluetooth LE from the WROOM-1U module. Wireless signals exit through the external 2.4 GHz SMA antenna that ships with the Waveshare board, so it has to be threaded onto the case's SMA bulkhead before WiFi will work. WiFi credentials can be pushed to the device over CAN, no portal or app required.

Assembly

No soldering, no enclosure to print. Flash it on the bench, screw the case to a wall or the floor of an equipment bay, wire the terminals.

  1. 1

    Pick an address

    Up to three Switchback modules can share the same CAN bus. Decide whether this one is address 0, 1, or 2 before you flash. The address determines which CAN IDs the module talks on (0x12 / 0x13 / 0x14 for input broadcasts, 0x25 / 0x26 / 0x27 for relay toggles, 0x28 / 0x29 / 0x2A for relay status).

  2. 2

    Flash the firmware

    On the bench, plug the Waveshare board into USB-C and flash the matching Switchback variant straight from your browser using the TrailCurrent Flasher. After the first flash, all future updates happen over the air via WiFi triggered through the CAN bus.

  3. 3

    Mount the case

    The Waveshare housing has four corner mounting holes. Pick a flat spot in an equipment bay, a closet wall, or under a bench, and run four screws through the corners into the surface. Leave a few inches of clearance below the unit for the input terminals and above for the output terminals.

  4. 4

    Attach the antenna

    Thread the 2.4 GHz SMA antenna that ships in the Waveshare box onto the SMA female bulkhead on the case before powering up. The WROOM-1U module has no on-module ceramic antenna, so without this antenna in place the module never reaches WiFi, Bluetooth, OTA, or mDNS.

  5. 5

    Wire power and CAN

    Land 12 V positive and ground on the 7–36V screw terminal pair. Wire CAN H and CAN L into the CAN H/L/G block. If Switchback is the last node on the bus, set the on-board termination jumper.

  6. 5

    Wire the loads

    Run the load circuits through the NO/COM pair on each relay channel. Pumps, fans, awning motors, slide-out actuators, exterior lighting. Up to 10 A per channel, wired to whatever DC or AC supply they expect. Each channel is independent.

  7. 6

    Wire the inputs

    For each Picket input you want to use, run a two-conductor lead to the sensor. One leg to the matching DIn terminal, the other leg to DGND. Reed switches, limit switches, hood pins, anything that closes a dry contact. No external supply required. The board provides isolated bias internally.

  8. 7

    Power it up

    Apply 12 V. The RGB LED on the front shows boot status, the relays click into their default states, and the digital inputs start broadcasting at 5 Hz. Headwaters discovers Switchback automatically over mDNS as _trailcurrent._tcp and lights up its tile in the dashboard.

Top-down view of the Switchback module showing relay output terminals, channel labels, and digital input row

CAN Protocol

Five message types: relays in, relays out, inputs out, plus OTA and WiFi config.

ID Direction Name Description
0x00 RX OTA Trigger 3-byte payload (last 3 bytes of the device MAC). Puts the addressed Switchback into OTA mode and exposes an HTTP endpoint over WiFi for the firmware upload.
0x01 RX WiFi Config Multi-message chunked protocol (start → SSID chunks → password chunks → end with XOR checksum) to provision WiFi credentials over the bus and persist them to NVS.
0x12 + addr TX Digital Input Broadcast 2-byte Picket-format frame (byte 0 = DI1–DI8 bitmask, byte 1 = 0x00) at 5 Hz. Identical wire format to PicketStatus0..7, so Headwaters decodes it through the same path as Picket modules.
0x25 + addr RX Relay Toggle Toggle a single relay (channel 0–7) or set all relays at once (channel ≥ 8, byte 2 carries on/off).
0x28 + addr TX Relay Status Broadcast 1-byte bitmask (bits 0–7 = relay channel states), broadcast at ~30 Hz so dashboards and other modules can stay in sync.

Multi-Instance Addressing

Up to three Switchback modules share one bus. Each module is built with a unique SWITCHBACK_ADDRESS (0, 1, or 2) that offsets every CAN ID, so a galley Switchback and a cargo-bay Switchback can coexist without stepping on each other.

OTA Over CAN

Broadcast CAN ID 0x00 with Switchback's last three MAC bytes and it joins WiFi, spins up an HTTP server, and accepts an app-only firmware image. It writes to the inactive OTA slot and reboots; if anything fails, it rolls back on its own.

mDNS Self–Discovery

Switchback advertises itself over mDNS as _trailcurrent._tcp with its type, address, and firmware version. Headwaters scoops that up to inventory every module on the bus automatically. No manual configuration in the dashboard.

Build Your Own Switchback

Every file is in the repository: ESP-IDF firmware, the build-all script for all three address variants, the CAN protocol spec, and the wiring diagram. Fork it, build it, make it yours.

Switchback on GitHub