Page 1 of 1

Trouble Initializing OBD-II Model B

Posted: Thu Jan 22, 2015 12:39 pm
by BobbyTheLee
I'm having issues initializing the OBD-II adapter that I just received. I don't have a display so I couldn't use one of the example sketches included with the library. I am running the code below and I only see the "About to start" message and then the "Ugh!!!" message repeats. The light on Pin13 stays on and never goes off. I've tried it on both I2C connections on my Arduino Mega. I've also tried it on my UNO and my Nano Arduinos. Could someone give me some pointers on how to get my adapter working? I just installed the libraries and have not modified any of the header or cpp files.

Code: Select all

#include <Wire.h>
#include <OBD.h>

COBDI2C obd;

void setup()
{
 
 //start the serial connection
 Serial.begin(115200);
  // we'll use the debug LED as output
  pinMode(13, OUTPUT);
  // start communication with OBD-II adapter
  obd.begin();
  Serial.println("About to start");
  digitalWrite(13,HIGH);
  // initiate OBD-II connection until success
  while (!obd.init()) {
   Serial.println("Ugh!!!");
  }
 
}

void loop()
{
  Serial.println("You're in 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 3000
    digitalWrite(13, value < 3000 ? HIGH : LOW);
  }
}

Re: Trouble Initializing OBD-II Model B

Posted: Thu Feb 05, 2015 8:16 pm
by stanley
You may need to make sure the adapter is compatible with your car. Your car must use one of the supported protocols.

Re: Trouble Initializing OBD-II Model B

Posted: Fri Apr 10, 2015 3:13 am
by doki10000
Same problem here, I have a Model B and it won't connect to the car either, the blue light flashes for a second and then the whole thing hangs in obd.init().

Hardware: OBD-II Model B MPU-9150
Hardware: Arduino Mega 2560
Car: Prius 2014
OBDII Protocol: ISO 15765-4 CAN (11 bit ID,500 Kbaud)
Software: rpm_led_i2c.ino (https://github.com/stanleyhuangyc/Ardui ... ed_i2c.ino)
Wiring: OBD-II MPU -> SDA/SDL ports in Mega

I tried to manually change the protocol in the header file, still doesn't work...

Re: Trouble Initializing OBD-II Model B

Posted: Mon Apr 20, 2015 10:37 am
by stanley
Did you see blue LED inside the enclosure flashing? Have you tried reading from MPU9150?

Re: Trouble Initializing OBD-II Model B

Posted: Thu Apr 23, 2015 1:35 am
by doki10000
I had to connect GND from the adapter to the arduino for it to work (see my post for more details). When connecting, lights still flash this way but then they flash every 30 seconds or so when connected.