Guage Cluster Programming

Let’s try this again now that I have gotten a little bit further into the project.

I am working on reverse engineering an instrument cluster from a newer truck and currently wrote a program to test out the hex signals and make sure I have the correct CAN ID and Byte Information causing the tach and speedo to move with a potentiometer. and I have an LCD as well in order to make sure I am sending the information I think I am TO the cluster.

Here is the code I have SO FAR, was hoping for some input from more experienced people on the forum because I’m extremely new to this.

#include <mcp_can.h>

#include <SPI.h>

#include <LiquidCrystal.h>

MCP_CAN CAN0(10); // Set CS to pin 10

int sensorPin = A0; //setting potentiometer pin

int sensorValue = 0; //value for later for potentiometer

LiquidCrystal lcd(9, 8, 7, 6, 5, 4);

void setup()




// Initialize MCP2515 running at 16MHz with a baudrate of 500kb/s and the masks and filters disabled.

if (CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK) Serial.println(“MCP2515 Initialized Successfully!”);

else Serial.println(“Error Initializing MCP2515…”);

CAN0.setMode(MCP_NORMAL); // Change to normal mode to allow messages to be transmitted


void loop()


sensorValue = analogRead(sensorPin / 4); //setting up the value of the potentiometer for transmission

byte data[8] = {sensorValue, sensorValue, 0x02, 0x03, sensorValue, sensorValue, 0x06, 0x07}; //sending potentiometer value to byte 0,1,4 and 5

byte sndStat = CAN0.sendMsgBuf(0xC9, 0, 8, data); //setting CAN ID to 201 // send data: ID = 0x201, Standard CAN Frame, Data length = 8 bytes, ‘data’ = array of data bytes to send

if (sndStat == CAN_OK)


Serial.println(“Message Sent Successfully!”);


else {

Serial.println(“Error Sending Message…”);

lcd.setCursor(0, 0);

lcd.print(“CAN ID: 201”);

lcd.setCursor(0, 1);

lcd.print(data [8]);


delay(100); // send data per 100ms


Provide a link to the documentation for the instrument cluster.

It is a 2013 f250 diesel instrument cluster.

haven't found a datasheet on it other than the connector pinout for the CAN H and CAN L wiring.

currently I am also trying to figure out how to pull data from an SAE J1850 OBDII port to the arduino for purposes of translating.

I have an elecfreaks can bus shield I am using for a current project,
the vehicle that the obd2 port plugs into is using SAE J1850 OBD2 protocol. will the PID's be the same for the 1850 in order to pull speedometer and tachometer data from this?

I cant find any information on how to pull data from it.


Please read the first post in any forum entitled how to use this forum.,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.,. :slight_smile:

Now I've got the code updated, running with a potentiometer controlling values for the HEX as well as a second potentiometer controlling the CAN ID that the values are sent to, terminated both sides of the CAN BUS with 120 ohms and nothing on the cluster is moving at all.. any advice from a can bus veteran?

I will post the code when I get to my laptop to do so.