Cheap OBD2 Communications on K-line (ISO 9141-2 and ISO 14230-4)





Introduction: Cheap OBD2 Communications on K-line (ISO 9141-2 and ISO 14230-4)

About: idea + energy = instructable

This is just another OBD2 solution for monitoring the sensors in a verhicle. It supports the K-line OBD2 serial communication between a verhicle and a microcontroller. This K-line communication is also known as ISO 9141-2 or ISO 14230-4 (also known as Keyword Protocol 2000 or KWP). Both ISO's are almost similar. This solution differs from the rest that is low cost (for less than 10 euro!!). It is low cost in the way that you don't need an arduino, raspberry pi or smart phone. Just a microcontroller and LCD display so you can use your smartphone for other purposes.

Main features:

  • Shows verhicle engine load, temperature, speed and RPM on a LCD display
  • Optically displaying the engine load via a LED by changing the intensity using the microcontroller PWM module
  • When temperature exceeds 93 degrees a buzzer will be triggered
  • A watchdog will quard communication problems between microcontroller and verhicle ECU

To do:

  • Display stored diagnostic trouble codes in mode 0x03 (routine is included but I have to wait till my car gets troubles)
  • Clear trouble codes / Malfunction indicator lamp (MIL) / Check engine light (routine is included but untested)
  • Support "fast init"

It is tested with a Citroen C1 gasoline (2013) and VW Touran gasoline (2003). Probably it will work for a Peugeot 107 and Toyota Aygo of 2013 as well since they are technically identical. From what I read on the internet there are many flavours on K-line around so there is a possibility it will not suit your car. Maybe some changes are needed to make it work. The source code is provided so you can investigate and change when needed. Maybe you can help extending this list of cars to help others!

Have fun!

Found this site where you can check if your car supports K-line:

Step 1: Parts

1 x OBD2 Connector 16 Pin Male

1 x Microchip 16f886 microcontroller

1 x 16x2 LCD HD44780 or compatible

1 x BC547 or 2N3940 transistor

1 x LM7805 1A regulator

1 x 330nF ceramic capacitor

1 x 100nF ceramic capacitor

1 x 510 Ohm resistor

1 x 2.2K Ohm resistor

1 x 47K Ohm resistor

1 x 33K Ohm resistor

1 x 100 Ohm resistor, optional (for blue led, please use appropriate resistor for other colors)

1 x LED, optional

2 x 10K Ohm trim resistor

1 x Buzzer 5 volt (< 20mA), optional

Step 2: K-line Initialization and Response

Both ISO's 9141 and 14230 knows a 5 baud initialization sequence. The microcontroller must start this init by transmitting byte 0x33 to the verhicle at 5 bits per second. The total transmit time for transmitting byte 0x33 takes about 2 seconds. After this initialization it is expected to continue communicating at 10k4 baud.

ISO 9141-2 initialization response:

For ISO 9141-2 the verhicle ECU will respond with synchronization byte 0x55. After this, the verhicle will respond with key bytes 0x08 and 0x08 or 0x96 and 0x96. The sync byte with key bytes of the verhicle must be acknowledged by the microcontroller by inverting the second key byte. This will end the initialization part of ISO 9141-2.

ISO 14230 initialization response:

The response of ISO 14230 is slightly different. The verhicle ECU will also respond with synchronization byte 0x55. Only the key bytes are different. In case of a VW Touran of 2003 the key bytes are 0xef and 0x8f. Also here the second key byte must be acknowledged by the microcontroller by inverting it.

Step 3: Stimulus Response

After the initialization process it is possible to submit a request to the verhicle ECU. A request is a sequence of bytes where adressing, a mode, a PID and a checksum is present. The following are example requests:

For ISO 9141-2 this sequence of bytes is 0x68, 0x6a, 0xf1, 0x01, 0x0d and 0xd1.

For ISO 14230 this sequence of bytes is 0xc2, 0x33, 0xf1, 0x01, 0x0d and 0xf4.

The first three bytes are for addressing. The fourth is the mode field. The fifth byte is the data field with the PID and the last byte is the checksum.

In this example mode 1 is used. This mode will show "current data" as how it is at this moment. This mode is perfect for displaying actual information. The data field contains the PID. In this case 0x0d which is the verhicle speed. The checksum is the sum of the bytes with mod 256. See this link for a list of PIDs:

The response is almost similar. The data field reflects actual data which will probably change every request. The following are example responses with 0x00 as data (which is verhicle speed 0).

For ISO 9141-2 : 0x48, 0x6b, 0x10, 0x41, 0x0d, 0x00, 0x11.

For ISO 14230 : 0x83, 0xf1, 0x10, 0x41, 0x0d, 0x00, 0xd2.

This OBD2 solution displays the calculated engine load (PID 0x04), engine
coolant temperature (PID 0x05), verhicle speed (PID 0x0d) and engine RPM (PID 0x0c) on a LCD display.

Step 4: Schematic

The verhicle will supply the circuit with 12 volt via pins 5 and 16 of the ODB2 connector. The voltage regulator will create 5 volt out of this for the microcontroller and LCD.

K-line signals of pin 7 will be converted to appropriate levels via an interface of resistors and a transistor.

The two trimm resistors are used to control the contrast and backlight of the LCD.

On port RC1 you can connect a LED (optional). With help of the PWM module of the microcontroller the intensity of the LED will be controlled by the calculated engine load (PID 0x04).

On port RC7 you can connect a buzzer (optional). When the engine coolant temperature (PID 0x05) exceeds the 93 degrees this port will be enabled.

Step 5: Code

The Microchip XLCD peripheral routines with some small changes are used for the external LCD module (less blurry result with fast changing data compared with other LCD routines).

A routine for displaying and clearing stored diagnostic trouble codes is included. This can be initiated by pressing the switch for 2 seconds. This routine is untested and will most probably not work. Feel free to try if you have a car with trouble codes.

The 5 baud init is also called "slow init". There is also a "fast init". The fast init does not use the 5 baud init as descibed above but starts directly at 10.4 kbps. A StartCommunication request 0xc1, 0x33, 0xf1, 0x81, 0x66 must be submitted prior submitting requests. I don't have a car which supports this fast init so maybe someone can help including it in this code to help others.

You can easily change the code if you want to have miles instead of km.

For simplicity no checksum is checked.

The code can be imported in Microchip MPLAB X IDE v3.20 with compiler XC8 v1.36. For programming the 16f886 microcontroller you need a programmer like pickit2 or pickit3.

A hex file is included in case you want to program the 16f886 with your own programming software/device.

Step 6: Have Fun

I hope you like this project. Have lots of fun building it and monitoring your verhicle!

If you are interested but not able to buid yourself just contact me. Maybe I can help with a programmed microcontroller or complete kit.

"This most beautiful system of the sun, planets and comets,
could only proceed from the counsel and dominion
of an intelligent and powerful Being."

~ Isaac Newton, Principia

2 People Made This Project!


  • Casting Contest

    Casting Contest
  • Microcontroller Contest

    Microcontroller Contest
  • Make it Move Contest

    Make it Move Contest

We have a be nice policy.
Please be positive and constructive.




And picture with fast init sequence:



1396amir and milani1387:

I have Sagem S2000-1 on the table and it "IS OBD compliant", but it has errors in implementation in some ways.
(ECU is 9643786680-01, hope it comes from 6FZ/EW7J4 engine, but I am not sure about it.)

first problem:
There is a long time (longer than standard allows) between a tester command and an ECU answer.
ECU answers (just after fast init pattern) after 130ms, but ISO14230 says max. 50ms. Due this, for example Bosch tester model 560 is not able to connect it (it waits for an answer for cca 80ms). See picture.

second problem:
I must have unconnected L-line (pin B3 on ecu).
Once I have it connected to L-line (+12Volt from tester 510ohm resistor), ECU does not
response to fast init patter at all.
Really don't know why. Maybe due to my wiring on the table without any sensors ???

If you will have any news, pls. leave an info here.

Hi this is for milani1387

The ecu's you are trying to connect are NOT OBDII at all but if you use peugeot 206 bosch ecu with automatic transmission (gearbox) you can connect to ecu and see some data

hi bro. why is your last bit of 0x33 is low. in other document, 0x33 is send in 5 baud of speed that include 1 start-low 8 bit 0x33 and 1 stop bit- high. it 's usart frame too.

Hi, will be possible to send data from chip to Raspberry pi by i2c?


hi,which software you use to see the byte transmitting and receiving ?

1 reply

Hi Phanhust,

I use the debugger in the mplabx software. Here I see the received data of the mcu in an array.

Kind regards,


hi richard

how i can define 3 byte of car 's address?

in my case. i use for motorbike so what is different between car and motor bike??

majority of motorbike in asia also using communication on iso 9141 and iso 14230


1 reply

Hi Phanhust,

The best way is to read specifications about your motorbike. Somewhere there must be described how to communicate with the ecu.

Kind regards,



it have low capaCITY OF flash memory

Thanks milani, today i bought 16f886 and will try it.

thanks mr richard
i am sure that sagem s2000 suppurts two protocol of can and iso9141
but in this ecu i have connected to kline port....
what is it the name of ecu you connected them??
dear mr richard
what is it your country and city...??

2 replies

Hi Milani,

I use it in my Citroen C1 of 2013. I also tried VW Touran of 2003.


What is it the name and version of your car ecu???

mr richard
i am tested the sagem s2000 with elm327obd china kit
in the menu of the android aplication writed iso14230-4kwp fast
Correct you, be
it seems that protocol of my ecu iso14230-4kwp fast and not iso9141
any way..
can this source connect to iso14230-4kwp???
what is it need to change??

2 replies

Hi Milani,

If it is KWP 2000 fast (as described in ISO 14230-4) then you can try deleting lines 79-89, 97, 100-126 and 128-154. This will remove the 5 baud initialization sequence which is not needed when KWP 2000 fast is used. I did not test this since I don't have a car which support this protocol. Can you help me by deleting the lines and test on your ecu?

Kind regards,


Hi mr richard..
Thanks for helping
I have accsee to some ecu with some protocol
I want developed this project and
Set fast init of kwp2000 with this circuits
I will change the code from 5 baud init to fast init of kwp2000 ... and test on my ecu....
I know that citroen xantia supoorted slow init of kwp2000
Iwant to test on this car

hi mr richard
i am created new project in the mplab ....source code compiling is ok
but is not any diffrenc from pic16f886 and 883 ...
but the cpacity of flashmemory of the 886 is large
any way...
in the my circuit all of the wire or componet is ok
i have tested all of the componet...
and the transitor circuits for trans or reciving is ok....
i have connected pin rx and tx of micro to logic analayzer
micro send some code...
but dont recive any code from ecu....
it have send this logic rc6 port
PORTCbits.RC6 = 1;
PORTCbits.RC6 = 0;
PORTCbits.RC6 = 1;
PORTCbits.RC6 = 0;
PORTCbits.RC6 = 1;
PORTCbits.RC6 = 0;
RCSTAbits.SPEN = 1; //enable eusart
RCSTAbits.CREN = 1; //receive enable

int iso;
while (RCIF == 0);

i have debuging the source code....when program going to while (RCIF == 0);
program rseseted and begin......Regularly repeats
and program in the while (RCIF == 0); stoped and repeated from begin of source code...
it means that micro is ok and send command code.... but not recive any code from ecu...
circuit and micro is ok
i have tested with sagem s2000 and sagem sl96 citroen and peugeot ecu
the protocol of sagem s2000 ecu is iso9141.....
i have uploaded pic of my project and logic analayzer...

1 reply

Hi Milani,

I see the initialization sequence in the picture you are referring to. It looks correct but the timing is not visible. Can you check if the timing is 5 bits per second as described in step 2? Just to be sure since you are using not original program software. Also visible is the watchdog of your microcontroller since there is no response from ecu in time. So far so good. I see that you are not connecting this project to a car but to the device of the car where the ecu is located. Then you must know that ecu will only respond when the car is started (please see the video before step 1). Not sure if you can achieve this state since it is not connected to a car. Anyhow, you need to focus on ecu or circuit between microcontroller and ecu. Do you have better picture of circuit?

Kind regards,