Saturday 13 January 2018

The Hardware

DISCLAIMER - You do all this at YOUR OWN RISK. Everything you do, you are responsible for. Not Me.

Take:
  • 1 x Volvo XC90, any flavour from the P2 range (2003 to 2014)
  • 1 x Arduino Uno or your favourite clone thereof
  • 1 x CAN BUS Shield based on the MCP2515 CAN bus controller - I'm using the CAN-BUS Shield v1.2 from Seeed, but you can use whichever you like
  • Some wire for the CAN bus - I chopped up a nice bright red Ethernet cable to use, but you can use anything
  • A laptop of any flavour so you can run the Arduino IDE
  • Some Arduino source code.
  • A decent but simple serial logger like Realterm

Special Notes:

  • Volvo P2 cars use 29-bit device IDs on the CAN bus
  • The low speed CAN bus runs at 125kbps
  • The CAN bus is a twisted-pair, white and green, and runs throughout the Volvo nearly to every device
  • CAN-L is the green wire in the Volvo
  • CAN-H is the white wire in the Volvo


Method (at your Desk):
  • Install Arduino IDE on your laptop
  • Install Arduino source code in the IDE
  • Mount the CAN BUS shield to the Arduino
  • Connect Arduino to a free USB port on the laptop
  • Load the Arduino code into the Arduino
  • Install Realterm on your laptop and make sure it sees the COM Port
  • Make sure the Arduino initialises the CAN bus shield successfully
  • Make sure Realterm sees the text output of the Arduino after Arduino reboot
  • Study your Volvo wiring diagram and determine where you can best tap into the low-speed CAN bus on your car

Method (in your Garage)

  • Connect the CAN bus shield to the CAN bus. You only need CAN-L and CAN-H, don't bother with Ground, +12V etc
  • CAN-L is a green wire in the twisted-pair CAN bus in the Volvo
  • CAN-H is a white wire in the twisted-pair CAN bus in the Volvo
  • Plug in the Arduino to your laptop USB port
  • Start Realterm
  • Observe the bus magic!

10 comments:

  1. Hi,
    I am following this with big interest!
    I drive a 2007 XC90 which I am experimenting with.

    Best regards from Sweden,
    Fredrik

    ReplyDelete
    Replies
    1. Are you experimenting on the CAN bus?
      How far have you got?

      Delete
    2. Not that far really. I have identified some frames for folding mirrors, windows and operating lights. Have thought about building som can-extender but didn't put any effort in it yet. Have also built some "software" for my modules, by reading them by canbus, if I have to change any part. Also did some tuning to my engine. I would like to have the automatic DRL. Official is from 2012 but the CEM is the same so have thought about trying to change software in my CEM. Need to get a newer CEM first to read out.

      Best regards,
      Fredrik

      Delete
    3. Hi, well done. I've managed to find all device diagnostic ids (easy as they are static), and have started to find the local network ids (not so easy as they change by MY). Just confirmed SWM so far. I'll be posting my found ids here soon. If you have any you wish to share, make sure you state the MY of your vehicle at the same time!
      I'm really interested to find CEM, REM and UEM first.

      Delete
    4. Hi,
      I am driving a MY2007. I think the network protocol is the same for 2005-2014 XC90. I guess you will find answers from CEM on id 01200003 if that is what you are looking for.

      Delete
    5. Hi Frederick, the CEM broadcasts on multiple addresses. 0x01200003 was not one of them! The broadcast addresses are easy to spot: look for the device with the highest broadcast message count, that's the CEM

      Delete
  2. Hi,

    I do belive that the CEM respondera on that ID when you query on the HS-CAN ;)

    ReplyDelete
    Replies
    1. Do you mean a RTR query, or a Diagnostic query? The responses to diagnostic queries use different ids to the generally available broadcast messages. Figuring the out the response to a diagnostic command is easy: ask the device something and you get a reply. Figuring out the broadcast ids is less easy, and involves much more time.... and lots of staring at hex data.... looking for patterns...

      Delete
  3. Have you made any more progress on this? I started working on my 05 xc90 about 6 months ago but I didnt get much further than mapping the SWM command and writing commands to change the volume on the radio.

    ReplyDelete
  4. Hello, I am trying to power my DIM on the bench from arduino with canbus. I am not able to sniff the original car network as there is no car left. Is there frame id's somewhere i could know to send to the DIM to "WAKE" it up

    ReplyDelete