Вы находитесь на странице: 1из 7

2012 IEEE 16th International Symposium

Android-Based Universal Vehicle Diagnostic and


Tracking System
Ashraf Tahat, Ahmad Said, Fouad Jaouni, Waleed Qadamani
Communications Engineering Department
Princess Sumaya University for Technology
Amman, Jordan
aat@ieee.org

Abstract—This system aims to provide a low-cost means of advantages to high-end vehicle models. A new business
monitoring a vehicle’s performance and tracking by opportunity that provides customer-oriented vehicle diagnosis
communicating the obtained data to a mobile device via and remote maintenance can be offered; Extraction of fault
Bluetooth. Then the results can be viewed by the user to monitor
fuel consumption and other vital vehicle electromechanical
detection and sensor output signals from the engine control
parameters. Data can also be sent to the vehicle’s maintenance unit (ECU) according to the OBD-II standard, vital vehicle
department which may be used to detect and predict faults in the information can be displayed to users, or/and communicated to
vehicle. This is done by collecting live readings from the engine remote maintenance departments via cellular networks [5], [6],
control unit (ECU) utilizing the vehicle’s built in on-board where relatively newer cellular access technologies offer
diagnostics system (OBD). An electronic hardware unit is built future solutions endless choices for high-end applications [7],
to carry-out the interface between the vehicle’s OBD system and
a Bluetooth module, which in part communicates with an
[8]. Hence, if a correct diagnoses (or prediction) of a defect is
Android-based mobile device. The mobile device is capable of available, instructions and commands can be sent to the driver
transmitting data to a server using cellular internet connection. on how to proceed in that situation. Also, if the system has
knowledge of the location, in addition to an error category, the
I. INTRODUCTION system can direct the vehicle to the closest vehicle service
location in the vicinity.
Nowadays, vehicle navigation and location concept is well
However, these suggested solutions and systems need
defined and is frequently used. That was a result of a lot of
external dedicated hardware components and specialized
research efforts which were invested in developing its
software applications running on a laptop to display obtained
components and ideas [1], [2]. Also, in recent years, the
data to the user as most vehicles do not have built in screens.
problem of diagnoses of defects and faults on a remote vehicle
This can pose an added cost and may be applied to a limited
has received considerable attention as a result of several
group of vehicles.
factors: 1) The relatively unprecedented advancement of
We present in this paper a low-cost, simplified, yet versatile
communications technologies and the availability of various
vehicle diagnostic system that is compatible with all vehicles
broadband data services. 2) The current changes in the
manufactured after 1996 (OBDII compliant). The graphical
automobile industry trends where vehicles are developed with
user-interface (display and command) is Andriod-based and
a particular focus on eco-friendliness [3], [4] safety, besides
utilizes the popular personal area network (PAN)
comfort. Additional services and safe and convenient
communications standard Bluetooth to facilitate extraction and
automatic internal control systems have been introduced to
relaying of readings, diagnostic trouble codes (DTC), and
satisfy the customers’ needs. 3) Collection and analysis of
commands. We have chosen a smart phone as the computing
diagnostic data from electronic control units is of paramount
device for the obvious growth and demand on such mobile
importance in the automotive industry, both from a life cycle
devices, in addition to reducing the overall system cost by
support perspective post production and sales, and as a tool in
utilizing the built-in functionalities that is integrated in such
the product development [5]. For pre-series test vehicles,
compact devices. Also, when installed properly, such devices
access to diagnostic data is crucial in order to be able to track
can be a low cost alternative to integrated navigation systems
problems as early as possible in the development process,
[1]. Moreover, our choice of Android as our operating system
preventing serious faults to pass undetected into production
platform is consistent with current market trends and shares
vehicles. Therefore, Information technologies must be added
and user acceptance of such platform [9].
as software to enable, facilitate, and enhance achievement of
the above goals.
Built-in automobile navigation systems are being equipped II. SYSTEM OVERVIEW
with various multimedia capabilities to satisfy the customer The purpose of our Android-based user-interface vehicle
expectations of modern functions and features and offer diagnostic system implemented in this work is the execution
diverse services in the current greatly competitive market of diagnoses on a remote vehicle using internationally agreed
state. This reflects on the overall system cost and limits the data trouble codes.

978-1-4673-1356-8/12/$31.00 ©2012 IEEE 137


Hardware Software

OBDII ELM327 LINK- Mobile Server


System MATIK 2.0 Device

Fig. 1. System overall architechure.

We depict in Fig. 1 the implementation of a simple In 1987, all vehicles sold in California are required to have
diagnostic system which can be readily available to the some basic OBD capability. These requirements are referred
average user and because the system offers easy to understand to as OBD I, though the data link connector and its position
information for drivers and for specialists. All vehicles are not standardized, nor is the data protocol. OBD-1.5 also
manufactured after 1996 have built in OBDII system. known as pre-OBD-II set a part of the standard now used by
However, these OBD systems are not being efficiently utilized defining the pin layout of the ALDL.
since obtained data is not made use of and cannot be displayed The OBD-II specifications in 1994 issued by California Air
to the user as most vehicles do not have built in screens [2]. Resources Board, was made mandatory by 1996 for all cars
The vehicle's ECU stores only diagnostic trouble codes when sold in the US. OBDII is an improvement over OBD1.5 in
there is a reading that is out of range but all other readings are both capability and standardization. The standard specifies the
not being made use of. If these readings are analyzed they can type of diagnostic connector and its pin-out, the electrical
be used to predict faults and prevent them. The readings signaling protocols and the messaging format. It also provides
obtained from the sensors need to be transmitted to a remote a candidate list of vehicle parameters and the message format.
server held at the maintenance department, where they can be The OBDII system operates in one of five protocols:
processed and analyzed to: 1) Detect faults present in the • SAE-J1850 pulse width modulation.
vehicle 2) Predict faults that may occur in the future. The • SAE-J1850 Variable pulse width modulation.
geographical position of the vehicle is also transmitted to make • ISO-14230 keyword protocol 2000.
it possible to service minor faults at the site. Moreover, real- • ISO-15765 Controller Area Network (CAN).
time data collection and storage in a dedicated database can be
• ISO-9141-2 protocol.
easily configured. The overall basic system’s blocks are shown
in Figure 1 and each block will be elaborated upon Each vehicle uses one of these protocols. In our system, we
individually in the rest of this document interface to a vehicle using the ISO9141-2 protocol.
The female 16-pin (2x8) J1962 connector is the standard
A. On-Board Diagnostic Systems (OBD) connector for OBDII. It is required to be within two feet of
By 1960 there was a significant rise in the number of the steering wheel. Fig. 2 shows the pin layout of the data link
vehicles in the US, which led to an increase in the air pollution connector (DLC). There are several protocols compatible with
levels. Hence the need for regulations to minimize the the OBD standard.
influence on air pollution was necessary. For this purpose in B. ELM327
1963, Congress passed The Clean Air Act and later The Air
The ELM327 is originally an 18F2480 PIC (Peripheral
Quality Act was passed in 1967. There were several attempts
Interface Controller), and is programmed by ELM Electronics
to interface the vehicle’s ECU to monitor and control the
[10]. It acts as an interface between RS232 and OBDII for
vehicle’s engine byproducts. These Earlier versions had low
systems that use the ISO-15765-4 CAN, SAE-J1850 PWM,
baud rates and were half-duplex, while later versions went for
SAE-J1850 VPW, ISO-9141-2, ISO-14230-4 and SAE-J1939
higher baud rates and used full-duplex communications. One
protocols, which are adopted by different vehicle models.
example is general motors’ Assembly Line Diagnostic Link
PICs in general however are a family of microcontrollers
(ALDL) known as the predecessor to OBD I.
made by Microchip Technology®. ELM327 is a 28 pin micro-

138
PIN Description. PIN Description
1 Vendor Option 9 Vendor Option
2 J1850 Bus + 10 J1850 Bus
3 Vendor Option 11 Vendor Option
4 Chassis Ground 12 Vendor Option
5 Signal Ground 13 Vendor Option
6 CAN (J-2234) High 14 CAN (J-2234) Low
7 ISO 9141-2 K-Line 15 ISO 9141-2 Low
8 Vendor Option 16 Battery Power

Fig. 2. Pin lay-out for the DLC .

-controller that supports all OBD protocols. It automatically


identifies and interprets the protocol, also it is a low power Fig. 3. ELM listening mode flowchart.
CMOS that provides support for high speed communications,
with the ability to be programmed using AT commands. the ECT. When this command was sent, the reply was 41 05
As mentioned previously, the OBD commands consist of 2 75 where 41 05 means response for mode 1 PID 05, and the
bytes (sometimes more), with the first byte as the mode byte value 75 is the coolant temperature; obviously this number is
and the second as the PID byte which defines the command. in hexadecimal which needs to be converted to decimal value:
Note that any command entered on that does not start with AT (16 x 17 + 5 =117). This number represents the coolant
will be assumed by the ELM327 to be an OBD command. temperature of the engine in Celsius but with zero offset to
OBD commands are actually sent to the vehicle embedded in allow for subzero temperatures. To get the actual temperature
data packets (as mentioned earlier). The ELM327 adds the 40 degrees must be subtracted from the received value so the
extra bytes (header and checksum) to the two OBD command actual temperature is 117-40= 77 Celsius.
bytes that have been initiated on Terminal. Note that all data C. Bluetooth Tranceiver
exchange with the ELM327 is in hexadecimal digits because it
The microcontroller is programmed to send the
is the format used in most OBD protocols (Modes and PIDs
measurements on its UART to the Bluetooth module.
are written in hexadecimal digits). After adding the header
Bluetooth provides a means to connect devices such as mobile
byte and checksum to the command bytes, a total of 5 bytes is
phones over a secure, globally unlicensed short-range radio
sent to the vehicle’s ECU. These 5 bytes carry the OBD
frequency (2.45 GHz) and to enable the exchange of
command that had been initiated. Next the ELM327 listens on
information between them. We used the LinkMatik 2.0
the OBD bus looking for replies that are directed to it when it
Bluetooth transceiver module, which is a class 1 (20 dBm)
receives a reply. The ELM327 checks the address; if there is a
model that has an approximate range of 100 meters. The
match the message is forwarded to the next interface, in this
asynchronous data from/to the PIC16F877 microcontroller is
case the terminal (to test the ELM327). Messages that do not
delivered to/from the LinkMatik Bluetooth module on the
have matching addresses are dropped and the ELM327 will
serial port at a speed of 9600 bps. The Bluetooth module is
continue to listen on the OBD bus for a certain time known as
configured as a Slave and the mobile phone is considered to be
ST and its default value is 200ms. If the ELM327 does not
functioning as a Master. The microcontroller sends/receives
receive any replies during this time interval it will declare
data to/from the Bluetooth module, which transmits/receives
“NO DATA” on the terminal. On the other hand if the
data continuously as raw binary bytes.
ELM327 receives a reply during this time the timer will reset.
Bluetooth employs a radio technology called frequency-
The flowchart in Fig. 3 shows how the process is done .
hopping spread spectrum, where data transmitted is chopped
An example of this process is when ELM327 was tested by
into chunks, which are transmitted on up to 79 bands, each
connecting the circuit to a 2007 Chevrolet Optra vehicle which
with a bandwidth of 1 MHz centered from 2402MHz to
uses ISO 9141-2 protocol and monitoring the result on
2480MHz.
Microsoft HyperTerminal. The goal was to request the
Bluetooth connections require a master/slave relationship
Engine’s Coolant Temperature ECT by issuing the OBD
between clients, with the master allowed to communicate with
command >> 01 05. 01 is the service mode which is mode 1
up to 7 slaves. However, connecting the LinkMatik2.0 IC to
(monitor current data) and 05 is the PID number for requesting
the ELM327 IC necessitates no level shifting; hence the two

139
ICs are connected to each other directly using simple wiring
and needs no interfacing.
LinkMatik2.0 is configured to perform its operations in the
Serial Port Profile (SPP) and is to contend with RFCOMM
protocol. This profile imitates a serial connection to provide a
substitute for RS232 levels. In this system SPP was used as it
is supported by both the LinkMatik2.0 module and the
Android-based mobile device.
As LinkMatik2.0 is operating in the auto-slave mode in this
system, it requires a voltage in the range 3.2V to 5.1V and a
current of 6.5mA.
D. Configuring ELM327 and LinkMatik2.0
Prior to installing the ELM327 and LinkMatik2.0 in the
complete system circuit as shown in Fig 4, they needed to be
programmed to serve their intended purpose and functions.
They was performed using an ASCII terminal software to
issue configuration commands. Since both the ELM327 and
the LinkMatik2.0 are TTL/CMOS based ICs, while the
personal computer’s serial communications port uses RS232
voltage levels, an interface is needed to convert between the
different voltage levels. For this purpose, a properly
Fig. 5. PCB of the complete hardware interface unit.
connected a MAX232 IC was used. As an example, the
following configuration commands were issued: Finally, we show in Fig. 5 the complete system hardware
• AT Z: interface unit constructed on a custom-made printed circuit
Energizes the four LEDs in sequence to show the IC board (PCB) after successful testing.
is working properly and shows the message ELM327
v1.4b to show that the link is up.
• AT SP A3:
Chooses a starting default protocol (ISO9141-2),
while still retaining the ability to automatically search
for a valid protocol on a failure to connect.
• AT IB 96:
Set the ISO9141 baud-rate to 9600 baud.

Fig. 4. Circuit Schematic of the hardware interface unit.

140
III. THE MOBILE APPLICATION SOFTWARE TABLE I
Android is an operating system which is based on the JAVA A SAMPLE GROUP OF PIDS
programing language and runs on Linux kernel. The Android Parameter Mode and PID (hex)
platform is made up of the operating system, middleware, user Air intake temp 010F
interface and application software [10]. In addition to Android, Engine RPM 010C
there are several different operating systems in the market for Mass Air flow 0110
smart phones such as Symbian, Windows Mobile, RIM, iPhone
Engine runtime 011F
OS (iOS), … etc. Android has four distinguishing advantages
when compared with the other mobile phone operating Fuel pressure 010A
systems: 1) It is an open mobile platform; Users can customize Vehicle speed 010D
and expand applications according to their needs. 2) All 0111
Throttle position
applications are equal, where all applications are run in virtual
machine resources. 3) The application programs have no
boundaries. The developers can combine the data of the World The request messages are within the application software
Wide Web and the locally available (stored) in the Android formed as explained previously in the message format section.
platform because Android can access the core mobile devices Table 1 shows a sample of the PIDs requested from the OBD
and Internet through the standard API. 4) The application system by the software.
development is quick and easy since the Android platform Some indicators need to be calculated from the parameters
extends a great deal of useful libraries and tools to the obtained from the vehicle such as “fuel economy.” The
developers. Our Android mobile application software was geographical position is obtained from the GPS sensor
designed to perform the following tasks: a) Connect to the incorporated within the mobile device and combined with
Bluetooth module. b) Send request messages to the OBD other parameters in the message.
system. c) Receive responses from OBD system. d) Display the
responses to the user in a user friendly form (values in A. Development of the Android Application Software
decimal). e) Be able to upload the values to a remote server We have developed our Android mobile application
when desired. We depict the sequence of these tasks for software on a Windows® 7 platform for an Android 2.2 driven
simplicity in the flowchart of Fig. 6. Samsung Galaxy S phone. We installed development
environment preparation software which included the java
development kit (JDK), Eclipse, Android software
development kit (SDK), Android virtual devices (AVD).
Meanwhile, Android development tools (ADT) is the plug-in
through which Eclipse is customized for Android applications
development. It provides a powerful integrated environment
and extends the functions of Eclipse that allows users to create
applications quickly and add components on the API. AVD is
a collection of virtual devices where each AVD simulates a
virtual device to run the Android platform and test the
application software before they are run (tested) on the actual
physical mobile phone (device).
B. Mobile Application Software Testing and Menus
In order to test and verify the proper operation and
functions of this Android-based application software, the
hardware interface unit was connected through an OBD
connector to a Chevrolet Optra 2007, which operates on the
ISO-9141-2 protocol. The circuit immediately responded to
the connection as the LEDs light in the correct sequence,
while a Bluetooth pairing with application software installed
on the Android-based Samsung Galaxy S mobile phone was a
success. The mobile applications configuration software
menu allows for personal settings of features such as turning
GPS ON or OFF , duration between consecutive reading from
OBD, custom (specific) parameters for certain vehicles, …
etc, as shown in Fig 7.
Fig. 6. Android mobile application operation flowchart.

141
Fig. 7. Configuration menu on the mobile application software.

Also, the desired commands or requested parameters to be


read and displayed are under the control of the driver, where
they are selected from the function modules submenu options
as depicted in Fig 8. Some vehicles real-time parameters
include throttle position, intake manifold pressure, ignition
advance angle, engine speed and vehicle speed.
After the requested test parameters were selected, the test
was a success, as the system functioned as expected displaying
readings taken from the vehicle’s sensors on the mobile Fig. 8. Commad submenu options .
screen. Fig. 9 shows a screen shot taken from the Android
mobile device displaying the measured and calculated
readings. Note that an error was present, as the application
failed to measure the Mass Air Flow. This is due to the
vehicle’s inability to measure this value, because this
particular car model does not support this PID.
C. Remote Server Set-Up
The server is held at the maintenance department where it
receives the readings in the form of HTTP/TCP packets. The
server should have a static public IP address to which the
application packets are destined. The mobile application
transfers data via cellular internet from the integrated OBD
system. The server performs analysis on the received
parameters and uses this data to detect any malfunctions
present in the vehicle [12], or predict faults that may occur in
the future. The server is a PHP programmed server that
contains a MY SQL database. The database holds a NULL
table. In the table, there is a field for each PID where the
readings from the OBD system are recorded. To make sure
that the fault detection and prediction is done correctly the
server needs to receive real time data, hence, the application at
the mobile device needs to have a high data rate broadband
connection such as that supported by 3G cellular Internet.

IV. CONCLUSION
We implemented a universal integrated system which is
Fig. 9. Displayed parameters taken at 0 km/h.
composed of a combination of a low-cost hardware unit and a
user-friendly Android-based mobile application software readings will be displayed locally to the user then can be sent
utilized to create an on-board vehicle diagnostic system. The to a remote maintenance server as HTTP packets via a cellular
mobile application software will interact with the hardware internet connection. The packets received will be tabulated in
interface unit wirelessly via Bluetooth to acquire desired the server, then made use of by the maintenance department
vehicle parameters from the ECU of the vehicle. These which holds the server.

142
ACKNOWLEDGEMENT
The authors would like to thank the Jordan Engineers
Association (JAE) for awarding this prototype the First Place
Prize in the 2011 Electrical Engineering Design Project
Competition. We also thank ELM electronics for providing
free samples of their ELM327 IC, and Mr. Jim Nagy of their
technical team.

REFERENCES
[1] T. Menard, and J. Miller, “Comparing the GPS capabilities of the iPhone
4 and iPhone 3G for vehicle tracking using FreeSim_Mobile,” 2011
IEEE Intelligent Vehicles Symposiium (IV), pp. 278–283, June 2011.
[2] N. Navet, Y. Song, F. Simonot-Lion, C.Wilwert, "Trends in Automotive
Commutication Systems," Proceedings of IEEE, Vol.93, pp 1204-1223,
2005.
[3] S. Carter, Nissan Releases Andriod App for Leaf Vehicle, http://nissan-
leaf.net/ , August 4 2011.
[4] J. Barkenbus, “Eco-driving: An overlooked climate change initiative,”
Energy Policy, Volume 38, Issue 2, February 2010, Pages 762-769.
[5] M. Johanson, and L. Karlsson, “Improving vehicle diagnostics through
wireless data collection and statistical analysis,” IEEE Vehiclular
Technology Conference (VTC-Fall 2007), pp. 2184-2188, September
2007.
[6] L. Ferhatovic, A. Lipjankic, A. Handzic, and N. Nosovic, “System for
remote diagnostic of vehicle defects,” in Proc. 17th Telecommunications
Forum (TELFOR), pp. 1323-1326, November 2009.
[7] A. Tahat, M. Khalaf, O. Elmuhesen, ”A solar energy water heater
remote monitoring and control system,”International Conference on
Electronic Devices, Systems, and Applications (ICEDSA), pp. 98-103,
April 2011.
[8] A. Tahat, A. Sacca, Y. Kheetan, ”Design of an integrated mobile system to
measure blood-pressure," in Proc. IEEE 18th Symposium on
Communications and Vehicular Technology (SCVT), pp. 1-6, November
2011.
[9] Press release Canalys, “ Andriod takes almost 50% share of worldwide
smart phone market, Palo Alto, Singapore and Reading (UK), August
2011.
[10] Datasheet, “ELM327 OBD to RS232 Interpreter”, ELM Electronics,
2010.
[11] C. Haseman, Andriod Essentials , Berkeley, CA: A Press , 2008
[12] H. Gelgele, Kesheng Wang, “An expert system for engine fault
diagnosis: development and application,” Journal of Intelligent
Manufacturing, pp. 539-545, 1998.

143

Вам также может понравиться