RepositoryC++BGBulgaria
muki01

muki01/OBD2_K-line_Reader

OBD2 K-line Reader (ISO9141 and ISO14230) with microcontrollers like ESP32, Arduino.

265stars
47forks
20issues
3views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: obd2

#1 Repository of the week

1
TINIX TRENDING·Topic: k-line

#1 Repository of the week

1
TINIX TRENDING·Topic: elm327

#1 Repository of the week

🚗 OBD2 K-Line Reader — Car Diagnostics (ISO 9141 / ISO 14230)

Read live sensor data, read & clear trouble codes (DTCs), view freeze-frame data, vehicle info (VIN) and battery voltage from older K-Line vehicles — supporting ISO 9141-2 and ISO 14230 / KWP2000 (slow & fast init) on Arduino, ESP32, ESP8266, STM32 and Raspberry Pi Pico. Comes with multiple hardware interface schematics and an optional WiFi web dashboard with OTA updates.

GitHub Repo stars GitHub forks GitHub Issues or Pull Requests GitHub License GitHub last commit ESP32 Arduino Sponsor


📌 Overview

OBD2 K-Line Reader is a complete diagnostic firmware for communicating with a vehicle's ECU over the K-Line interface. Through the standard OBD-II connector it can read live sensor data, read and clear diagnostic trouble codes (DTCs), capture freeze-frame snapshots, retrieve vehicle info (VIN & ECU IDs), run an acceleration/speed test, and measure battery voltage — no dedicated scan tool required.

It supports the ISO 9141-2 and ISO 14230 (KWP2000, slow & fast init) protocols used by most European and Asian vehicles built roughly between 2000 and 2010, with runtime protocol switching and auto-detection. Tested on Arduino and ESP32, it also runs on STM32, ESP8266, Raspberry Pi Pico and similar microcontrollers.

Two builds are included: a lightweight Serial Monitor version (Basic_Code) for quick testing, and a WebServer version (WebServer_Code) that turns an ESP32 / ESP8266 into a standalone WiFi diagnostic tool — running as a Station or Access Point, updatable over-the-air (OTA), and served through a browser-based dashboard. Full hardware schematics are included so you can build the interface yourself.

This project is part of a larger OBD2 diagnostics toolkit — libraries, a CAN-bus reader and a web dashboard. See Related Projects.

🔗 Looking for the Web UI? See the dedicated front-end: OBD2 Diagnostic UI.

💼 Hire Me

I design custom automotive diagnostic tools, firmware and apps — this is what I do professionally. Whether you need a full product or just the communication layer, I can help.

  • Custom protocol implementation — K-Line (ISO 9141-2 / KWP2000), CAN bus, and manufacturer-specific protocols (BMW I/K-Bus, VAG KW1281, and more)
  • Custom bus & protocol communication code — low-level drivers and communication routines for any automotive bus or proprietary/custom protocol you need
  • ECU security access — seed-key (security access) algorithms and unlock routines for KWP2000 / UDS ECUs
  • Custom mobile & desktop apps — Android / iOS / web companion apps to visualize, log and control your device
  • Bespoke hardware — diagnostic shields & PCBs designed around your requirements
  • ECU communication & reverse engineering — PID logging, DTC handling, freeze-frame, VIN, undocumented buses
  • Embedded firmware — Arduino, ESP32, ESP8266, STM32, Raspberry Pi Pico

Need something else related to automotive communication or electronics? Just reach out — if it involves cars, buses or embedded hardware, I can most likely help.

Have a project in this space? → 📧 muksin.muksin04@gmail.com

✨ Features

Diagnostics

  • 📊 Live sensor data — read real-time PIDs from the ECU.
  • ⚠️ Trouble codes — read and clear DTCs.
  • ❄️ Freeze-frame data — snapshot of sensor values captured when a fault occurred.
  • 🚗 Vehicle info — read VIN and ECU identification data.
  • 🚦 Acceleration test — measure vehicle performance (speed test).
  • 🔋 Battery voltage — read directly from the OBD-II connector.

Connectivity & Firmware

  • 🔀 Selectable protocols — ISO 9141-2 and ISO 14230 (KWP2000 slow & fast init), switchable at runtime.
  • 📶 WiFi — STA or AP mode — connect to your network or host its own access point (WebServer build).
  • 🔄 OTA updates — update the firmware over the air, no cable needed (WebServer build).
  • 🔌 Multi-platform — Arduino, ESP32, ESP8266, STM32, Raspberry Pi Pico and more.
  • 🌐 Two builds — Serial-monitor Basic_Code and browser-based WebServer_Code.
  • 🛠️ Multiple schematics — transistor, comparator and dedicated automotive-IC options.

📱Pictures of the application I made

📂 The UI for this application has been moved to a separate repository. You can check out the source code and details here: Explore the Web UI Repository

📡 Supported Protocols

ProtocolStandardInitializationStatus
ISO 9141-2ISO 9141-25-baud slow init✅ Tested
KWP2000 (slow init)ISO 14230-45-baud slow init✅ Tested
KWP2000 (fast init)ISO 14230-4Fast init✅ Tested
Auto-detect—Tries all of the above✅ Default

🚀 Quick Start

First, build a hardware interface from one of the Schematics below. Then choose the build that fits your goal — each has its own step-by-step setup guide:

🖥️ Just testing? → Basic_Code

Serial-monitor version for Arduino & ESP32 — wire it up, upload, and read live data in the Serial Monitor.

👉 Setup guide: Basic_Code README

🌐 Want the web dashboard? → WebServer_Code

For ESP32 / ESP8266 — turns the board into a standalone WiFi diagnostic tool with a browser dashboard (STA/AP) and OTA updates.

👉 Setup guide: WebServer_Code README

⚠️ Disclaimer: This is a hobby / development project. I am not responsible for any issues or damage that may occur during testing. Never use it while the vehicle is in motion — proceed at your own risk.

Part of a full OBD2 / automotive diagnostics ecosystem:

Firmware & ReadersLibrariesManufacturer ProtocolsUI
OBD2 K-line ReaderOBD2 K-Line LibraryBMW I/K BusOBD2 Diagnostic UI
OBD2 CAN Bus ReaderOBD2 CAN Bus LibraryVAG KW1281

🛠️ Schematics for Communication

K-Line communication operates at different voltage and signal levels than microcontroller pins. These circuits provide the required level shifting and protection for safe, stable operation. Pick the approach that suits your project:

🔹 Transistor-based

A simple, low-cost discrete-transistor interface, ideal for basic implementations and prototyping. The R6 resistor is sized for 3.3V microcontrollers — for a 5V MCU, change R6 to 5.3 kΩ.

🔹 Comparator-based

Uses a cheap comparator IC (e.g. LM393) to produce a clean digital level. Better noise immunity and well-defined logic thresholds than the transistor design, at a slightly higher component count — a great balance of cost and reliability.

🔹 Dedicated automotive IC

Uses purpose-built K-Line / ISO 9141 transceiver ICs (L9637D, MC33290, Si9241, SN65HVDA195, etc.) with built-in level shifting and protection. Fully standards-compliant with the highest reliability — recommended for production-grade, long-term designs.

🧩 PCB Design & Sponsorship

PCBWay

The custom-designed PCBs used in this project were manufactured with sponsorship from PCBWay. PCBWay provides high-quality, reliable PCB manufacturing services to electronics developers worldwide. I was thoroughly satisfied with the board quality and support, and I'd like to thank them for the excellent manufacturing, fast delivery and affordable pricing that truly added value to this project.

📷 PCBs manufactured for this project:

👉 Need professional PCB manufacturing for your own projects? 🔗 Check out PCBWay

☕ Support My Work

If you enjoy my projects and want to support me, you can do so through the links below:

Buy Me A Coffee PayPal GitHub Sponsors


📬 Contact

For custom development, job offers, collaboration, sponsorship, or purchasing my devices, feel free to reach out.

📧 Email: muksin.muksin04@gmail.com


Created by Muki · If you find this useful, consider giving it a ⭐

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
muki01/OBD2_KLine_Library

OBD2 K-Line diagnostics library for Arduino, ESP32 and compatible boards. Supports ISO9141, ISO14230 (KWP2000), KW1281, DS2 and KW82

103
Nov 11, 2026
RepositoryC++
adlerre/obd2-mqtt

OBD2 to MQTT for Home Assistant

280
Nov 12, 2026
RepositoryC++
kerpz/ArduinoHondaOBD

Collections of Arduino codes that reads and translates Honda OBD codes to ELM / OBD 2 PID codes. It also process and displays the output to a LCD or transmit the output to a bluetooth channel.

192
Feb 13, 2024
RepositoryJava
fr3ts0n/AndrOBD

Android OBD diagnostics with any ELM327 adapter

2.2k
Nov 26, 2026
RepositoryPython
cedricp/ddt4all

OBD tool

2.0k
Nov 30, 2026
RepositoryShell
jgamblin/CarHackingTools

Install and Configure Common Car Hacking Tools.

983
May 7, 2023
RepositoryC
limiter121/esp32-obd2-emulator

Open-source OBD-II emulator based on an ESP32 + CAN transceiver IC, controllable via WiFi through a simple web UI (or via API)

507
Apr 9, 2018
RepositoryC
VaAndCob/ESP32-Bluetooth-OBD2-Gauge

DIY bluetooth obd2 gauge with ESP32 (CYD)

484
Oct 24, 2025
RepositoryC
devcoons/iso15765-canbus

Implementation of ISO15765-2 in C

201
Jun 22, 2026