Hardware Setup Guide
Required Components
- Arduino Uno (or compatible board)
- MCP2515 CAN Bus Module with TJA1050 transceiver
- OBD-II male connector (for vehicle connection)
- Jumper wires for connections
- USB cable to connect Arduino to computer
Step 1: Connect Arduino to MCP2515 Module
Wire the MCP2515 CAN Bus module to your Arduino Uno using the SPI interface:
| Arduino Uno Pin | MCP2515 Pin | Function |
|---|---|---|
| Pin 2 | INT | Interrupt (optional) |
| Pin 10 | CS | Chip Select |
| Pin 11 | SI (MOSI) | Data Input |
| Pin 12 | SO (MISO) | Data Output |
| Pin 13 | SCK | Clock Signal |
| GND | GND | Ground |
| 5V | VCC | Power Supply |
Step 2: Upload Arduino Sketch
- Copy the Arduino sketch from the Arduino code tab
- Install the CAN library by Sandeep Mistry (via Arduino Library Manager)
- Paste the code into Arduino IDE
- Connect your Arduino Uno via USB
- Select Board: Arduino Uno and the correct port
- Click Upload
- Open Serial Monitor and set baud rate to 250000
Step 3: Connect MCP2515 to Vehicle CAN Bus
Warning: Always verify your vehicle's OBD-II pinout before connecting. Incorrect wiring can damage your vehicle's electronics.
Standard OBD-II CAN Bus Pinout:
| CAN Bus Type | MCP2515 Pin | OBD-II Pin | Speed |
|---|---|---|---|
| High Speed CAN | CAN-H | Pin 6 | 500 kbps |
| CAN-L | Pin 14 | ||
| Medium Speed CAN | CAN-H | Pin 3 | 125 kbps |
| CAN-L | Pin 11 |
Note: Most modern vehicles (2008+) use high-speed CAN on pins 6 and 14. Some vehicles may use different pins or have multiple CAN buses. Consult your vehicle's service manual or check online resources for your specific make and model.
Step 4: Configure MCP2515 Settings
The Arduino sketch supports both 8 MHz and 16 MHz crystal configurations:
- 8 MHz crystal: Use
125 kbpsor500 kbpsbaud rate - 16 MHz crystal: Use
125 kbpsor500 kbpsbaud rate
The default configuration in Arduino code is optimized for 8 MHz @ 125 kbps.
Step 5: Test Connection
- Power on your vehicle (ignition on, engine can be off)
- Connect Arduino to your computer via USB
- Open this web interface
- Click "Connect Serial" button
- Select the Arduino's COM port from the list
- You should start seeing CAN messages in the Serial Output window
Troubleshooting
No CAN messages received
- Check all wiring connections (especially GND)
- Verify crystal frequency setting in the sketch
- Ensure vehicle is powered on (ignition in ACC or ON position)
- Try different baud rate settings (125 kbps or 500 kbps)
- Check CAN-H and CAN-L connections are not reversed
"No ACK from bus" errors when sending
- Normal for isolated devices (head units on desk)
- Vehicle needs to be in specific state to accept certain messages
- Try sending messages while CAN bus is active with traffic
- Some CAN IDs are read-only and won't accept messages
Arduino not detected
- Install CH340 or FTDI drivers (depending on your Arduino clone)
- Try different USB cable (some are power-only)
- Check Device Manager (Windows) or
ls /dev/tty*(Mac/Linux)
Safety Warning: This tool is for educational and diagnostic purposes only. Do not send arbitrary CAN messages while driving. Improper use can interfere with vehicle safety systems. Always test in a safe, stationary environment.