Difference between revisions of "HANcoder/Training Material/OBD Reader"

From OpenMBD
Jump to: navigation, search
(Created page with "{{HANcoder}} == General description == One of the supported hardware protocols in the OBD connector is CAN. So it is possible to read out the OBD information when you can sen...")
 
Line 2: Line 2:
  
 
== General description ==
 
== General description ==
One of the supported hardware protocols in the OBD connector is CAN. So it is possible to read out the OBD information when you can send CAN messages. This section shows how you could do this with the E407 and HANcoder.  
+
OBD stands for On Board Diagnostics, since the introduction of the second version of OBD, simply named OBD2, there is a standardized list of Diagnostic Trouble Codes. Similarly there are standard Parameter ID's to get information like the throttle position and RPM from the car. OBD2 supports several communication protocols but cars from 2008 must have a CAN implementation. So it is possible to read out the OBD2 information when you can send and receive CAN messages. This section shows how you can do this with the E407 and HANcoder.  
  
 
== Hardware ==
 
== Hardware ==
To connect the E407 to the car there is some hardware needed. The E407 doesn't have a CAN transceiver so this has to be mounted externally. For this example we will use the [[HANcoder/Examples/SN65HVD230|SN65HVD230]] but you can use another if you desire.
+
To connect the E407 to the car some hardware is needed. The E407 doesn't have a CAN transceiver so this has to be mounted externally. For this example we will use the [[HANcoder/Examples/SN65HVD230|SN65HVD230]] but you can use another if you desire.
 
Now we still need a cable between the car and the [[HANcoder/Examples/SN65HVD230|SN65HVD230]]. For this there are OBD2 cables available on the internet.
 
Now we still need a cable between the car and the [[HANcoder/Examples/SN65HVD230|SN65HVD230]]. For this there are OBD2 cables available on the internet.
  
 
=== Connection diagram ===
 
=== Connection diagram ===
 
[[File:Example.jpg| ConnectionDiagram]]
 
[[File:Example.jpg| ConnectionDiagram]]
 +
 +
 +
== Simulink Model ==
 +
A simple simulink model has been made to illustrate how to get the information from the car. To understand this section some knowledge about the OBD2 protocol is required. It should also be understood that there is a limit to the amount of messages that the car can send, thus the rate of information depends on the amount of different PID's that are requested. This is not a limit of the CAN bus bandwidth but of the implementation of the protocol in the car.
 +
 +
=== Initialisation ===
 +
The OBD2 information will be read over CAN so the CANbus should be initialized. In this example CAN channel 2 is used for the OBD2 communication. According to the standard the baudrate can either be 250kb/s or 500kb/s and the identifiers can be normal (11-bit) or extended (29-bit). Check the baudrate and identifier type of your car and use these in the CAN initialization block. In this demo we will be using a Volkswagen Up and it has a 500kb/s CAN bus and it uses the standard identifiers.
 +
 +
 +
 +
=== Sending the PID requests ===
 +
 +
=== Receiving the data ===
 +
 +
=== Processing the data ===

Revision as of 14:52, 6 April 2017


General description

OBD stands for On Board Diagnostics, since the introduction of the second version of OBD, simply named OBD2, there is a standardized list of Diagnostic Trouble Codes. Similarly there are standard Parameter ID's to get information like the throttle position and RPM from the car. OBD2 supports several communication protocols but cars from 2008 must have a CAN implementation. So it is possible to read out the OBD2 information when you can send and receive CAN messages. This section shows how you can do this with the E407 and HANcoder.

Hardware

To connect the E407 to the car some hardware is needed. The E407 doesn't have a CAN transceiver so this has to be mounted externally. For this example we will use the SN65HVD230 but you can use another if you desire. Now we still need a cable between the car and the SN65HVD230. For this there are OBD2 cables available on the internet.

Connection diagram

ConnectionDiagram


Simulink Model

A simple simulink model has been made to illustrate how to get the information from the car. To understand this section some knowledge about the OBD2 protocol is required. It should also be understood that there is a limit to the amount of messages that the car can send, thus the rate of information depends on the amount of different PID's that are requested. This is not a limit of the CAN bus bandwidth but of the implementation of the protocol in the car.

Initialisation

The OBD2 information will be read over CAN so the CANbus should be initialized. In this example CAN channel 2 is used for the OBD2 communication. According to the standard the baudrate can either be 250kb/s or 500kb/s and the identifiers can be normal (11-bit) or extended (29-bit). Check the baudrate and identifier type of your car and use these in the CAN initialization block. In this demo we will be using a Volkswagen Up and it has a 500kb/s CAN bus and it uses the standard identifiers.


Sending the PID requests

Receiving the data

Processing the data