I am VERY new to electronics, but I love this world. My first project is to read CAN bus data from my 2008 Ford Taurus. I got a MCP2515 CAN Bus Module with a TJA1050 Receiver, and an Arduino.
I hooked everything up, and used the mcp_can library by coryjfowler. I took an old diagnostic tool's OBD cable and cut it, opened it, soldered 2 wires to pin 6 and 14. I then tried it on the car (completely dead battery, had to jump it) and I did get data as soon as I jumped it (key not even in ignition). But this data looks... fake? I mean I don't know what I'm seeing but I even started the car and the same data seems to keep repeating. When I remove key, I still see data although I'm guessing that's normal...
I'm not sure what I did wrong, not sure how to figure out what I did wrong... The only idea I have is that I don't have a shared ground but I don't think that's... necessary?
Here's a sample of what my data looks like (it keeps repeating this pattern, even when the car is fully on):
2025-10-24 11:44:48.220 S,0x33B,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.222 S,0x33B,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.226 E,0xF4BA6FB,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.240 S,0x33B,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.242 S,0x33B,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.243 S,0x363,0,DATA 2025-10-24 11:44:48.244 E,0x1A21DE7A,2,RTR 2025-10-24 11:44:48.246 S,0x33B,7,DATA,67 67 67 6C 67 67 67 2025-10-24 11:44:48.248 S,0x33B,7,DATA,67 67 67 67 67 67 6C 2025-10-24 11:44:48.250 S,0x33B,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.252 S,0x33B,7,DATA,00 00 00 00 00 00 00 2025-10-24 11:44:48.254 E,0xF4BA6FB,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.256 S,0x33B,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.258 S,0x33B,7,DATA,67 67 67 67 67 67 67 2025-10-24 11:44:48.259 S,0x363,0,DATA Here is the code that runs on the Arduino:
#include <mcp_can.h> #include <SPI.h> MCP_CAN CAN0(10); // CS pin 10 void setup() { Serial.begin(115200); if (CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_8MHZ) != CAN_OK) { Serial.println("Error Initializing MCP2515..."); while (1); } else { Serial.println("MCP2515 Initialized Successfully!"); } CAN0.setMode(MCP_LISTENONLY); Serial.println("Sniffer ready..."); } void loop() { if (CAN0.checkReceive() == CAN_MSGAVAIL) { unsigned long rawId; byte dlc; byte data[8]; if (CAN0.readMsgBuf(&rawId, &dlc, data) != CAN_OK) return; if (dlc > 8) return; bool isExt = rawId & 0x80000000UL; bool isRTR = rawId & 0x40000000UL; unsigned long cleanId = rawId & 0x1FFFFFFFUL; Serial.print(isExt ? 'E' : 'S'); Serial.print(",0x"); Serial.print(cleanId, HEX); Serial.print(','); Serial.print(dlc); Serial.print(','); Serial.print(isRTR ? "RTR" : "DATA"); if (!isRTR && dlc > 0) { Serial.print(','); for (byte i = 0; i < dlc; i++) { if (i) Serial.print(' '); if (data[i] < 16) Serial.print('0'); Serial.print(data[i], HEX); } } Serial.println(); } } ```