Design and Implementation of A Wireless OBD II Fleet Management System
Design and Implementation of A Wireless OBD II Fleet Management System
9, SEPTEMBER 2014 1
TABLE I
Abstract—This paper describes the work that has been done OBD II PIN CONNECTION ADAPTED FROM [1]
in the design and development of a wireless OBD II fleet
management system. The system aims to measure speed, distance Pin Number Description Pin Number Description
and fuel consumption of vehicles for tracking and analysis 1 unconnected 9 unconnected
arXiv:1701.02160v1 [cs.NI] 9 Jan 2017
capabilities for remote position vehicle tracking and system ELM integrated chips (ICs) were used to interpret the different
diagnosis, few systems provide the capability for an automated OBD II communication protocols to allow for interfacing with
fleet management. different car types. The system used an RS-232 interface
This paper exploits OBD II, GPS, and WiFi technologies between the OBD reader and a mobile phone and sent data in
to present the design and development of an OBD II-based real-time via GPRS.
system for fleet management. The developed OBD II reader The study in [12] used an OBD II reader for acquiring
can connect to a vehicle’s OBD II port and read real-time real time vehicle parameters from the controller area network
sensor data from a vehicle’s ECU [7], [8]. The OBD II reader (CAN) bus of a hybrid electrical vehicle. The OBD II reader
is designed such that it is portable, can be interfaced with any used the ELM 327 IC to interpret the CAN protocol. The data
vehicle model and does not interfere with the driving functions was received wirelessly by an Android device over a Bluetooth
while connected. The system provides measurements of speed, network and from the android device, data was sent via GPRS
distance travelled and fuel consumption. Fuel consumption is to a remote server.
computed from the sensor data, since it cannot be directly The impact of driving behaviour on fuel consumption was
measured by the OBD II reader. Position or location of monitored in [13] by measuring various parameters such as
the vehicle is also determined by means of a GPS module. mass air flow using a Bluetooth OBD II reader. An Android
Data from the OBD II reader is transmitted to a remote application was used to view the parameters measured for
server over a WiFi network. The use of the WiFi network is analysis. The measured data was then sent to a web-based
considered in this work due to its dominance in the range of remote server. This system exploits the advantage of vehicle
technologies for building general purpose wireless networks. on-board systems by using accessible parameters to perform
A database management system is implemented for the storage fuel consumption calculations.
and management of transmitted data and a graphical user The study in [14] implemented an Android-based applica-
interface (GUI) is developed for analysing the transmitted data. tion that monitored the vehicle via an OBD II interface by
The rest of this paper is organised as follows. Section II measuring the air-bag trigger and G-force experienced by the
reviews the related works that were investigated and consid- passenger during a collision, to detect accidents.
ered important to this project. Section III provides a brief In most of the studies above, the OBD II reader acted as
overview of the modules of the system. Section IV describes an interface between a mobile device and the ECU of the
the design and implementation of the system. The observations vehicle. When performing individual vehicle diagnostics or
and results are discussed in Section V, and finally the paper monitoring, these designs would be suitable. However for fleet
concludes with Section VI. management systems, solutions that are independent of the
type of vehicle and mobile devices in use, are required.
II. RELATED WORK It was also observed from the studies above that real time
vehicle parameters can be measured, however there is a limita-
Various OBD II systems have thus been designed in recent tion in the parameters measurable using standard PIDs defined
years to solve automotive related problems. Some of these by OBD II. The distance travelled and fuel consumption, for
works are discussed below. instance, do not have standard PIDs. These parameters will
The integration of OBD II and wireless communication have to computed from measurable parameters such as mass
technologies was observed in [3], where an OBD II system air flow and speed. There are more traditional methods of
that measured real time vehicle data was built. The system measuring speed , as explained in [15]. These include the
interfaced with a car’s ECU through the OBD II connector. use of magnetic sensors, average speed cameras and infra-
The data received from the ECU was then transmitted to a red devices [16] which are normally placed on the road. A
remote device via Bluetooth, WiFi, or WCDMA in hexadeci- disadvantage of using these sensors is that speed can only be
mal format. The study mainly focused on integrating various measured at specific points and not continuously.
wireless communication technologies to connect to various
mobile devices. The monitored parameters included vehicle
III. S YSTEM OVERVIEW
speed and engine revolution per minute (RPM). A flaw in this
system is that the received data is not meaningful to a casual A basic overview of the system is given in Figure 1. The
user as the hexadecimal data requires decoding. ECU of the vehicle is interfaced with various sensors (sub-
A system for verification of engine information and diagno- system 1), from which vehicle parameters can be measured.
sis of engine malfunction using a Bluetooth OBD II scanner The OBD II reader (subsystem 2) will be microcontroller
was developed in [9]. An Android device was used to receive based and will thus also be responsible for the control of the
the measured or diagnostic data. The system mainly focused overall system. The processed data from subsystem 2 will be
on defining a protocol that enabled transmitting and receiving transmitted wirelessly to a remote server (subsystem 3) for
of OBD II data from multiple sensors simultaneously. This data storage and display.
study focused on real-time diagnosis of the engine condition, The detailed functions of the subsystems are shown in
and data was only made available to the driver of the vehicle. Figure 2.
In [10] an OBD system for obtaining engine diagnostic Data acquisition is performed by the vehicle ECU for
data for air-pollution monitoring was integrated with general measurement of the speed, distance travelled and fuel con-
packet radio service (GPRS) and GPS technology [11]. Three sumption (FU 1.1-1.2). The software to simulate the ECU
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 3
TABLE II
T HE OBDII AND AT C OMMANDS SENT FROM THE ELM 327.
Command Description
1 ATZ Reset
2 ATSP0 Set protocol to auto
3 ATE0 Echo off
4 ATFE Forget events
5 ATS0 Print spaces off
6 0100 Search for set protocol
7 010D Speed PID
Fig. 5. An Example of Request and Response Message Sent for Measuring 8 0110 MAF PID
Speed.
Fig. 8. The CAN Data Bus Lines. of these states is based on the value of the differential voltage
between CAN high and CAN low data lines. A dominant state
is typically when the differential voltage is less that 0 V and a
1) CAN Protocol interface: The CAN standard was devel- recessive state is when the differential voltage is greater than
oped by a company called Bosch for automotive applications. 1.2 V.
It was deemed mandatory for all vehicles manufactured from 2) OBD II ISO 9141-2 interface: The ISO 9141-2 protocol
2008 to implement CAN as the standard OBD II protocol. works on a 10.4 kbps rate. A transmission to the ECU is
There are two formats of the CAN protocol with 125 kbps initialized by sending a 0x33 code at 5 bps. This is referred
and 500 kbps data transmission rates. The 125 kbps format is to as slow initialisation as opposed to fast initialisation used
referred to as low speed and the 500 kbps as high speed. by ISO 14230-4. ISO 9141-2 works on a high 12 V active
The CAN bus standard defines different CAN bus architec- voltage and a low 0 V passive voltage. It has a single line
tures which include a single line and two line bus architecture. of communication referred to as K line, where all vehicle
Automotive applications, including OBD II mostly employ the ECUs are connected in automotive applications. There may
double line CAN bus architecture. The double line architecture optionally be an additional L line. The K line is accessed
has transmit and receive lines which connect to different through pin 7 of the OBD II connector. The maximum data
nodes on the bus line, as shown in Figure 8. Nodes are the length is 12 bytes. ISO 14230-4 is similar but differs in
different subsystems which can be addressed. The two lines data length and initialisation as mentioned previously. The
of communication are also referred to as CAN high and CAN maximum data length is 255 bytes [9].
low which are characterised by a differential voltage of 5 V
The CAN protocol interface circuit is connected to pin
and a termination input impedance of 120 Ω.
23 (CAN TX) and pin 24 (CAN RX) of the ELM327 via
The structure of CAN messages is different from other
the MCP2551 which is a CAN transceiver IC. The trans
OBD II messages. CAN messages also come in two formats
receiver acts as an interface between the vehicle CAN bus and
depending on the number of identifier bits as shown in
the ELM327 which is responsible for controlling the CAN
Figure 9. The identifier bits define the message priority and
bus. Controlling the CAN bus entails the transmission and
identification of the message stream. A CAN message can
reception of data on the bus. The trans receiver has CAN
either have 11 identifier bits, which is for low speed CAN
high and CAN low pins which are connected similarly to
that operates at a transmission rate of 250 kbps or 29 identifier
the physical vehicle bus via pin 6 pin and pin 14 of the
bits for high speed CAN operating at 500 kbps. The data field
OBD II connector as shown in Figure 10. Resistors R1 and
which contains the actual data being transmitted on the bus is
R2 both of value 100 Ω, are connected to CAN high and
8 bytes long and finally checksum bits are defined.
CAN low because the ISO 15765-4 requires that a termination
CAN defines states for signals transmitted on the bus line.
impedance between 90 Ω and 110 Ω on both CAN high and
These signals are just sequences of logic high and logic low
CAN low lines. Similarly a termination capacitance of 470 pF
voltages also referred to as ones and zeroes respectively. The
to 640 pF is required. It is for this reason that the values of C2
CAN protocol defines a logical high as a recessive state while
and C3 were chosen as 560 pF. Resistor R3 is connected to
a logical low is referred to as dominant state. The definition
pin RS of the MCP2551 to control the transition CAN line. A
0.1 µF capacitor was connected between the positive supply
and ground for decoupling and filtering noise in the power
line.
The interface circuits for the ISO 9141-2 and ISO 14230-
4 protocols are controlled by two NPN transistors which are
Fig. 9. The Structure of a CAN Message. configured as switches. This is because of the fact that vehicle
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 6
Fig. 14. An Example of the GLL Message Transmitted by the GPS Module.
Fig. 17. Test Setup of the OBD II Reader Connected to the Emulator.
Fig. 20. The Relationship Between Distance Covered by the Vehicle and
Time.
R EFERENCES
[1] OBD II Scan Tool Equivalent to ISO/DIS 15031-4, SAE Std. J1978
199 203, 2001.
[2] E/E Diagnostic Test Modes Equivalent to ISO/DIS 15031-5, SAE Std.
J1979 200 204, 2002.
[3] S.-H. Baek and J.-W. Jang, “Implementation of integrated obd-ii con-
nector with external network,” Information Systems, vol. 50, pp. 69–75,
2015.
[4] Diagnostic Connector Equivalent to ISO/DIS 15031-3, SAE Std. J1962
Fig. 22. The Relationship Between Distance Covered by the Vehicle and 201 207, 2001.
Time. [5] H. Billhardt, A. Fernandez, L. Lemus, M. Lujak, N. Osman, S. Os-
sowski, and C. Sierra, “Dynamic coordination in fleet management
systems: Toward smart cyber fleets,” IEEE Intelligent Systems, vol. 29,
no. 3, pp. 70–76, 2014.
[6] G. S. Larue, H. Malik, A. Rakotonirainy, and S. Demmel, “Fuel
consumption and gas emissions of an automatic transmission vehicle
following simple eco-driving instructions on urban roads,” Intelligent
Transport Systems, vol. 8, no. 7, pp. 590–597, 2014.
[7] R. M. Jaco Prinsloo, “Accurate vehicle location system using rfid, an
internet of things approach,” AD Hoc Networks, vol. 16, pp. 1–24, 2016.
[8] R. M. F. X. R. W. Zhongqin Wang, Ning Ye, “Trackt: Accurate tracking
of rfid tags with mm-level accuracy using first-order taylor series
approximation,” AD Hoc Networks, vol. 53, pp. 132–144, 2016.
[9] H.-S. Kim, S.-J. Jang, and J.-W. Jang, “A study on development of
engine fault diagnostic system,” Mathematical Problems in Engineering,
vol. 2015, 2015.
[10] C. E. Lin, Y.-S. Shiao, C.-C. Li, S.-H. Yang, S.-H. Lin, and C.-Y. Lin,
“Vehicle speed measurement and law enforcement,” IEEE Transactions
on Vehicular Technology, vol. 56, no. 3, pp. 1108–1118, 2007.
[11] R. M. R. W. P. L. Zhongqin Wang, Ning Ye, “”tmicroscope: Behav-
ior perception based on the slightest rfid tag motion,” Elektronika ir
Elektrotechnika, vol. 22, no. 2, pp. 114–122, 2016.
[12] Y. Yang, B. Chen, L. Su, and D. Qin, “Research and development of
Fig. 23. The Relationship Between Speed and Fuel Consumption. hybrid electric vehicles can-bus data monitor and diagnostic system
through obd-ii and android-based smartphones,” Advances in Mechani-
cal Engineering, vol. 5, pp. 74–89, 2015.
[13] J. E. Meseguer, C. T. Calafate, J. C. Cano, and P. Manzoni, “Assessing
measurements. This was further confirmed when the system the impact of driving behaviour on instantaneous fuel consumption,” in
was tested on a real car and measurements from speed and 12th Annual IEEE Consumer Communications and Networking Confer-
MAF sensors were successful. ence (CCNC), 2015, pp. 443–448.
[14] J. Zaldivar, C. Calafate, J. Cano, and P. Manzoni, “Providing accident
The design integrates different technologies which can detection in vehicular networks through obd-ii devices and android-
reduce the cost of buying multiple devices with different based smartphones,” in IEEE 36th Conference on Local Computer
capabilities. The design also incorporates the measurement of Networks (LCN), 2011, pp. 813–819.
[15] G. Geatrix, “Vehicle speed measurement and law enforcement,” Mea-
parameters not readily available with most OBD II interfaces, surement and Control, vol. 44, no. 8, pp. 249–251, 2011.
such as GPS tracking, speed and fuel consumption. [16] X. Z. W. A. R. M. Xiangjun Jin, Jie Shao, “Modeling of nonlinear system
The measurements of the distance travelled by the car based on deep learning framework,” Nonlinear Dynamics, vol. 84, no. 3,
pp. 1327–1340, 2016.
showed an error of approximately 5% which was computed [17] R. M. Y.-y. Z. R.-c. W. Ning Ye, Zhong-qin Wang, “A method of vehicle
by using the final sample on the distance plot and due to the route prediction based on social network analysis,” Journal of Sensorss,
1 s sampling period. vol. 15, pp. 1–10, 2015.
It was also observed that when the vehicle’s engines were
turned off, the system power also shut down. This resulted in
the loss of wireless communication and GPS location tracking.
As was noted above the communication range for the Dr. Reza Malekian Reza Malekian (M’10) is cur-
WiFi connection between the remote PC and OBD II reader rently an Associate Professor with the Department
of Electrical, Electronic, and Computer Engineering,
decreases as distance increases, for future work a GSM system University of Pretoria, Pretoria, South Africa. His
could be considered as part of the communication unit. current research interests include Internet of Things,
Further development can include a battery backup system Sensors and Systems, and mobile communications.
Prof. Malekian is also a Chartered Engineer and
that supplies power to the rest of the system components a Professional Member of the British Computer
when the vehicle’s engines are turned off. Thus enabling Society. He is an associate editor for the IEEE
continued wireless communication and GPS location tracking. Internet of Things Journal.
The delay resulting from the initialisations of the system could
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 11