SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Mee_n_Mac
#144461
BTW it would be worth doing a quick sanity check. Do a wrap around test, connect the Tx out of the Arduino (to the STN1110) to it's own (Arduino) Rx in. Pins 2 and 3 I believe. Then you should see everything you type/send on the PC monitor come back (as if it were from the STN1110). This is just to be sure ...
By Mee_n_Mac
#144462
djarmyssg wrote:Ya.. we saw it echoed... but it was an echo from the arduino..... not from the OBDshield.
Was it ? I thought the LCD was displaying data from the OBD at that point. I'll have to check that. Your answer would make more sense though.
djarmyssg wrote: It says pin 14 (TX-0) has a 4.7k resistor to 5V.... I issolated that risistor and only get 2.2k... could this be an issue???
I don't think so. That is the pullup and if it's 2.2K that means the STN1110 would have to sink ~2 mA instead of ~1 mA to make a logic low. I can't see that making a difference.
By djarmyssg
#144629
Yea... I totally leaning towards the RX line on the board is bad.. I've been workign with Sparkfuns Tech support... but they kepp telling me to do the same stuff ive already tried.. so i do it again... tell them the same thing. Then get told "Well i got it working" LOL No ****... Cause the board u got ISNT bad!!! I've gotten them to set up the exact same way I have, Exact same program... and it works perfectly for them!!! Hmmm... Wonder how this is gonna play out????
By Mee_n_Mac
#144637
Well if the wrap-around test above works, that proves the Arduino and (most of the) wiring and code is all good. Then all that's left is the OBDII board and the wiring to/from it and your Arduino. If you've ohmed it all out, and are sure the 3 wires are all in the right places and checked voltages (3.3 & 5 V) on the OBDII board, then the only reasons you don't see the commands echoed back have got to be baud rate, protocol or bad board. The first two are easy enough to check. After that ...

The only thing that bothers me with the conclusion is that at one time we did see the ATZ echoed back. I looked and the Arduino code was writing the data from the OBDII to the LCD, not the data from the USB/PC to the LCD. That doesn't mean there can't be an intermittant joint on the OBDII. Nothing else to T/S comes to my mind.
By rocketboy07
#144692
I have been following this thread as I just got the obd II uart board also and was having problems getting a correct response. After a few days I have some code that will use a laptop hooked up to the arduino through usb to send and receive to the obd board. The obd tx goes to pin 2 and the rx goes to pin 3 on the arduino. I have this working on my ford contour so I hope this will help you. Make sure to send the atz command before trying any other command.
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial obd(2,3);
 char inChar=0;
 char inOBD=0;
 char rxIndex=0;
 char rxDataPC[20];
 char rxDataCar[30];
void setup()
{
  
  obd.begin(9600);
  Serial.begin(9600);
  
}
void loop(){
  inChar=0;
 while(Serial.available()>0){
    if(Serial.available() > 0){
      //Start by checking if we've received the end of message character ('\r').
      if(Serial.peek() == '\r'){
        //Clear the Serial buffer
        inChar=Serial.read();
        //Put the end of string character on our data string
        rxDataPC[rxIndex]='\0';
        //Reset the buffer index so that the next character goes back at the beginning of the string.
        rxIndex=0;
        obd.println(rxDataPC);
        inChar=0;
         getResponse();
         delay(20);
         getResponse();
      }
      //If we didn't get the end of message character, just add the new character to the string.
      else{
        //Get the new character from the Serial port.
        inChar = Serial.read();
        //Add the new character to the string, and increment the index variable.
        rxDataPC[rxIndex++]=inChar;
      }
    }
  }

}
void getResponse(void){
  char obdIn=0;
  int i=0;
  int start=millis();
  //If nothing is currently available do nothing and break after 3 seconds
  while(obd.available()==0){if(millis()-start>3000){break;}}
  while(obd.available()){
    //check to see if end of line/message
    if (obd.peek()=='\r'){
      obdIn=obd.read();
      rxDataCar[i]='\0';
      Serial.println(rxDataCar);
      i=0;
    }
    // The prompt is sometimes the only thing recieved so this needs to be taken care of
    else if(obd.peek()=='>'){
      obdIn=obd.read();
      Serial.write(obdIn);
    }
    // Add next character to string
    else{
      obdIn=obd.read();
      rxDataCar[i++]=obdIn;
    }
  }
}
If you have any questions feel free to ask I check the forums often
By djarmyssg
#144702
Thanx Rocket... I tried the code.. and I get the same thing.. I can send the ATZ command... get the lights to flash the reset sequence. but I get NOTHING back on the terminal program... Are you gettingthe "ELM237 V...." returned in the terminal program? I havent been able to get anything EVER.. Am im about 99% sure my settings and connections are all good. Sparkfun is actually sending me another board, im hoping this will fix my problem and get my project back on track!!!
By rocketboy07
#144724
Yeah I get the ELM237 returned. Hope the new one works for you keep us updated
By djarmyssg
#144728
What terminal program are you using? Or are u just using the serial monitor? If u use a term program, whats ur settings?
By rocketboy07
#144734
I am just using the serial monitor but make sure that it has carriage return for line ending otherwise it wont work.
By djarmyssg
#144989
Well I FINNALY got the new board in!!! wired it all up and WOW... Finally got the ELM v1.3!!!!! so now i KNOW the board was bad!!! Hooked it up to my hardware started recieving info Right then!!! Battery voltage and information returned to the Terminal program!!! So I placed everything together, uploaded my OBDuino program to the arduino, and hooked it up!!! Instantly recognized the ecu protocol, having a bit of an issue getting all the actual RPM/ Speed, temp things... but for now, Im chocking tonight up as a win!!!! I might need to fix the code im running a lil, but I'll worry about that tommrow!
Video coming soon
By Mee_n_Mac
#144991
That good to know ! I'd have bet on software being the problem first and then some flaky connection but those were pretty much ruled out with the terminal program and Arduino as a pass through. Now confirmed with success w/new board.

Now the real problems start ! Enjoy !! :dance: :twisted:
By djarmyssg
#145142
LOL Thanx mac... I've been fiddling around with it a lil bit, seem to be able to get it to connect and read.. havent done to much more than that. I did see that I could see how many PIDs were being supported. maybe i'll mess around with her some more later!
By themotorman
#167689
I am trying to read an OrionBMS system using the CAN_BUS. The CAN is on and if the Arduino on and then Sparkfun it is ok. IF Spartk fun is ON first then putting Arduino ON just gives a Searching but doesn't connect to the CAN. There is a problem only when Sparkfun on before Arduino. I can get it all working by powering Sparkfun off and on and this always works.
I am using the PC via a USB and running the ARduino.ex so I have a monitor to look at the communication .
Ideas?