Wednesday, November 18, 2015

E90 Can bus

Purchased an E90 Can bus Instrument Cluster to play with.


The cluster pin out is simple.  It only has: Power, Ground, Can bus High, Can bus Low and 2 wires for the outside air temperature.  Makes it easy to hook up :-) All gauges are driven by the can bus.  Using can values from https://loopybunny.co.uk/CarPC/k_can.html and some info we had we quickly had it up and running. 

When power is applied nothing happens.  The cluster, and most of the E90 modules,  require a "terminal 15" on signal, sent over the can bus, to wake up and come a live.

The Instrument cluster gauges are actually on the K-Can bus and the engine, DSC, TCU etc. is on the PT-Can bus.  In the car there is a gateway (the junction box) that is between PT-Can and K-Can Bus.  It repeats the necessary messages for the gauges to work, from the DME on the PT-Can bus, on the K-Can bus.  One thing to be aware of is that the PT-Can bus is at 500kb/s and the K-Can is 100kb/s. When setting up a Can bus interface be sure to use the correct Baud rate.

Later we will take some time to hunt down the proper bytes and bits to turn on the engine warning lights.

Edit:  For T15 turn on we send the following every  100 milliseconds.  Some units will stay on until a turn off is received.  Others will turn off after a length of time without the T15 on message.


to turn on
  id = 0x130;
  len =5;
  data[0]= 0x45; //0x45;  //Key Status
  data[1]= 0x42; // 0x40;  //Transponder Detected
  data[2]= 0x69;  // 0x21;  //Terminal Status
  data[3]= 0x8F;  // Steering lock?
  data[4]= 0xE2;  //Counter and Checksum

To turn off: (if the device doesn't automatically turn off.  IHKA turns off on it's own.  KOMBI doesn't)
  id = 0x130;
  length =5;
  data[0]= 0x00;
  data[1]= 0x40;  //Transponder Detected
  data[2]= 0x21;
  data[3]= 0x8F;
  data[4]= 0x50; //Counter and Checksum

19 comments:

  1. Hello i want to do the same for a BMW E46 cluster. I have can bus + arduino, hooked up can high and low but from here i am lost... I tried some arduino codes but still doesnt work. I want to play racing games and simulators. Please respond and help me, i am searching from 1 month and nothing

    ReplyDelete
    Replies
    1. Have you tried the ones linked from post 1 http://e46canbus.blogspot.com/2014/01/over-year-ago-while-temporarily-living.html

      There are some on the google drive. Between that an the stuff on Bimmerforums you should have the can bus covered. However the speedo and fuel gauge are not can bus.

      Delete
    2. i am a beginner in arduino code, i tryed to upload the codes but i recive an error like "not declared in this scope"

      Delete
    3. The program is created with multiple tabs. If not opened correctly you will get all kinds of errors. Google how to use Tabs in the Arduino compiler and I think it'll make sense.

      Delete
  2. Hi Thaniel,
    first of all, thanks for your great work. Thanks to you I got my E90 Kombi talking with my Arduino in no time. I have one question regarding the speed equation. On bimmerforums you wrote, that you used MPH_A=(((millis()-time_1A6)/50)*MPH/2); I also did and encounter the same error you described (speed works for a short while, then skips).
    Did you find a solution to that problem yet?
    Thanks a lot!

    ReplyDelete
    Replies
    1. Sorry, I've not looked into that. I'm more interested in DME messages.

      Delete
  3. hello. i like your page. i have a cluster that i want to simply see milage. how should i power up the speedo?

    ReplyDelete
    Replies
    1. to just see the mileage you should be able to connect power and ground. Then press and hold the left button on it like resetting the trip odometer.

      Delete
    2. I have a Pi Zero / Can Hat that is connected to 2007 E92 Cluster on the bench.

      The backlight command works, but nothing else. I'm sending the Terminal T15 (0x130) packet ("\x45\x42\x69\x8F\xE2\xFE") every 100ms along with a velocity packet. Bit-Rate is 100kbps.

      From what I've seen there's 2 types of velocity packets, but neither seem to work for me. The time counter also seems a bit strange for the 0x1B4 version.

      #if 1
      QByteArray velocityPacket; //0x1A6
      velocityPacket[0]= (quint8)(velocity&0xFF);
      velocityPacket[1]= (quint8)(velocity>>8);
      velocityPacket[2]= (quint8)(velocity&0xFF);
      velocityPacket[3]= (quint8)(velocity>>8);
      velocityPacket[4]= (quint8)(velocity&0xFF);
      velocityPacket[5]= (quint8)(velocity>>8);
      velocityPacket[6]= (quint8)(timeCount&0xFF);
      velocityPacket[7]= (quint8)((timeCount>>8) | 0xF0);
      velocity += 1;
      timeCount += 100;
      QCanBusFrame frame (0x1A6, velocityPacket);
      m_canDevice->writeFrame(frame);
      #else
      QByteArray velocityPacket; // 0x1B4
      velocityPacket[0]= (quint8)(velocity&0xFF);
      velocityPacket[1]= (quint8)(velocity>>8);
      velocityPacket[2]= 0xE0;
      velocityPacket[3]= 0xF0 | packetCount;
      velocityPacket[4]= 0x00;
      velocityPacket[5]= 0x30; // Handbrake status
      velocityPacket[6]= 0xFC;
      velocityPacket[7]= strangeCount++; // Increments from 0x2E to 0x3C only?!
      velocity = 0xD42E; // ex. 0xD000 = 0MPH, 0xD42E = 66MPH
      strangeCount += ( strangeCount > 0x3C) ? 0x2E : 0;
      packetCount++;
      QCanBusFrame frame (0x1B4, velocityPacket);
      m_canDevice->writeFrame(frame);
      #endif

      Any suggestions what could be the problem?

      Delete
  4. What is the pinout of the cluster?
    I have an E90 320d and the outside temp went mad (going up and down - making the ice alert ping) but it is not the sensor - and now the info screen is turning off and back on like it is resetting - want to check which wires are for the temp and which ones are can high and low so I can check for noise to try and make a start into fixing this problem

    ReplyDelete
  5. I need this file to turn on the cluster e90 instrument outside the car can I help you please

    ReplyDelete
    Replies
    1. The help I provide is the information in this blog. If you have basic CAN bus knowledge this should be enough.

      Delete
  6. Hi mate. Can you build bench test for me i just need cluster to do Kl test and so backlight lits up

    ReplyDelete
    Replies
    1. Building one isn't too difficult. Build a CAN shield using a Fault tolerant transceiver and then send the turn on messages.

      Delete
  7. Awesome work! Could you please give a bit more detail on how often its supposed to be sent to keep it working and if checksum at the end has to be incremented? Im working on this for a few days and for the best of me cannot make it work. I have read everything on the forums where you have posted your progress. I can turn it on, move rpm needle, move fuel needle, turn on lights, but after a second all warning lights turn off and just the screen stays on, not responding to any further messages. Loopbunny says timer should be incremented at 1.4 seconds but if I do that it keeps resetting all the time. Could you please give more insight on timing of different messages, you would save me a ton of time. Thank you, youre awesome!

    ReplyDelete
  8. Best thing to do for timing is to get a data sample from a car. Then look at the times. OFTEN the messages will have arbitration collisions and not get out so set your message interval at the shortest typical one found. Many, including myself, set them at the average thinking that's best. But that's not what the car is doing. The car may be trying to send at 10ms but have the time get's stepped on by a more important message so we 20ms but once in awhile 10ms. Then set it at 10ms. Checksums aren't really my thing. Would love to have someone that knows more on that but the few I attempted to work with, once they figure it out ran away with the info to make $ and didn't share it with anyone. Sadly it's made me a little less open about information to individual people unless they are contributing openly their knowledge.

    ReplyDelete
  9. Hi, I am currently trying to connect an e90 cluster to my PC for my simulator rig. I have power to the cluster via a 12v supply but from there I have no idea what I am doing. I know that pins 6 & 7 on the cluster are the CAN high and low but where do I need to connect these to on the arduino uno? Apologies for what may be a dumb question but I am a complete noob with this stuff :(

    ReplyDelete
  10. To anyone whose project is blocked because the link in the first paragraph directs to the domain website:
    Try the link without "festival": loopybunny.co.uk/CarPC/k_can.html
    I hope my project can gain momentum now. :)

    ReplyDelete