openCAN is an open source firmware platform for working with vehicle CAN bus networks. It can sit on the bus as a node, reading and injecting messages, or inline as a man-in-the-middle, filtering and rewriting traffic in real time. Built on the 32-bit SAMD21, programmable through the Arduino IDE, with fully open source firmware.
- ✅ 8 Digital Outputs
- ✅ 6 Analog Inputs
- ✅ Dual MCP2515 CAN Controllers
- ✅ 32-bit Microcontroller (ATSAMD21G)
openCAN can operate as a gateway or man-in-the-middle (MITM) device on the CAN bus, intercepting, filtering, and modifying CAN messages in real time. This allows for creative applications in automotive systems, retrofits, and diagnostics.
Example Use Cases
Bridge a donor engine's CAN messages to a chassis that expects a different format:
- Read RPM, coolant temp, oil pressure, and other signals from the engine-side CAN bus
- Repackage them into the message IDs and formats the chassis cluster expects
- Factory gauges, warning lights, and chimes work correctly without cluster modification or a standalone digital dash
Use coolant temperature data from the CAN bus to:
- Generate a PWM output signal
- Drive an electric fan based on temperature profile
Generate a VSS (vehicle speed signal) for a swapped engine, transmission, or ECU:
- Read output shaft speed sensor, speed sensor pulses, or ABS speed data
- Calculate vehicle speed based on tire size and final drive ratio
- Output a corrected speed signal (CAN message or pulse output) for the ECU, cluster, and cruise control to use
Display oil temperature on the coolant temp gauge:
- Read oil temp from CAN Bus A
- Rewrite it as coolant temp on CAN Bus B
- Toggle the mode with an existing switch (e.g., cruise control cancel)
Read an ethanol content sensor and make fueling decisions in real time:
- Read frequency output from a flex fuel sensor on a digital input
- Calculate ethanol percentage and fuel temperature
- Broadcast the values as a custom CAN message for the ECU or a digital dash to consume
- Optionally trigger a relay output (e.g. enable a secondary fuel pump or water/meth injection) above a set ethanol percentage
Use live RPM data from the CAN bus to fire outputs at specific thresholds:
- Read engine RPM from the powertrain CAN bus
- Trigger a relay output above a set RPM (shift light, exhaust valve, anti-lag solenoid)
- Combine with throttle position or clutch switch input for launch control or 2-step style logic
Add protection the donor ECU doesn't provide on a swapped platform:
- Monitor oil pressure switch and coolant temp sender on analog inputs
- If oil pressure drops or coolant temp exceeds a threshold, trigger a relay output (warning light, fuel pump cutoff, fan to max)
- Runs independently of the ECU, so it works even if the donor ECU has no concept of the new chassis's sensors
Microcontroller: ATSAMD21G
| CAN Bus | CS Pin | INT Pin |
|---|---|---|
| CAN1 | D10 | D2 |
| CAN2 | D11 | D3 |
All 8 digital output channels are NPN switch-to-ground stages (MMBT2222A). openCAN pulls the output node high through a base/collector resistor, and the SAMD21 GPIO drives the transistor base, pulling the output low when active. D0, D1, and D4–D7 are the six low-amp output control channels. D8 and D9 are sized for relay coil drive. (D2 and D3 are reserved as the CAN controller interrupt lines.)
| Pin | Driver | Resistor | Function |
|---|---|---|---|
| D0 | Q1 (MMBT2222A) | R1 (1k) | Low-amp output control |
| D1 | Q2 (MMBT2222A) | R20 (1k) | Low-amp output control |
| D4 | Q3 (MMBT2222A) | R4 (1k) | Low-amp output control |
| D5 | Q4 (MMBT2222A) | R10 (510) | Low-amp output control |
| D6 | Q5 (MMBT2222A) | R11 (510) | Low-amp output control |
| D7 | Q6 (MMBT2222A) | R17 (1k) | Low-amp output control |
| D8 | Q7 (MMBT2222A) | R18 (1k) | Relay control via ground switch |
| D9 | Q8 (MMBT2222A) | R19 (1k) | Relay control via ground switch |
| Pin | Resistors | Function |
|---|---|---|
| A0 | R2 (1k pull-up to 3.3V) | Resistive sensor input (e.g. fuel/temp senders) |
| A1 | R3 (1k pull-up to 3.3V) | Resistive sensor input (e.g. fuel/temp senders) |
| A2 | R13/R14 (1k pull-up to 3.3V) | Switch-to-ground input |
| A3 | R15/R16 (1k pull-up to 3.3V) | Switch-to-ground input |
| A4 | R22 (4.7k) / R23 (2.2k to GND) | 0-5V analog sensor input, ~1.6V at pin for 5V signal |
| A5 | R21 (4.7k) / R24 (2.2k to GND) | 0-5V analog sensor input, ~1.6V at pin for 5V signal |
- Download and install the Arduino IDE from arduino.cc/en/software
- Open the IDE. Go to File → Preferences.
- Paste the following URL into the Additional Boards Manager URLs field:
https://raw.githubusercontent.com/two-7/openCAN/main/package_two7_index.json - Go to Tools → Board → Boards Manager.
- Search for openCAN SAMD21 Boards and install the package.
- Plug the openCAN board into the computer.
- Go to Tools → Port and select the COM port openCAN is connected to.
- Go to Tools → Board → openCAN SAMD21 Boards → openCAN.
- Go to Tools → Serial Monitor.
- In the Serial Monitor pane, set the line ending to New Line and the baud rate to 500000.
- Live openCAN data streams to the Serial Monitor, refreshing once per second.

