1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Driving real gauges

Discussion in 'DIY peripherals' started by fastdruid, Jun 16, 2011.

  1. tronicgr

    tronicgr

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    This is interesting....

    http://www.mcselec.com/index2.php?optio ... pic&t=9851

    :brows:
  2. fastdruid

    fastdruid New Member

    Joined:
    Jun 16, 2011
    Messages:
    22
    Balance:
    57Coins
    Ratings:
    +8 / 0 / -0
    J1850 is very different to CAN, although I suppose in theory its the same, get a chip that 'talks' it, connect to a processor of some kind.
  3. my_space

    my_space New Member

    Joined:
    Feb 1, 2012
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Just wanted to say thanks to OP.

    I've got a cluster working with the same CAN ID's although the syntax is slightly different.

    Quick question is that have you got the fuel gauge working? And also how did you go about interrogating the dashboard to get the correct CAN ID's?
  4. fastdruid

    fastdruid New Member

    Joined:
    Jun 16, 2011
    Messages:
    22
    Balance:
    57Coins
    Ratings:
    +8 / 0 / -0
    The fuel gauge is resistance driven, you can either use a digital pot or PWM through a transistor.

    See this circuit and code here http://www.greatoldone.co.uk/low-fuel-2 its for a real car so most of the circuit is for making a clean power supply but shows how it can be done.

    This obviously isn't the RX-8 but shows it working on a real gauge.
    http://www.youtube.com/watch?v=tbC9ubBLYdc

    As for finding the ID's I used two methods, the first was to put a scanner on the car, drive round for a bit then note all the ID's used and replay them.
    The second was to just hit it with one ID after another and see if it did anything.
  5. my_space

    my_space New Member

    Joined:
    Feb 1, 2012
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Got all the dials working... .

    Not going worry about the fuel gauge just yet, I'll probably just end up sticking a resistor across the right wires to maintain a certain level.

    I haven't managed to turn off all the warning lights, so I'll just remove them manually; although the cluster did have an up arrow to tell you to change gear which was quite neat.

    Well... here it is in action

    http://www.youtube.com/watch?v=rSmlIAbgNLg

    Wired up a 12V DC supply to the cluster... hooked up the CAN Board from SECUduino and used fastdruid's code as inspiration.

    Any questions... I'll try to answer....

    Next step is the LCD Screen for gear indicator (Hopefully I'll be able to drive the LCD directly?)
  6. fastdruid

    fastdruid New Member

    Joined:
    Jun 16, 2011
    Messages:
    22
    Balance:
    57Coins
    Ratings:
    +8 / 0 / -0
    Glad to have been of some help. Looking good.

    Bearing in mind that ford owned 33% of Mazda and there is/was a *lot* of cross over/development...

    The seat belt warning is very likely hard wired.
    The frost warning(not on the RX-8) is again probably hard wired.
    Low fuel in the case of the RX-8 is hard wired but on a different sensor from the fuel gauge.
    Handbrake/brake warning is probably CAN.

    Can't tell what the other light you have is.

    Of course if all else fails you could just take it apart and either stick some black card over the front (if you want to resell the gauges at any time) or remove the LED for the ones you can't sort!
  7. skotty

    skotty New Member

    Joined:
    Sep 17, 2012
    Messages:
    2
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hey guys..

    Bit of a thread mind here I know, but I have a Arduino 2560 R3, and the secuduino can shield...

    Put the code on the first page in the arduino software and I keep on getting the following error message...

    sketch_nov13c.cpp: In function 'void setup()':
    sketch_nov13c:26: error: 'CAN' was not declared in this scope
    sketch_nov13c:27: error: 'CAN_MODE_NORMAL' was not declared in this scope
    sketch_nov13c.cpp: In function 'void loop()':
    sketch_nov13c:43: error: 'steering' was not declared in this scope
    sketch_nov13c:44: error: 'CAN' was not declared in this scope
    sketch_nov13c:44: error: 'message_id_300' was not declared in this scope
    sketch_nov13c:51: error: 'CAN' was not declared in this scope
    sketch_nov13c:87: error: expected primary-expression before '/' token
    sketch_nov13c:98: error: expected primary-expression before '}' token
    sketch_nov13c:98: error: expected `;' before '}' token
    sketch_nov13c.cpp: At global scope:
    sketch_nov13c:101: error: expected declaration before '}' token

    Woundering if anyone would be able to give me a hand to sort the problem out... Once I have it working the cluster I'm going to be using is from a 2006 Ford Falcon BF XR6.
  8. my_space

    my_space New Member

    Joined:
    Feb 1, 2012
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Have you got the can library from secuduino? I had to nudge them to send it to me. If not then I can mail you a copy of it. The thing is the code on the front of this page needs to be tweaked depending on the can library being used.
  9. skotty

    skotty New Member

    Joined:
    Sep 17, 2012
    Messages:
    2
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Yeah I got the CAN Library from secuduino. Getting alot of errors tho.. It's being a PITA...
  10. JDM Dyno

    JDM Dyno New Member

    Joined:
    Dec 6, 2012
    Messages:
    2
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hi my_space I'm very interested in your dash videos etc. i'm trying to get somthing working with CAN-BUS Shield from skpang, I have same problems as skotty when trying to use the code.

    I'm trying to get ECU info from an aftermarket ECU to the gauges of a ford focus , i can get serial info from the ecu and would like to send it down the can bus to the gauges using the mega2560 and CAN BUS shield .

    so my question is would you be willing to send me the code you have working on your dash as a starting point for me?

    i've been trying to get the code to compile but with no luck, can get other file to work ok but not this CAN one, I'm not a computer programer I'm a car tuner lol.

    thanks J
  11. mdpolan

    mdpolan New Member

    Joined:
    Dec 29, 2012
    Messages:
    1
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Hey I impressed that you went to the trouble to download all the Can Bus addresses to make the gauges work. I am attempting to do something similar using a instrument cluster from a 2005 Mustang. Any advice on addresses for the gauges, timing & programming etc would be a help.
  12. LOOLOO132

    LOOLOO132 New Member

    Joined:
    Feb 21, 2013
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    hi fastdruid:
    I got myself a RX8 gauages. i Would like to find out if you can share the instrument cluster Pinout for 12v and CANH and CANL.

    [​IMG]

    Thanks.
    LOOLOO
  13. LOOLOO132

    LOOLOO132 New Member

    Joined:
    Feb 21, 2013
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    hi All:

    I am unable to get my gauges clusters running. PLease can anyone advise me y?
    This is what I have done so far.
    1. Gotten RX8 guages cluster and canShield and Arduino
    2. hook the guages up to 12v see earlier diagarm(Pin 1G + , Pin 1E GND)
    3. hook up the canbus pin (CANH 1L , CANL 1J)
    4. At both end add 120ohm.
    5.below is my code
    Code:
    #include <CAN.h>
    #include <SoftwareSerial.h>
    #include <SPI.h>
    
    #define BUS_SPEED 1000
    
    //global variable used to determine whether loop should
    //be in Tx or Rx mode.
    int state;
    int RPM;
    int mphspeed;
    int kmhspeed;
    
    
    void setup() {                
    
      
      Serial.begin(9600);
      
      // initialize CAN bus class
      // this class initializes SPI communications with MCP2515
      CAN.begin();
      CAN.baudConfig(BUS_SPEED);
      RPM=5500;
      mphspeed=100;
    
    
     /* 
      //Wait 10 seconds so that I can still upload even
      //if the previous iteration spams the serial port
      delay(1000);
     #if  defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
      state = 0;
      
     #else
     state = 1;
    
    
      CAN.setMaskOrFilter(MASK_0,   0b11111111, 0b11100000, 0b00000000, 0b00000000);
      CAN.setMaskOrFilter(FILTER_0, 0b11111111, 0b11100000, 0b00000000, 0b00000000); //DISALLOW ext packets.
      CAN.setMaskOrFilter(FILTER_1, 0b10111111, 0b11100000, 0b00000000, 0b00000000);
      CAN.setMaskOrFilter(MASK_1,   0b00000000, 0b00000000, 0b00001111, 0b11111111);  
      CAN.setMaskOrFilter(FILTER_2, 0b00000000, 0b00001000, 0b00001101, 0b11111111);
      CAN.setMaskOrFilter(FILTER_3, 0b00000000, 0b00001000, 0b00001101, 0b11111111);
      CAN.setMaskOrFilter(FILTER_4, 0b00000000, 0b00001000, 0b00001111, 0b11111111);
     CAN.setMaskOrFilter(FILTER_5, 0b00000000, 0b00001000, 0b00001101, 0b11111111);
    
      #endif
     */
      CAN.setMode(NORMAL);  // set to NORMAL for standard com 
    }
    
    byte inc = 0;
    
    void printBuf(byte rx_status, byte length, uint32_t frame_id, byte filter, byte buffer, byte *frame_data, byte ext) {
           
          Serial.print([Rx] Status:);
          Serial.print(rx_status,HEX);
          
          Serial.print( Len:);
          Serial.print(length,HEX);
          
          Serial.print( Frame:);
          Serial.print(frame_id,HEX);
    
          Serial.print( EXT?:);
          Serial.print(ext==1,HEX);
           
          Serial.print( Filter:);
          Serial.print(filter,HEX);
    
          Serial.print( Buffer:);
          Serial.print(buffer,HEX);
          
          Serial.print( Data:[);
          for (int i=0;i<8;i++) {
            if (i>0) Serial.print( );
            Serial.print(frame_data[i],HEX);
          }
          Serial.println(]); 
    }
    
    void loop() {
      
      byte length,rx_status,filter,ext;
      uint32_t frame_id;
      byte frame_data[8];
      kmhspeed=mphspeed * 160.9344;
    
      delay(10);
    
      
          frame_data[0] =(RPM * 4) / 256; // rpm
          frame_data[1] =(RPM * 4) % 256; // rpm
          frame_data[2] =0xFF; // Unknown, 0xFF from 'live'.
          frame_data[3] =0xFF; // Unknown, 0xFF from 'live'.
          frame_data[4] =(kmhspeed+10000) / 256; //speed
          frame_data[5] =(kmhspeed+10000) % 256; //speed
          frame_data[6] =0x00; // Unknown possible accelerator pedel if Madox is correc
          frame_data[7] =0x00; //Unknown....................................................
      
          frame_id = 0x201;
          length = 8;
          CAN.load_ff_0(length,&frame_id,frame_data, false);
          //CAN.send_0();
          
          frame_data[0] = 0xFE; //Unknown
          frame_data[1] = 0xFE; //Unknown
          frame_data[2] = 0xFE; //Unknown
          frame_data[3] = 0x34; //DSC OFF in combo with byte 5 Live data only seen 0x34
          frame_data[4] = 0x00; // B01000000; // Brake warning B00001000;  //ABS warning
          frame_data[5] = 0x40; // TCS in combo with byte 3
          frame_data[6] = 0x00; // Unknown
          frame_data[7] = 0x00; // Unused.......................................................
          frame_id = 0x212;
          length = 8;
          CAN.load_ff_0(length,&frame_id,frame_data, false);
          //CAN.send_0();
          delay(10);
          inc++;
          Serial.println(sending a standard packet.);
       
          frame_data[0] = 0x00;
          frame_data[1] = 0x00;
          frame_data[2] = 0x00;
          frame_data[3] = 0x00;
          frame_data[4] = 0x00;
          frame_data[5] = 0x00;
          frame_data[6] = 0x00;
          frame_data[7] = 0x00;
      
          frame_id = 0x0000;
      
          length = 0;
          
          rx_status = CAN.readStatus();
    
          if ((rx_status & 0x40) == 0x40)
          {
            CAN.readDATA_ff_0(&length,frame_data,&frame_id, &ext, &filter);
            printBuf(rx_status, length, frame_id, filter, 0, frame_data, ext);
          }
          
          if ((rx_status & 0x80) == 0x80) 
          {
           CAN.readDATA_ff_1(&length,frame_data,&frame_id, &ext, &filter);
            printBuf(rx_status, length, frame_id, filter, 1, frame_data, ext); 
          }
          
    
    }
    
  14. LOOLOO132

    LOOLOO132 New Member

    Joined:
    Feb 21, 2013
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    here are some photos of i have done so far:
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
  15. JDM Dyno

    JDM Dyno New Member

    Joined:
    Dec 6, 2012
    Messages:
    2
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    have you checked total resistance? should be 60ohm, looking at diagram above dash could have 120ohm in it.
    in your sketch i only see Rx and no Tx think you need Tx to send to dash.
    have you tested in loopback mode?
    ive given up for now as the dash i have is an older one and turns out to not have CAN :( has j1850 pwm not CAN

    hope this helps J
  16. egidijus

    egidijus New Member

    Joined:
    May 18, 2013
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    hello i have been working on a dream simulator and all i need to finish it is get the speedometer working but i dont know were even to start i would bet extreamly great full if you helped me thank you
  17. egidijus

    egidijus New Member

    Joined:
    May 18, 2013
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    hello i have been working on a dream simulator and all i need to finish it is get the speedometer working but i dont know were even to start i would bet extreamly great full if you helped me thank you
  18. egidijus

    egidijus New Member

    Joined:
    May 18, 2013
    Messages:
    3
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    hello i have been working on a dream simulator and all i need to finish it is get the speedometer working but i dont know were even to start i would bet extreamly great full if you helped me thank you
  19. Gambit951

    Gambit951 New Member

    Joined:
    Aug 27, 2013
    Messages:
    1
    Balance:
    0Coins
    Ratings:
    +0 / 0 / -0
    Re: Rx-8 instrument Cluster
    anyone know how to fool the cluster into thinking the parking light / head light’s are on?
    got it working on my desktop simulator but i want the clusters red lights to turn when i turn the lights on.
    it’s a CAN signal but dunno which id.
  20. luca_schr

    luca_schr New Member

    Joined:
    Mar 1, 2013
    Messages:
    4
    Occupation:
    School
    Location:
    Mannheim, Germany
    Balance:
    27Coins
    Ratings:
    +3 / 0 / -0
    Is there any further information or any more progress on this project? Would be nice to hear something from you...