Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use OBD-II UART Adapter: Examples, Pinouts, and Specs

Image of OBD-II UART AdapterDesign with OBD-II UART Adapter in Cirkit Designer

Introduction

The OBD-II UART Adapter by Freematics is a versatile device designed to interface with a vehicle's On-Board Diagnostics (OBD-II) system. It connects to the OBD-II port of a vehicle and communicates with the onboard diagnostics system via a UART (Universal Asynchronous Receiver-Transmitter) interface. This adapter enables users to retrieve real-time vehicle data, perform diagnostics, and monitor performance metrics.

Explore Projects Built with OBD-II UART Adapter

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ESP32-Based OBD-II Car Speed Display with ILI9488 TFT Screen: A project utilizing OBD-II UART Adapter in a practical application
ESP32-Based OBD-II Car Speed Display with ILI9488 TFT Screen

This circuit connects an ESP32 Devkit V1 microcontroller to an LCD TFT screen using SPI communication for display purposes and to an OBD2 diagnostic tool for vehicle data retrieval. The ESP32 reads vehicle speed data from the OBD2 interface via UART and displays it on the LCD screen. The circuit is designed for automotive diagnostics, specifically to read and display real-time vehicle speed.

Open Project in Cirkit Designer
Image of Laptop-Connected Adalm Pluto SDR with Dual Antennas: A project utilizing OBD-II UART Adapter in a practical application
Laptop-Connected Adalm Pluto SDR with Dual Antennas

This circuit connects an Adalm Pluto Software Defined Radio (SDR) to a laptop via a Type-B to USB cable, allowing the laptop to control the SDR and process signals. Additionally, two antennas are connected to the Adalm Pluto SDR, which are likely used for transmitting and receiving radio signals as part of the SDR's functionality.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

The following table outlines the key technical details of the Freematics OBD-II UART Adapter:

Specification Details
Input Voltage 9V to 16V (powered via the OBD-II port)
Communication Interface UART (3.3V logic level)
Supported Protocols ISO 15765-4 (CAN), ISO 14230-4 (KWP2000), ISO 9141-2, SAE J1850 PWM/VPW
Baud Rate Configurable (default: 9600 bps)
Operating Temperature -40°C to 85°C
Dimensions 48mm x 25mm x 15mm

Pin Configuration and Descriptions

The adapter features a UART interface for communication. Below is the pinout for the UART connector:

Pin Name Description
1 VCC Power input for the UART interface (3.3V or 5V, depending on the microcontroller)
2 GND Ground connection
3 TXD Transmit data (output from the adapter)
4 RXD Receive data (input to the adapter)

Usage Instructions

How to Use the OBD-II UART Adapter in a Circuit

  1. Connect the Adapter to the Vehicle:
    • Plug the OBD-II UART Adapter into the vehicle's OBD-II port, typically located under the dashboard.
  2. Connect to a Microcontroller:
    • Use the UART interface to connect the adapter to a microcontroller (e.g., Arduino UNO). Ensure proper voltage levels (3.3V or 5V) for the UART pins.
  3. Power the Adapter:
    • The adapter is powered directly from the vehicle's OBD-II port. No external power supply is required.
  4. Configure Communication:
    • Set the UART baud rate on the microcontroller to match the adapter's default (9600 bps) or a custom baud rate if configured.

Important Considerations and Best Practices

Example Code for Arduino UNO

Below is an example Arduino sketch to retrieve and display vehicle speed using the OBD-II UART Adapter:

#include <SoftwareSerial.h>

// Define RX and TX pins for SoftwareSerial
SoftwareSerial obdSerial(10, 11); // RX = pin 10, TX = pin 11

void setup() {
  Serial.begin(9600); // Initialize Serial Monitor
  obdSerial.begin(9600); // Initialize OBD-II UART communication

  // Send initialization command to the OBD-II adapter
  obdSerial.println("ATZ"); // Reset the adapter
  delay(1000); // Wait for the adapter to reset

  // Set the protocol to automatic
  obdSerial.println("ATSP0");
  delay(1000);

  Serial.println("OBD-II Adapter Initialized");
}

void loop() {
  // Request vehicle speed (PID 0D)
  obdSerial.println("010D");
  delay(100); // Wait for the response

  // Read the response from the adapter
  while (obdSerial.available()) {
    char c = obdSerial.read();
    Serial.print(c); // Print the response to the Serial Monitor
  }
  delay(1000); // Wait before sending the next request
}

Notes:

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Response from the Adapter:

    • Ensure the vehicle's ignition is turned on.
    • Verify the UART connections (TX, RX, VCC, GND) are correct.
    • Check the baud rate configuration on the microcontroller.
  2. Incorrect or Garbled Data:

    • Confirm the UART voltage levels match between the adapter and the microcontroller.
    • Ensure the OBD-II protocol is supported by the vehicle.
  3. Adapter Not Powering On:

    • Check the OBD-II port for proper power output (typically 12V).
    • Inspect the adapter for physical damage or loose connections.

FAQs

Q: Can this adapter work with all vehicles?
A: The adapter supports most vehicles manufactured after 1996 that comply with OBD-II standards. However, compatibility depends on the specific protocol used by the vehicle.

Q: How do I change the baud rate of the adapter?
A: Use the ATBRx command, where x specifies the desired baud rate. Refer to the Freematics user manual for details.

Q: Can I use this adapter with a Raspberry Pi?
A: Yes, the adapter can be connected to a Raspberry Pi via its UART interface. Ensure proper voltage level conversion if needed.

Q: Is it safe to leave the adapter connected to the vehicle?
A: While the adapter has low power consumption, it is recommended to disconnect it when the vehicle is not in use to prevent battery drain.