StoryThe idea to connect the smartphone to the onboard system of the car arose for a long time. The trigger was a read article on e-stuffing of modern cars and CAN buses, which allows you to exchange data with various devices connected to this bus.

The imagination painted the rainbow pictures of the “rob-mobile” fully controlled from a smartphone, recording and optimizing all the parameters of the engine and systems, warning of critical parameters and errors in operation. Well, okay, with the controls, this is probably too much, because besides digital sensors, some controllers with servo drives will also be needed here ...
The picture faded a little, but we will be able to read the available parameters, and if we are lucky, we can also open / close the central lock (although this prospect promises a hole in the Wind security system ... i.e. a car :))
And so, it's time to start a practical study!
')
Study
The car was available, and now it was necessary to figure out how to connect to it. Connect to the diagnostic connector (DLC -
Data Link Connector ). This connector is used to connect diagnostic scanners (which are “computer diagnostics”) to the vehicle’s on-board network and to poll / retrieve data from various subsystems of the vehicle.
Looking at the variety of car brands, scanners, connectors, there was a slight panic, how to deal with all this “zoo”, or at least how to find an option for your car? Fortunately, thanks to one of the US environmental agencies (namely, the California Air Resources Board - CARB), which was striving for unified control of vehicle emissions, standardization has reached this area.
Actual at the moment is a set of
standards OBD-II , which describes the mechanical (shape and size of the connector), electrical (power, signaling protocols) and logical (information protocols) levels of compatibility.
It should be noted here that compliance with one of the parameters does not guarantee compliance with the others. Those. The presence of the correct mechanical connector in the car does not guarantee compliance with the standard signal and logical protocols, that is, does not necessarily ensure compliance with OBD-II standard.TheoryConsider the above compatibility levels:
- Mechanically, this is a fixed-size trapezoid connector with 16 pins.
- At the electrical level, 5 main signaling protocols are supported: SAE J1850 PWM, SAE J1850 VPW, ISO 9141-2, ISO 14230 KWP2000, ISO 15765 CAN
- The logical level involves sending messages of a given structure and, accordingly, receiving a structured response. A package consists of a header, a message body, and a checksum
.
:
.
• (1 ) , 01 – , 02 – «» ..
• (1 2 ) — Parameter ID, , mode 01 pid 0D .
, 68 6C F1 01 0D A6, header = 68 6C F1, body = 01 0D, crc = A6.
:
• <mode+0x40>
• 7F<pid | mode>
•
.
, 48 6B 10 41 0D 00 11, header = 48 6B 10, body = 41 0D 00, crc = 11, .. 00
, , « » :-) ! «- »?!… , , OBD-II :-(. , . , , : , , . , OBD-II , , .
:
, , , . , (, , , , ..); , CheckEngine; . ; , ;
– . – .
, (. 2 ): , , .
, !
..
, - 2, 3
.
:
.
• (1 ) , 01 – , 02 – «» ..
• (1 2 ) — Parameter ID, , mode 01 pid 0D .
, 68 6C F1 01 0D A6, header = 68 6C F1, body = 01 0D, crc = A6.
:
• <mode+0x40>
• 7F<pid | mode>
•
.
, 48 6B 10 41 0D 00 11, header = 48 6B 10, body = 41 0D 00, crc = 11, .. 00
, , « » :-) ! «- »?!… , , OBD-II :-(. , . , , : , , . , OBD-II , , .
:
, , , . , (, , , , ..); , CheckEngine; . ; , ;
– . – .
, (. 2 ): , , .
, !
..
, - 2, 3
.
:
.
• (1 ) , 01 – , 02 – «» ..
• (1 2 ) — Parameter ID, , mode 01 pid 0D .
, 68 6C F1 01 0D A6, header = 68 6C F1, body = 01 0D, crc = A6.
:
• <mode+0x40>
• 7F<pid | mode>
•
.
, 48 6B 10 41 0D 00 11, header = 48 6B 10, body = 41 0D 00, crc = 11, .. 00
, , « » :-) ! «- »?!… , , OBD-II :-(. , . , , : , , . , OBD-II , , .
:
, , , . , (, , , , ..); , CheckEngine; . ; , ;
– . – .
, (. 2 ): , , .
, !
..
, - 2, 3
.
:
.
• (1 ) , 01 – , 02 – «» ..
• (1 2 ) — Parameter ID, , mode 01 pid 0D .
, 68 6C F1 01 0D A6, header = 68 6C F1, body = 01 0D, crc = A6.
:
• <mode+0x40>
• 7F<pid | mode>
•
.
, 48 6B 10 41 0D 00 11, header = 48 6B 10, body = 41 0D 00, crc = 11, .. 00
, , « » :-) ! «- »?!… , , OBD-II :-(. , . , , : , , . , OBD-II , , .
:
, , , . , (, , , , ..); , CheckEngine; . ; , ;
– . – .
, (. 2 ): , , .
, !
..
, - 2, 3
.
:
.
• (1 ) , 01 – , 02 – «» ..
• (1 2 ) — Parameter ID, , mode 01 pid 0D .
, 68 6C F1 01 0D A6, header = 68 6C F1, body = 01 0D, crc = A6.
:
• <mode+0x40>
• 7F<pid | mode>
•
.
, 48 6B 10 41 0D 00 11, header = 48 6B 10, body = 41 0D 00, crc = 11, .. 00
, , « » :-) ! «- »?!… , , OBD-II :-(. , . , , : , , . , OBD-II , , .
:
, , , . , (, , , , ..); , CheckEngine; . ; , ;
– . – .
, (. 2 ): , , .
, !
..
, - 2, 3