0% found this document useful (0 votes)
69 views11 pages

Design and Implementation of A Wireless OBD II Fleet Management System

This document summarizes the design and implementation of a wireless OBD II fleet management system. The system uses an OBD II reader to measure vehicle speed, distance traveled, and fuel consumption. It then transmits this data via WiFi to a remote server. The server stores the data in a database and a GUI is used to analyze the transmitted information. GPS is also used to track vehicle locations. The system was tested and shown to successfully read vehicle parameters and process, transmit, and display the readings.

Uploaded by

Sudipto Paul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views11 pages

Design and Implementation of A Wireless OBD II Fleet Management System

This document summarizes the design and implementation of a wireless OBD II fleet management system. The system uses an OBD II reader to measure vehicle speed, distance traveled, and fuel consumption. It then transmits this data via WiFi to a remote server. The server stores the data in a database and a GUI is used to analyze the transmitted information. GPS is also used to track vehicle locations. The system was tested and shown to successfully read vehicle parameters and process, transmit, and display the readings.

Uploaded by

Sudipto Paul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

JOURNAL OF LATEX CLASS FILES, VOL. 13, NO.

9, SEPTEMBER 2014 1

Design and Implementation of a Wireless OBD II


Fleet Management System
Reza Malekian, Member, IEEE, Ntefeng Ruth Moloisane, Lakshmi Nair, Member, IEEE,
BT(Sunil) Maharaj, Member, IEEE, and Uche A.K. Chude-Okonkwo, Member, IEEE

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

purposes. An OBD II reader is designed to measure speed and 2 J1850 B+ 10 J1850 B-


mass air flow, from which distance and fuel consumption are 3 unconnected 11 unconnected
also computed. This data is then transmitted via WiFi to a 4 Chassis ground 12 unconnected
remote server. The system also implements GPS tracking to 5 Signal ground 13 unconnected
determine the location of the vehicle. A database management 6 CAN-H 14 CAN-L
7 ISO K Line 15 ISO L
system is implemented at the remote server for the storage and
8 16 Battery
management of transmitted data and a graphical user interface
(GUI) is developed for analysing the transmitted data . Various
qualification tests are conducted to verify the functionality of
the system. The results demonstrate that the system is capable Identifiers (PIDs). DTCs are used to diagnose malfunctions
of reading the various parameters, and can successfully process, in various subsystems of the vehicle and PIDs are used to
transmit and display the readings.
measure real time parameters. The PID for speed, for instance,
Index Terms—OBD II, fleet management, intelligent trans- is the hexadecimal value OD. Vehicle manufactures can define
portation, speed, mass air flow, distance, fuel consumption, GPS. their own PIDs thereby making the on-board system more
sophisticated.
Table I is a summary of the pin connections of an OBD II
I. I NTRODUCTION reader to the 16- pin connector.
OBD II readers have mostly been utilised for diagnostic
T HE on-board diagnostic system (OBD II) is a standard
which was developed in the United States of America
(USA) in 1996, by the Society of Automotive Engineers
purposes; identifying and reporting specific vehicle faults.
With the advent of various mobile technologies, wireless com-
(SAE) [1]. This specification was defined for all manufactured munication and the global positioning system (GPS), the use
vehicles to enable the regulation of vehicle emissions, so as of OBD II readers for real-time tracking and monitoring has
to ensure that the Environmental Protection Agency (EPA) gained popularity, especially in the area of fleet management.
standards are met. Fleet management is the total management of a company’s
The standard requires that vehicles have a 16-pin OBD fleet of vehicles, covering every aspect of the life cycle of
II port. Sensor data and diagnostic information from the a vehicle from procurement to disposal. It is thus important
electronic control unit (ECU) of a vehicle can be measured for companies to employ efficient fleet management systems
from this port. to reduce risks, increase quality of service and improve the
The development of OBD II also resulted in the develop- operational efficiency of a fleet at minimal cost [5]. Fleet
ment of OBD II scanning tools, known as OBD II readers, management also encompasses the analysis of the impact
which can interface to any vehicle via the 16-pin port. A of transportation on the environment. It was reported in [6]
scanning tool typically requests information from the ECU by that approximately 27 % of the total carbon dioxide (CO2 )
sending a message containing a hexadecimal code associated emissions were as a result of the combustion of fuels from
with a specific parameter. These codes are defined by the SAE vehicles.
J1979 standard [2]. The message would then get interpreted Vehicle emissions are influenced by driving style and vehi-
according to one of five OBD II signalling protocols. The five cle parameters such as acceleration, speed, distance travelled,
OBD II protocols include SAE J1850 (VPW and PWM), ISO and fuel consumption. Speed and distance information in fleet
15765, ISO 1941-2 and IS0 142300-4 [3]. The ECU finally management can be utilised for assessing driver behaviour on
sends back a hexadecimal code in response. Depending on the road, prevention of accidents and improved road safety.
the specific parameter being measured, the actual measurement Fleet management systems can also avail us with a fuel con-
can be obtained by simply converting the returned hexadecimal sumption monitoring capability, which can result in reducing
value to decimal or by performing a calculation using a running costs and environmental pollution.
standard formula as defined in [4] for that specific parameter. Existing works, which are detailed in the next section,
OBD II uses two types of codes to request ECU data. have addressed the implementation of OBD II in vehicular
These are Diagnostic Trouble Codes (DTCs) and Parameter systems. Although most of these works integrate OBD II with
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 2

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

Fig. 1. The Three Main Subsystems.


Fig. 3. The OBD II Message Format.

Fig. 4. The OBD II Response Message Format.

up the Baud rate for RS232 communication, format of the


received data from the ECU and initialisation of the type of
OBD II protocol implemented on the vehicle.
A separate command set referred to as OBD commands,
was used to communicate with the ECU from the ELM327.
Commands from this set consist of only hexadecimal charac-
ters as defined in the SAE J1979 standard. Each command
from this set is a combination of either a PID or a DTC and
a value that indicates a mode of operation. The ELM327 has
ten diagnostic modes of operation which are defined in the
SAE J1979 standard. The operation of each mode depends
on the type of information required from the ECU. Mode
Fig. 2. The Functional Units of the Subsystems. one was mainly used in the implementation of the OBD II
reader subsystem is for requesting and showing current real
time vehicle data and mode two for example is for diagnosing
is designed and implemented on off-the shelf hardware. The engine malfunctions. The SAEJ1979 standard also defines
data link connector (FU 1.3) is a standard connector in the formulas to be used to decode messages received from the
vehicle to which the OBD II reader is connected. The OBD II ECU so as to obtain actual parameter measurements and the
protocol interface (FU 2.1) detects and interprets the ECU data structure of response message from the ECU.
according to the implemented OBD II protocol. Conversion OBD commands are typically two bytes long, however they
of data in text format to voltage levels (FU 2.2) from the are sent to the vehicle ECU as part of a longer message. The
processor to the on-board system and vice versa is performed. byte structure of this message is shown in Figure 3.
PID data is requested and performs the processing of the Messages are assigned priorities which are used to deter-
data received from the ECU via the OBD II protocol interface mine the order of sending messages in the event that more
(FU 2.3). It is also responsible for controlling the GPS (FU than one message is sent simultaneously.The receiver and
2.6) and the wireless communication modules (FU 2.5). The transmitter bytes are the source and destination addresses. The
server is a PC from which a database management system vehicle ECU is an addressable electrical bus, the source and
(FU 3.1) and a GUI (FU 3.2) is run. Discrete components and destination address are thus necessary for use in the address
regulators are used (FU 2.7) to scale the 12 V output from the line of the bus.
OBD II data link connector down to voltage levels suitable for OBD II commands are encapsulated as part of the payload
powering other system components. section which can be as long as 7 bytes. The last field of
the message is a checksum which is responsible for detecting
IV. S YSTEM D ESIGN errors in messages received from the vehicle ECU. The ISO
A. ELM327 Integrated Circuit 9141-2 and ISO 14230-4 standards both employ the same mes-
The ELM327 is an OBD II interpreter IC. It is a microcon- sage structure, CAN messages are however slightly different.
troller designed to automatically interpret all OBD II signalling The structure of response messages from the ECU is shown
protocols. It can thus be interfaced with the electronic circuitry in Figure 4. The first byte indicates the mode of operation.
required to establish communication with the vehicle ECU via The hexadecimal value ’1’ in the ’41’ indicates mode 1. If a
the OBD II port. The protocols implemented in this study were DTC was sent under mode two then value of the first byte
the ISO 15765 (CAN), ISO 9141-2 and ISO 14230-4. would be ’42’. The second byte is the PID which was sent
An AT Command set predefined for the ELM327 was used with the request message. Position A to D is the data bytes
to communicate with the IC through RS232. The command which contain the requested parameter value from the vehicle.
set allowed for setting up the IC to change its behaviour so as Figure 5 shows an example of a request and a response
to suit the requirements of the system. This included setting message sent by the ELM327 and ECU respectively when
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 4

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.

Table II is a summary of the commands used and sent from


the ELM327. All commands sent from the ELM327 were
appended with a carriage return character.
The OBD II standard does not define standard PIDs for
some vehicle parameters such as fuel consumption. A method
proposed in [4] was used in this project to calculate the fuel
consumption of a vehicle from OBD II. Fuel consumption is
a measure of the fuel that a vehicle consumes in litres per
Fig. 6. An Example of Request and Response Message Sent for Measuring
MAF. kilometre (L/Km). Fuel flow is a measure of the litres of fuel
burnt by a vehicle measured in litres per hour (L/h). It can be
used to calculate the instantaneous fuel consumption if divided
vehicle speed measurement is requested. The request message by the current driving speed in kilometres per hour (Km/h).
is ”01 0D” which indicates that the PID ”0D” was sent This is shown in equation below.
to the ECU under mode one which is indicated by ”01”.
The response message from the ECU is ”41 0D 32” which F uelF low
F uelConsumption = (3)
corresponds to the format shown in Figure 4. The first two Speed
bytes indicate the mode and the PID. The last byte which is
Speed can be obtained from OBD II however even though
”32” in this case, is the data byte A in Figure 4. The actual
fuel flow has a defined OBD II PID of 5E, it is not available
speed value is obtained by changing byte A, which is 3216 to
on most cars. This problem can be bypassed by using the
decimal. The speed value will thus be 50 Km/h.
MAF given in grams of air per second (g/s) to calculate fuel
Thus the equation are used for calculating Speed is:
consumption. This method takes into account the ratio of the
mass of air in grams to one gram of fuel in an engine which is
Speed = ((ByteA)16 )10 (1) referred to as air to fuel ratio (AFR) and the density of the fuel
An example of the send and request message for MAF is in grams per cubic decimetre (g/dm3 ) or equivalently grams
shown in Figure 6. The decoding of the data bits is different per litre (g/L). The AFR of is 14.7:1 and it’s density (D) is
from the previous example in that the formula used two data 820 g/dm3 . If the speed of the vehicle (V), is given in (Km/h)
bytes, namely A and B. then the instantaneous fuel consumption can be calculated as
Computation of the MAF value is done by first converting in equation below:
byte A which is 0116 to a decimal value which is 1. Similarly
M AF
byte B which is 7C16 works out to be 124. Thus the equation F uelConsumption = × 3600 (4)
AF R × D × V
for calculating MAF is:
, where 3600 is a conversion factor from seconds to hours.
(ByteA16 )10 × 256 + (ByteB16 )10 If the type of fuel used by a vehicle is diesel as opposed
M AF = (2)
100 to fuel consumption, air to fuel ratio will be 14.5:1 and the
The ELM327 requires a 5 V power source to function density will be 750 g/dm3 . Equation 4 was used in this study
correctly. Messages are sent and received using UART. The to calculate the fuel consumption of a vehicle.
ELM327 in essence acts as terminal interface. On power
up the IC returns a string with the characters ”ELM327
B. Interface Protocols
v1.4b” followed by a prompt character ’>’. The prompt
character signals that the IC is ready to send OBD II or AT The CAN, ISO 9141-2 and ISO 14230-4 communication
commands. A baud rate of 38400 bits per second (bps) was protocols were implemented in this study. The output of
used. Establishing communication with the ECU was done by the interface circuits were connected to the OBD II 16-pin
first sending the command ATZ followed by ATSP0 and then connector shown in Figure 7. The pins which were utilised
finally 0100.The ATZ command resets the IC. It was sent to were pin 6 and pin 14 for CAN, pin 7 and 15 for both ISO
verify that the IC functions correctly and to check if it was 9141-2 and ISO 14230-4. Pin 5 and pin 16 were connected to
ready to send messages. the ground and voltage supply.
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 5

Fig. 7. The OBD II Port.

Fig. 10. OBD II Communication Protocol Circuitry.

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

electronic buses or ECUs that adhere to either of these two


standards operate at logical high and logical low voltage levels
of 12 V and 0 V respectively. The collector terminals of both
transistors are thus connected to the vehicle battery voltage
of 12 V via pull up resistors, R4 and R7 of value 510 Ω.
The value of the pull up resistor is chosen as specified in
the standards of the concerned communication protocols. The
operation of the transistor switches when communicating with
the ECU is explained further.
When the voltage VB at the base of the transistor is 0 V, the
base current IB will also be zero. The relationship between
the base current and the collector current IC is given by:
Fig. 11. The MCU and WiFi Module Connection Circuit.
IC = βIB (5)

where β is the transistor current gain. If IB is 0 A then the


C. Wireless Communication Module
equation implies that the collector current will also be zero
and the transistor will act as an open switch resulting in pin A WiFi network was established between a Carambola2
7 and pin 14 of the OBD II connector being at 12 V. When WiFi module connected to a PC and one integrated with
the transistor is however forward biased with a base voltage the OBD II subsystem. The Carambola2 module which was
of 5 V from the ISO pins of the ELM327, the base current interfaced with the OBD II subsystem was connected to the
will be: MCU via RS232. The MCU transmitted the acquired OBD
II and GPS data to the module so that it could be sent
Vb − 0.7 5 − 0.7 wirelessly to the remote WiFi module connected to a PC. The
IB = = = 1.95mA (6)
R7 2200 Carambola2 operates at a baud rate of 115200 kbps. Figure
where 0.7 is the transistor breakout voltage. 11 below illustrates the connectivity between the WiFi module
If the supply voltage is VCC , the maximum collector current and the MCU.
is given by: The WiFi module was operated from a 3.3 V supply and
the maximum operation voltage of the module’s RS232 lines
VCC 12 was 2.6 V. Voltage division was hence used to drop the 5 V
IC = = = 23.5mA (7) from the MCU’s TX line to 2.5 V suitable for the RX line
R4 510
of the WiFi module. Two equal resistors R12 and R13 of 10
which would then result in transistor saturating and acting
KΩ were chosen to realise a voltage level of 2.5 V. A level
as a closed switch.
shifting IC such as ADuM1201 could have been used as an
The output voltage is given by:
alternative to voltage division however voltage division was
opted for since it was a cheaper solution and proved to be
Vout = VCC − R4IC = 12 − (510 × 0.0235) = 0.2V (8) efficient. The module uses a 2.4 GHz WiFi antenna for WiFi
connectivity and scanning of reachable WiFi networks.
Calculations performed in Equations 5 to 8 were derived An RJ45 MagJack breakout board shown in Figure 12 was
with reference to Q2, however it must be noted that the same connected to the Ethernet interface pins of the Carambola2
reasoning also applies to transistor T1 as the configuration of to allow for sharing of source code files from the PC to the
the two transistor circuits is the same. module. The board had eight breakout tracks from the pin
Transistor T1 which was connected to the ISOL line is contacts of the RJ45 to the solder side connections.
not required for most vehicles as it is only required during The MagJack RJ45 was equipped with a transformer whose
the initialisation process of the bus for some vehicles. Data primary side was connected to the solder side of the eight pins
was transmitted and received on the K line of the vehicle bus of the breakout board. The secondary side of the transformer
and was read through pin 12 (ISOIN) of the ELM327 from was connected to the pins of the RJ45 port.
the output of the transistor. A voltage divider circuit with a Connections made between the RJ45 breakout board and the
resistance R8 of 33 KΩ and R9 of 47 KΩ was used to drop LAN interface of the Carambola2 are shown in Figure 13. The
down 12 V, the maximum voltage from the transistor output component SV4 was a PCB connector to which the breakout
to 5 V to be used by the ELM327. board was connected. Capacitors C7 and C8 of value 100 nF
The value of the voltage divider output can be justified in were connected between the supply and ground as suggested
the equation below where Vout and Vin are the voltage divider in the data sheet for decoupling. A pull down resistor R14 was
output and the transistor output respectively. connected to a switch for physically resetting or rebooting the
module.
R8 3300 1) (Connecting the Carambola2 Wireless Module): The
Vout = × Vin = × 12 = 4.95V ≈ 5V WiFi module was running on Chaos Calmer, a version of the
R8 + R9 3300 + 4700
(9) OpenWRT operating system. The Carambola2 is in essence
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 7

Fig. 14. An Example of the GLL Message Transmitted by the GPS Module.

names of these files were network, wireless and f irewall.


The network file is where all the networking interfaces to
be used for communication are created. The home address of
the device was configured as a loopback interface with the
IP address 127.0.0.1. The LAN interface was named eth0 and
given the IP address 192.168.1.1. This was the IP address used
to identify the device when connected to a PC via Ethernet. An
interface for WiFi communication was also created and named
Fig. 12. The RJ45 MagJack Breakout Board Which was Interfaced with the WiFi The IP address of the WiFi interface was 192.168.6.1.
Carambola2. All IP addresses were configured as static addresses with a
subnet mask of 255.255.255.0.
The wireless file is where the wireless interface and the
attributes of the WiFi network are configured. These included
the name of the WiFi network (SSID), the name of the
device, the mode of operation and the communication protocol
standard. The device was configured as an access point which
could be accessed via the WiFi interface which was initially
setup in the network file. The status of the wireless interface
was confirmed by issuing the command iwconfig.
The f irewall file was setup to enable packets to be for-
warded from the LAN interface to the WiFi interface and vice
versa.
Fig. 13. The Connection Between the RJ45 MagJack Breakout and the WiFi
Module. 3) STA mode configuration: Configuring the WiFi module
in STA mode is done similarly to the AP mode configurations.
The difference was that an interface named wwan with a
a small computer with powerful features such as those of static IP address of 192.168.6.2 was setup in the network
wireless routers [17]. Configuring the module for communi- file. The mode of operation and the SSID name were also
cation over a WiFi network required connecting it first once configured in the wireless file. The same SSID was used,
the module was powered on. This could be done in one of else communication would not have been possible between
two ways. The first method was through establishing a LAN the modules. The module also allows for enhancing security
connection between a PC and the module, then using either by setting up a password for the WiFi network.
Telnet or Secure Shell (SSH) to login. The default IP address
of the module’s LAN interface was 192.168.1.1 which the PC
automatically detected once a successful LAN connection was D. GPS Tracking
established.
The second method of accessing the module was through a The transmit pin of the GPS module was connected to the
USB to serial port connection. A terminal program was such receive pin of the microcontroller’s second UART module. The
as Putty in Windows was used. Connecting to the module via module was set to transmit NMEA protocol message strings at
SSH required setting a password which could be done when a baud rate of 115200 Kbps every second. This was because
connected via Telnet or SSH. the WiFi module was also interfaced with the microcontrollers
The module connected to the PC was configured as an second UART module and operated at a baud rate of 115200
Access Point (AP). An AP acts as a master node or a server Kbps. All settings and configurations were done using the U-
which allows for other devices to connect to it via WiFi. centre, open source software developed by Ublox. The NMEA
Station Point (STA) mode was configured on the module protocol defines different messages with a predefined format.
connected to the OBD II subsystem. STA mode thus enables One of the NMEA messages is the GLL message type which is
a device to connect to an AP as a client. string containing information about the longitude and latitude
2) AP mode configuration: Once the Carambola module of a specific location.
has been connected, the module had to configured for WiFi The message string has different fields which are delimited
connection and communication. This was done by setting up by commas. The fields of the GLL message are shown in
three files in the /etc/conf ig/ directory of the module. The Figure 14.
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 8

Fig. 15. The Power Supply Circuit.

Fig. 17. Test Setup of the OBD II Reader Connected to the Emulator.

Fig. 16. Implementation of the GUI at the Remote Server.


Fig. 18. Communication Established Between the Emulator and the Reader.

E. Power Supply V. R ESULTS


As shown in Figure 15, the system was powered with A. Establishing Communication Between the OBD II Reader
a 12 V battery from a vehicle which was regulated down and the ECU
to 5 V the LM805 and 3.3 V using the LM1086 voltage Firstly communication between the OBD II reader subsys-
regulators. The 5 V supply was for the ELM327 IC, the tem and the vehicle ECU needed to be verified.
MCU and the GPS module. The 3.3 V was for powering the A Freematics OBD II emulator, as shown in Figure 17,
wireless communication module. The two regulators each give was used for testing purposes. The emulator implements three
a maximum output current of 1.5 A which was sufficient to OBD II protocols (CAN, ISO 9141-2 and ISO 14230-4. It
supply all system components. has an OBD II 16 pin connector similar to an actual OBD II
Input Capacitors C1, C3 and C5 were used for absorbing compliant device and was powered from an AC to DC power
power transients and ripples in the circuit. Output capacitors supply connected to the mains. A USB to serial convertor was
C2 and C4 were also used for the same reason. The values used for communication between the PC and the ELM327 IC
were chosen to be greater than the minimum input or output on the reader.
capacitance as specified in the data sheet A Zener diode D1, The speed and MAF parameter values were initially con-
with a break down voltage of 12 V was used to protect the figured on the emulator. AT and OBD II commands were
system components against overvoltage. This was to limit the sent from the MCU on the reader to the emulator to initialise
voltage from the supply to 12 V as there may be variations communication. The data received from the emulator was then
when a load is connected. Diodes D2 and D3 with a 0.7 V displayed on the terminal program, Termite (which was set at
drop were used to protect supply from any reverse voltage. a baud rate of 38400 Kbps), as shown in Figure 18.
To further verify the designed reader, a Bluetooth OBD
II reader was connected to the emulator and an Android
F. The Remote Server
application on a mobile phone was used to ensure that the
Data from transmitted wireless from the OBD II reader was correct data was received.
stored in a database created in SQL. The data was then read Commands sent from the MCU were preceded by a prompt
from the serial port into a graphical user interface implemented character ’>’ and displayed in blue text. The emulator re-
in C#. The web based model view controller (MVC) platform sponded successfully to the requests by first echoing the sent
was used. This allowed for separation of concerns. Figure 16 command and then responding with the requested data (speed
shows the implementation of the GUI at the remote server. and MAF) shown in green text.
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 9

Fig. 20. The Relationship Between Distance Covered by the Vehicle and
Time.

Fig. 19. The Vehicle Display.

B. Vehicle Parameter Measurement Over Short Distance,


The ability and performance of the OBD II reader to
measure vehicle parameters: speed, MAF and distance over
a short distance was determined.
The designed OBD II reader was connected to the OBD II
port of the vehicle. For this study a BMW 125i was used as
it implements the CAN communication protocol. A USB to
serial convertor cable was connected to a PC running Termite,
and the MCU.
The vehicle was driven on a straight path for 400 m.
The transmitted output was observed on Termite. The on-
board computer of the vehicle displayed the instantaneous
measurements for speed, distance and fuel consumption. The
Fig. 21. The relationship Between Speed and Fuel Consumption.
instantaneous fuel consumption (L/100 km) and distance (km)
were shown on the digital display, as in Figure 19. The speed
was observed on a speedometer. A passenger sitting with he second for a duration of 450 s.
driver made the observations in the vehicle. The total distance measured as shown in Figure 22 was 8.5
Samples of all parameters were taken every second for a km. From Figure 23 the maximum speed measured was 120
total duration of 100 s. The instantaneous distance travelled km/h and the maximum fuel consumption was 0.38 L/km. As
was obtained by multiplying the sampled speed with one noted above the slower the speed the more fuel was consumed.
second. The resulting value was added to previously obtained
results to get the total distance travelled during the course of
the trip. D. Communication Between the Wireless Modules
The initial and final data points indicate instances when Communication and the range of communication between
the car started and stopped respectively. The total distance the two Carambola2 modules is verified.
measured by the system was 380 m as shown by the graph in A remote Carambola module was connected to a PC and the
Figure 20. The maximum speed reached was approximately module in the moving vehicle was powered from the vehicle’s
34 km/h and the maximum fuel consumed was 0.65 L/km as USB port. Ping commands were constantly issued from the
observed in Figure 21. It was also noted that more fuel was remote module. The success or failure of the ping command
consumed at lower speeds. was used to determine whether the module in the driving
vehicle was out of range or not.
C. Vehicle Parameter Measurement Over Long Distance A total communication range of 900 m was determined.
The ability and performance of the OBD II reader to
measure vehicle parameters: speed, MAF and distance over VI. C ONCLUSION
longer distances was also determined. The testing of the communication between the OBD II
The vehicle was driven over a distance of 9 km from the reader and the emulator verified that the system could inter-
city to a highway. A total of 419 samples were taken every face with an OBD II complaint vehicle and retrieve sensor
JOURNAL OF LATEX CLASS FILES, VOL. 13, NO. 9, SEPTEMBER 2014 10

be reduced to improve efficiency of the system. The effect


of the delay introduced by initialisations means that the car
can only be driven once all initialisations are done, so as to
avoid loss of initial parameter measurements. New techniques
to reduce this delay need to be developed.

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

Ntefeng Ruth Moloisane received her B.Eng. de-


gree in Computer Engineering from the University
of Pretoria, Pretoria, South Africa in 2015. She is
currently pursuing her postgraduate studies in the
department of Electrical Electronic and Computer
Engineering at the University of Pretoria. Her re-
search interests include intelligent transport systems
and advanced sensor networks.

Lakshmi Nair received her B.Eng degree in Com-


puter Engineering in 2004 and a M.Eng degree in
Electronic Engineering in 2009. She is currently pur-
suing her Ph.D. degree in Computer Engineering at
the University of Pretoria, South Africa. Her areas of
interest include wireless sensor networks, intelligent
transport systems and smart sensor designs for real-
time monitoring applications.

Prof. BT (Sunil) Maharaj received his Ph.D. in the


area wireless communications from the University
of Pretoria, South Africa. Dr Maharaj is a Professor
and currently holds the position of Sentech Chair in
broadband wireless multimedia communications in
the Department of Electrical, Electronic and Com-
puter Engineering at the University of Pretoria. His
research interests are in MIMO channel modelling,
OFDM-MIMO systems and cognitive radio for rural
broadband.

Dr. Uche A.K. Chude-Okonkwo received his Ph.D.


in Electrical Engineering from Universiti Teknologi
Malaysia in 2010. From 2011 to 2014, he was a
Senior Lecturer at the Faculty of Electrical Engineer-
ing, Universiti Teknologi Malaysia. He is currently
a Senior Research Fellow at the Department of
Electrical, Electronics and Computer Engineering,
University of Pretoria, South Africa. His current re-
search interests include signal processing and wire-
less communication.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy