The last few days I have been working with the Arduino OBD I2C adapter, an arduino mega adk and the basic rpm code. It seemed to be pretty easy, but somehow it didn't work despite all the useful topics on this forum. After two days we tried to hook up the system with a 2008 peugeot. It worked straight out of the box.
Since it is a 2009 grande punto, it should have a universal OBDII connector which support the 29B 500K can protocol. I tried lot's of things including 'manually configuring the baudrate', ' manually selecting the right can protocol" and many other quick fixes mentioned in different topics. However it didn't help, the code gets stuck at the obd.init part. I also bought a UART cable. This one does work on the Peugeot, but again it doesn't work on the Punto.
I added the I2C code which worked properly on the Peugeot, but didn't work on the Punto.
Thanks in advance for the replies.
Kind regards,
Mark
Code: Select all
#include <Arduino.h>
#include <Wire.h>
#include <OBD.h>
COBDI2C obd;
void setup()
{
// start the serial connection (show messages on the tools/serial monitor,
// select correct baud rate (in my case it was 9600))
Serial.begin(9600);
// we'll use the debug LED as output
pinMode(13, OUTPUT);
// start communication with OBD-II adapter
obd.begin();
Serial.println("About to start");
// initiate OBD-II connection until success
while (!obd.init()){
Serial.println("Connecting with obd...");
// makes the led blink during connecting
digitalWrite(13,LOW);
delay(200);
digitalWrite(13,HIGH);
delay(200);
}
Serial.println("Connection established");
}
void loop()
{
Serial.println("Acquiring RPM data");
// turn of the led after entering the loop
digitalWrite(13,LOW);
int value;
// save engine RPM in variable 'value', return true on success
if (obd.read(PID_RPM, value)) {
// light on LED on Arduino board when the RPM exceeds 1500
digitalWrite(13, value>1500 ? HIGH:LOW);
Serial.println("value is above 1500 rpm");
}
}