{"id":29286631,"url":"https://github.com/muki01/obd2_kline_library","last_synced_at":"2025-07-06T00:09:36.669Z","repository":{"id":299898858,"uuid":"995567293","full_name":"muki01/OBD2_KLine_Library","owner":"muki01","description":"Arduino library for communicating with vehicles via OBD-II using the K-Line interface (ISO9141 / ISO14230 protocols).","archived":false,"fork":false,"pushed_at":"2025-06-26T11:59:41.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T12:49:18.633Z","etag":null,"topics":["arduino","arduino-library","diagnostic","diagnostic-tests","diagnostic-tool","elm327","esp32","iso14230-1","iso9141","k-line","kline","kwp2000","library","obd2","obd2-library"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muki01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-03T17:18:31.000Z","updated_at":"2025-06-26T11:59:44.000Z","dependencies_parsed_at":"2025-06-18T22:21:42.218Z","dependency_job_id":"b75270c1-6bbc-4e40-87f6-76defb622c54","html_url":"https://github.com/muki01/OBD2_KLine_Library","commit_stats":null,"previous_names":["muki01/obd2_kline_library"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muki01/OBD2_KLine_Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muki01%2FOBD2_KLine_Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muki01%2FOBD2_KLine_Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muki01%2FOBD2_KLine_Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muki01%2FOBD2_KLine_Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muki01","download_url":"https://codeload.github.com/muki01/OBD2_KLine_Library/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muki01%2FOBD2_KLine_Library/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263828724,"owners_count":23516791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","arduino-library","diagnostic","diagnostic-tests","diagnostic-tool","elm327","esp32","iso14230-1","iso9141","k-line","kline","kwp2000","library","obd2","obd2-library"],"created_at":"2025-07-06T00:09:35.643Z","updated_at":"2025-07-06T00:09:36.622Z","avatar_url":"https://github.com/muki01.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OBD2 KLine Library\n\n![GitHub forks](https://img.shields.io/github/forks/muki01/OBD2_KLine_Library?style=flat)\n![GitHub Repo stars](https://img.shields.io/github/stars/muki01/OBD2_KLine_Library?style=flat)\n![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/muki01/OBD2_KLine_Library?style=flat)\n![GitHub License](https://img.shields.io/github/license/muki01/OBD2_KLine_Library?style=flat)\n![GitHub last commit](https://img.shields.io/github/last-commit/muki01/OBD2_KLine_Library)\n\n**OBD2_KLine** is a lightweight yet powerful Arduino-compatible library that enables direct communication with vehicles using the **K-Line** (ISO 9141 / ISO 14230 - KWP2000).\n\nThis library is designed for microcontrollers such as **Arduino**, **ESP32**, and similar platforms. It allows your device to communicate directly with a vehicle that uses the **K-Line**.  \nIf you're curious about which types of data are supported, you can find a full list of features below.\n\nK-Line is a legacy protocol used in many **European and Japanese vehicles manufactured between ~1987 and 2010**, especially before CAN became mandatory in newer models.  \nThis makes the library ideal for working with older cars that still rely on ISO9141 or KWP2000 communication standards.\n\n---\n\n## ❓ Does Your Vehicle Support K-Line?\n\nBefore using this library, it's important to confirm whether your vehicle supports the **K-Line** protocol.\n\nK-Line vehicles typically have **Pin 7** on the OBD-II connector connected.  \nIf your vehicle’s OBD-II connector has **Pins 6 and 14 connected**, it uses the **CAN bus** protocol instead of K-Line.\n\n✅ **Pin 7 (K-Line)**: Your vehicle likely supports ISO 9141 or ISO 14230 (KWP2000) — this library will work.  \n❌ **Pin 6 and 14 (CAN bus)**: Your vehicle uses CAN — consider a different library.\n\n### Example photos of OBD2 Connector\n*(add images or links if available)*\n\n---\n\n## ✨ Features\n\n- Supports **ISO 9141-2** and **ISO 14230-4 (KWP2000)**\n- **5-baud initialization (slow init)** and **Fast init** support\n- **Automatic protocol detection**\n- Read real-time sensor values\n- Read and clear **stored and pending DTCs**\n- Retrieve vehicle info (VIN, calibration IDs, etc.)\n- **Mode 06** support (on-board test results)\n- Debug output for easier development\n- Customizable delays and request intervals\n- Works with Arduino, ESP32 and similar platforms\n\n---\n\n## 📡 Supported OBD-II Modes\n\n| Mode | Description                                      |\n|------|--------------------------------------------------|\n| 01   | Read current live data (sensor values)           |\n| 02   | Read freeze frame data                           |\n| 03   | Read stored Diagnostic Trouble Codes (DTCs)      |\n| 04   | Clear DTCs and MIL reset                         |\n| 05   | Oxygen sensor test results                       |\n| 06   | On-board monitoring test results                 |\n| 07   | Read pending Diagnostic Trouble Codes            |\n| 09   | Retrieve vehicle information (VIN, calibration)  |\n\n---\n\n### 📊 Typical Data Rates\n\nEach protocol has its own timing characteristics, which affect how many responses you can expect per second when reading data from the ECU. The values below reflect **actual performance measurements** based on this library’s real-world testing.\n\n| Protocol     | Average Responses per Second |\n|--------------|-------------------------------|\n| ISO 9141-2   | ~7–8 responses/sec            |\n| ISO 14230-4  | ~8–9 responses/sec            |\n\n\u003e 🔎 Note: Tese values represent average conditions based on real-world testing. The actual throughput can vary depending on the ECU’s internal processing time, the specific data being requested (e.g. PID type), and system latency.\n\n---\n\n## 🛠️ Schematics for Communication\n\nThese schematics are essential because K-Line communication operates at different voltage and signal levels than microcontroller pins.  \nThe circuits ensure proper level shifting and protection for safe, stable operation.\n\nYou can choose one of the following approaches depending on your project:\n\n### 🔹 Schematic with Transistors\n\u003cimg src=\"https://github.com/muki01/OBD2_K-line_Reader/blob/main/Schematics/Transistor%20Schematic.png\" width=70%\u003e\n\n- **R6 3kΩ** is for **3.3V MCUs**. Use **5.3kΩ** for **5V** systems.\n- **R4** is often used as **1kΩ**, but the K-Line standard recommends **510Ω**. Either option will work, but **510Ω** is more compliant with the standard.\n\n### 🔹 Schematic with L9637D\n\u003cimg src=\"https://github.com/muki01/OBD2_K-line_Reader/blob/main/Schematics/L9637D.png\" width=70%\u003e\n\nThe **L9637D** is a dedicated K-Line transceiver chip that simplifies the interface circuit, reducing part count and improving signal reliability.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuki01%2Fobd2_kline_library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuki01%2Fobd2_kline_library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuki01%2Fobd2_kline_library/lists"}