View Single Post
Old 02-09-2012, 12:49 AM   #38 (permalink)
toc
EcoModding Apprentice
 
Join Date: Jan 2011
Location: Australia
Posts: 179

Sonata97 - '97 Hyundai Sonata GL
90 day: 25.96 mpg (US)

Pulsar - '03 Nissan Pulsar ST
Team Nissan
90 day: 36.09 mpg (US)

Lancer - '04 Mitsubishi Lancer
90 day: 31.11 mpg (US)

Lancer 2.0 - '09 Mitsubishi Lancer
90 day: 27.1 mpg (US)
Thanks: 9
Thanked 16 Times in 13 Posts
I ended up building something similar to this circuit to get communicating:
http://mmcdlogger.sourceforge.net/ecu-rs232.jpg

Then in Arduino, the program was similar to:
Serial.begin(1920);

With these:
wireless.print("Battery: Result:");
temp_val = fetch_data(0x14);
temp_real_val = temp_val * 0.0733;
wireless.print(temp_val, HEX);
wireless.print("|Bat Val: ");
wireless.println(temp_real_val);

wireless.println("Testing at 1920bps");
wireless.print("RPM: Result:");
temp_val = fetch_data(0x21);
temp_real_val = temp_val * 31.25;

The fetch data function:


int fetch_data(byte cmd) {
int dat[3];
int temp;
int i;
Serial.write(cmd);
starttime = millis();
while ((Serial.available()<2) && ( (millis() - starttime) < MAX_WAIT_TIME) ) {
//do nothing
}
if (Serial.available()<2) {
wireless.print("Error - 2 Bytes not found - We did get:");
wireless.println(Serial.read(), HEX);
Serial.flush();
} else {
i = 0;
delay(10);
while (Serial.available() > 0) {

temp = Serial.read();
wireless.print("Dat ");
wireless.print(i);
wireless.print(": ");
wireless.print(temp, HEX);
dat[i] = temp;
i++;
//dat[0] should be the cmd we sent
//dat[1] should be the result of the cmd.
}
Serial.flush();
return dat[1];
}

}


You can find a full list here;
MUT Requests - EvoEcu

I never did finish testing for adequate programming though I do know I was receiving correct data for RPMs and Battery Voltage and some other parameters - but I ended up selling the Hyundai so never finished it off.

Now I'm trying to do it with a Nissan (Damned lack of OBDII support!!!)
__________________
  Reply With Quote
The Following User Says Thank You to toc For This Useful Post:
oldskool (02-09-2012)