Comments: OBD II UART Hookup Guide

Pages

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • AdamTolley / about 8 years ago / 2

    When 0100 is entered where does the 0x40 come from? The tutorial says it responds with the mode

    The first response byte (in this case 0x41) lists the mode that was requested in the command. Thus the board sends 0x40 + 0x01

    but I don't understand the 0x40 bit - is it just the arbitrary value of the response?

  • -------------------- Tech Support Tips/Troubleshooting/Common Issues --------------------

    Problems Reading OBDII UART in Serial Terminal

    If you are having issues reading the characters sent back from the OBDII UART in the serial terminal (assuming that you are using Tera Term) after typing a command, it's most likely due to the settings of your serial terminal. After sending the atz command into the terminal window and hitting the "enter" button, I received this as the response:

    >LM327 v1.3a
    

    Try changing the setting in your terminal window's "New-line" field for Receive from CR to CR+LF. The characters will not overwrite itself after changing these settings. You will be able to see the expected output as shown in the tutorial:

    atz
    
    ELM327 v1.3a
    >
    

    STN1110 with the ELM327 AT Commands Set Only

    The board is NOT populated with the ELM327 IC. The STN1110 interpreter that is populated on the board is compatible with the "ELM327 AT Command SET" and the "extended ST command set." For the STN-1100 family reference and programming manual, look here => https://www.scantool.net/scantool/downloads/98/stn1100-frpm.pdf .

    Logic Level

    Looking at the datasheet and tutorial, it looks like the IC on this board uses 5V. I recommend using a logic level converter [ https://www.sparkfun.com/products/12009 ] between the OBD-II UART device and the 3.3V system’s UART (i.e. Raspberry Pi and BBB).

    Changing Baud Rate

    It looks like you can change the baud rate if you on page 63 of the datasheet. Also, the ELM327 command set might be of some use https://www.sparkfun.com/datasheets/Widgets/ELM327_AT_Commands.pdf. The ELM327 is not populated on the board. The STN1110 uses the

    I also found this forum post that might be of some use => https://www.scantool.net/forum/index.php?topic=6879.0 . Try looking at page 10 of the https://www.scantool.net/scantool/downloads/98/stn1100-frpm.pdf . Both the ELM327 AT and and the extended ST command sets can be interpreted by the STN1110 interpreter.

    STN-1100 Family Reference and Programming Manual

    The STN1110 interpreter that is populated on the board is compatible with the “ELM327 AT Command SET” and the “extended ST command set.” For the STN-1100, try looking at the family reference and programming for more information [ https://www.scantool.net/scantool/downloads/98/stn1100-frpm.pdf ] . =)

  • Member #1687680 / about 3 years ago / 1

    Can not communicate sparkun OBDII UART with Raspberry pi 4 over (minicom)

    I'm trying to use Sparkfun's OBD-II-UART board (https://www.sparkfun.com/products/9555) to interface with a CAN network using a Raspberry pi 4. Upon connecting to sudo screen /dev/ttyAMA0 and when I send the commands, I'm not able to get any response from the OBD-II-UART board. Can anyone suggest why it is not communicating?

  • Problems Using OBDII UART with minicom

    DESC: Upon attempting to connect minicom to /dev/ttyUSB0 as specied in "First Communication", I ran into an issue where I would get no responses when I sent commands. However, I knew the board was working, because when I unplugged and replugged the DB9 connector, I recieved the startup message over the terminal.

    SOLN: After some short perusal of StackOverflow, I found this link. The gist of the problem was that my "Hardware Flow Control" setting was set to "Yes" instead of "No". Upon changing this setting to "No", commands worked as normal.

  • Member #713674 / about 6 years ago / 1

    "Problems Updating the Firmware of Sparkfun's STN1110 Development Board from V1.3 to V4.2."

    Hello, We are having trouble making the dev board talk to certain new vehicles. We think that the older FW version (1.3) could be an issue since ScanTool's OBDLINK LX model which has the same chip and design but a newer firmware is able to talk to the same vehicles.

    Now, we are following the instructions here to update the dev board's firmware but keep getting a connection failure error. Please guide what we can do differently?

    Thanks, Shiv A.

  • Arodd2000 / about 9 years ago / 1

    You are missing a / on the first line of the 3rd part of the code, and why wouldn't you use software serial for both the lcd AND the obd ii board? That would eliminate the need to disconnect it when flashing.

  • KK2K / about 9 years ago / 1

    In order that the serial communication works, the Baud rate needs to be set to 38.4 KBps

    I checked the ELM327 datasheet too, and it says that the default baudrate for serial communication is set to 38.4 KBps. The tutorial instructs to set the baud rate to 9600 bps. I think the tutorial needs to be updated with the correct baud rate.

  • Member #566383 / about 10 years ago * / 1

    I noticed that I am having an issue implementing this code with speeds above idle. I added a Serial.println after the program gives the command 010c to ask for RPM data and I notice the serial monitors starts to say STOPPED.

    Notes: My code is almost identical to the one outlined above except that I stripped out the speed sections and focused on RPM and I am using the Liquid Crystal library as opposed to the serial library as I do not know if the lcd I have has a serial interface.

    <#include <LiquidCrystal.h>
    
    LiquidCrystal lcd (12, 11, 5, 4, 3, 2);
    
    char rxData[20];
    char rxIndex=0;
    
    int vehicleRpm=0;
    
    void setup(){
      lcd.begin(16,2);
      Serial.begin(9600);
    
      lcd.setCursor(0,0);
    
      delay(1500);
    
      Serial.println("ATZ");
    
      delay(1500);
    
      Serial.flush();
    }
    
    void loop(){
    
      Serial.flush();
    
      lcd.setCursor(0,0);
    
      lcd.print("        ");
    
      Serial.println("010C");
      delay(1000);
    
      getResponse();
      getResponse();
    
      vehicleRpm = ((strtol(&rxData[6],0,16)*256)+strtol(&rxData[9],0,16))/4;
    
      Serial.println(rxData);
    
      lcd.print(vehicleRpm);
    
      delay(5000);
    }
    
    
    void getResponse(void){
      char inChar=0;
    
      while(inChar != '\r'){
    
        if(Serial.available() > 0){
    
          if(Serial.peek() == '\r'){
    
            inChar=Serial.read();
    
            rxData[rxIndex]='\0';
    
            rxIndex=0;
          } else {
            inChar = Serial.read();
    
            rxData[rxIndex++]=inChar;
          }
        }
      }
    }
    

    My results looking at the serial monitor resulted in the following:

    ATZ
    010C
    
    010C
    ELM327 v1.3a
    010C
    >010C
    010C
    STOPPED
    010C
    >010C
    010C
    STOPPED
    010C
    >a
    010C
    
    010C
    
    010C
    SEARCHSTOPPEDSTOPPED
    010C
    

    Any help would be greatly appreciated.

    • Member #926159 / about 8 years ago / 1

      Even i'm facing the same problem ! ELM send the STOPPED command when it is already processing a command and simultaneously receives another command ! Try putting a delay before and after the getresponse function . it worked for me


If you've found an issue with this tutorial content, please send us your feedback!