This code is for reading the K-Linke in Cars. With this code you can read sensor values, troubleshoot codes and more. It is compatible with ISO9141 and ISO14230(KWP slow and fast) protocols. I have shared schematics to communicate with the car. You can use these schematics or you can make another one. I used Arduino nano and ESP32 C3 as microcontrollers, but you can use another microcontrollers like STM32, ESP8266 and much more.
I will share more information about K-Line protocols and communication later. Stay tuned 😉.
- Open .ino file
- 📚Instal these Libraries
- ESPAsyncWebServer - AsyncTCP - ArduinoJson
- Edit the pins for your Board
#define K_Serial Serial #define K_line_RX 20 #define K_line_TX 21 #define Led 8 #define Buzzer 1 #define voltagePin 0
- If you are using ESP32 C3,S2 or S3 board, you need to disable "USB CDC On Boot" option in Tools menu
- Change Partition Scheme to "Huge APP (3MB No OTA, 1MB SPIFFS)" in Tools menu
- Upload the code to your Board
- Upload the Website to SPIFFS.
- To upload the Web Site, you can use PlatformIO or you can upload with tool for Arduino IDE v1.x.x
Here is documentation how to upload files to SPIFFS with Arduino IDE.
- To upload the Web Site, you can use PlatformIO or you can upload with tool for Arduino IDE v1.x.x
![](https://private-user-images.githubusercontent.com/75759731/344467072-ec4e65b2-c6a1-4438-9ee7-89229c2815b3.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjc4ODAsIm5iZiI6MTcyNDM2NzU4MCwicGF0aCI6Ii83NTc1OTczMS8zNDQ0NjcwNzItZWM0ZTY1YjItYzZhMS00NDM4LTllZTctODkyMjljMjgxNWIzLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyNTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcwM2UyYzg1MWI3YTMyZTFmNDY4ZGQ3NjZiNDVjNGEyYTU1ZWM0MjIxM2JiMWQ4ZWE5YTIwZTEyZjViOGIxMTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.qWWZOktmv4EFhNK7fFuo-aWtVhQxxXx3Y6a78vT26ZA)
![](https://private-user-images.githubusercontent.com/75759731/344467132-303f1157-73bc-4cd4-859d-7097c8e56081.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjc4ODAsIm5iZiI6MTcyNDM2NzU4MCwicGF0aCI6Ii83NTc1OTczMS8zNDQ0NjcxMzItMzAzZjExNTctNzNiYy00Y2Q0LTg1OWQtNzA5N2M4ZTU2MDgxLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyNTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0MWFlYmY2NzA5MzM4ZTE3YWE0MWFmNGIzMzBiNzQzZjE0MTE3ZmY3MzFiNDQ3MTA5YTU3YWYyMGUwOTdiZGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bkgW4Xnd7H9lfiGdDj1InTv7PNSvx7pXKfYVXk3iglg)
![](https://private-user-images.githubusercontent.com/75759731/344467177-c91f11dd-60d4-4439-baad-d5950f792eff.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjc4ODAsIm5iZiI6MTcyNDM2NzU4MCwicGF0aCI6Ii83NTc1OTczMS8zNDQ0NjcxNzctYzkxZjExZGQtNjBkNC00NDM5LWJhYWQtZDU5NTBmNzkyZWZmLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyNTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjMTI0YzBlMWQwNWU0MDBjOTVkODY4YjQ0YmY2Nzc0NzE2YzFlYTFjODBjMTJkYmQ5NWUyYWUxOGI2YjE0MTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FiO96yNtqzGCj7Rc_JeZgroZz7ddAFdLRbWz6nnzIqE)
![](https://private-user-images.githubusercontent.com/75759731/344467194-d29a42d3-9b9c-454f-990b-0f3fc4afb3cc.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjc4ODAsIm5iZiI6MTcyNDM2NzU4MCwicGF0aCI6Ii83NTc1OTczMS8zNDQ0NjcxOTQtZDI5YTQyZDMtOWI5Yy00NTRmLTk5MGItMGYzZmM0YWZiM2NjLmpwZz9YLUFtei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hiNmZkNTcwMmNkNTcxZTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._iRj8Yd_1PXPe3vJH0CGMMlTPsPsMpr2SGmbN7AlEHQ)
![](https://private-user-images.githubusercontent.com/75759731/344467267-6b818d30-83c4-4db6-bd81-e07bac03cd8b.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjc4ODAsIm5iZiI6MTcyNDM2NzU4MCwicGF0aCI6Ii83NTc1OTczMS8zNDQ0NjcyNjctNmI4MThkMzAtODNjNC00ZGI2LWJkODEtZTA3YmFjMDNjZDhiLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyNTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVmY2E2M2M1NmYzY2M3ZThmZGY5NzBjNTk4ZDNiYjA2NDQ4OTY0Y2Q0N2EzOTUyMDI2YTJhMzE5NmUzYWIxYmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ucdr_VwEVa3Rb-BLHWtxAJo8RwLlvUIF6q33wwp8HSE)
![](https://private-user-images.githubusercontent.com/75759731/344467284-54613d4c-ea31-48cc-a426-a7199aa9eaff.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdG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