While waiting for a CAN Bus Shield to arrive in the post I decided to get to work on making some of the functions that don’t rely on the CAN Bus interface work. The most interesting of these is the Speedometer.

The speedometer expects a signal on Pin 19 of the black connector. On the pin diagram here it is listed as “Signal, Wheel Speed, Rear Left”. Not knowing any more information than that I needed to figure out what sort of signal this input expected, was it a 5V/12V square wave? PWM? Measuring the voltage of this pin the cluster is supplying 12V so I started shorting it to ground, the speedometer began to twitch! Clearly I got lucky first time, the cluster expects the pin to be shorted to ground.

Using a 2N2222 NPN Transistor and a 1K resistor I started rapidly pulling the speed input to ground. In the final design of the drive circuitry I may use an optocoupler to separate the cluster from the computer’s power system.

e46 Speedometer Driver - ArduinoSpeedometer Interface Schematic

 

Using the Arduino “tone(f)” function I started trying various frequencies.

After some experimentation I determined that the speedometer line needed to be pulsed at a frequency equal to the RPM of a fictional 30″ wheel. At 1MPH the wheel would rotate at 10.843 RPM so the Arduino would need to produce a 10.843 Hz output. To get other speeds I just multiply this base frequency by the desired speed reading.

float RPMPerMPH = 10.84f;

// Output on Pin 50
if(Speed == 0)
{
    noTone(50); 
}else{
    tone(50, RPMPerMPH * Speed);
}

Documentation

As I work out the various pins I’m building a table here


Leave a Reply

Your email address will not be published. Required fields are marked *