The OBD-II (On-Board Diagnostics II) port is a standardized interface found in most vehicles produced after 1996. It allows for the monitoring and diagnosis of a vehicle's engine and other vital systems. Mechanics and technicians commonly use this port to retrieve error codes and performance data to troubleshoot issues. Additionally, it is used by a variety of aftermarket devices such as performance tuners, telematics systems, and insurance trackers.
Pin Number | Description | Protocol Support |
---|---|---|
1 | Manufacturer discretion | OEM |
2 | SAE J1850 Line (Bus+ Line of PWM) | SAE J1850 PWM |
3 | Manufacturer discretion | OEM |
4 | Chassis ground | All |
5 | Signal ground | All |
6 | CAN High (J-2284) | ISO 15765-4 CAN |
7 | ISO 9141-2 K Line | ISO 9141-2, ISO 14230-4 |
8 | Manufacturer discretion | OEM |
9 | Manufacturer discretion | OEM |
10 | SAE J1850 Line (Bus- Line of PWM) | SAE J1850 PWM |
11 | Manufacturer discretion | OEM |
12 | Manufacturer discretion | OEM |
13 | Manufacturer discretion | OEM |
14 | CAN Low (J-2284) | ISO 15765-4 CAN |
15 | ISO 9141-2 L Line | ISO 9141-2, ISO 14230-4 |
16 | Battery power | All |
Q: Can I use the OBD-II port to modify my vehicle's performance? A: Yes, but it should be done with caution and typically requires specialized tuning devices or software.
Q: Is it safe to leave an OBD-II device connected at all times? A: While many devices are designed for continuous use, it is important to ensure they do not drain the vehicle's battery.
Q: How do I know which protocol my vehicle uses? A: The vehicle's manual often specifies the protocol. Otherwise, most OBD-II devices automatically detect the correct protocol.
Below is an example of Arduino code to read data from the OBD-II port using an ELM327 OBD-II to UART interface. This code is for demonstration purposes and may require adjustments based on your specific setup and vehicle protocol.
#include <SoftwareSerial.h>
// Initialize the OBD-II UART interface with RX and TX pins
SoftwareSerial obd(10, 11); // RX, TX
void setup() {
// Start the serial communication
Serial.begin(9600);
obd.begin(38400); // The baud rate for ELM327 is typically 38400
Serial.println("OBD-II Test");
}
void loop() {
// Send a command to the OBD-II interface
obd.println("010C"); // This command requests the engine RPM
delay(100); // Wait for the response
// Read the response from the OBD-II interface
if (obd.available()) {
String data = obd.readString();
Serial.print("Received data: ");
Serial.println(data);
}
delay(1000); // Wait before sending the next command
}
Remember to wrap the comments in the code to ensure they do not exceed 80 characters in line length.