Final Report
Final Report
G RADUATION P ROJECT
for the degree of
prepared by
Khamassi H IBA
Sadkaoui A SMA
Development of an e–Service
platform for automotive
The present document, would not have been possible without the help, encourage-
ments and support of many persons. We thank all of them and we present them all
our gratitude.
Special thanks are due to our advisor, Mr Mhamdi Abdelbacet, who initiated this
work and who trusted us by giving us the opportunity to perform it. His help, insight
and encouragements were never missing. He gave us the keys to organise the work
in an efficient, accurate, creative and autonomous way.
We wish to extend our sincere gratitude to Mrs Boulehmi Hela, who have accepted to
chair the examination board. We also like to warmly thank our reviewer Mr Mabrouk
Issam, special mention goes to Mrs Ben Chehida Sonia for being our examiner.
Finally we thank our parents whose presence and encouragements were never miss-
ing. We are extremely grateful to them.
Glossary
i
Contents
General Introduction 1
2 Theoretical Framework 19
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2 Controller Area Network . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2.1 CAN history . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.2.2 CAN frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2.3 Message–based communication . . . . . . . . . . . . . . . . . 22
2.3 On–board diagnostic . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.3.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
iii
iv Contents
3.10 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
General Conclusion 61
Bibliography 63
List of Figures
vii
viii List of Figures
ix
General Introduction
1
2 General Introduction
driver don’t pay attention to these malfunction light indicators. It is under this status
that we take initiative into a research project that aims to assure and enhance the
car–to–driver communication by studying how e–service can eliminate the need to
be in the proximity of a car to perform diagnostics. By monitoring all the car aspects,
it is easier to detect any problem in advance by sending all sensor readings to the
maintenance garage where technicians and engineers will apply their expertise to
find and predict imminent failures of key systems integrated in the vehicle.
Outline
The present dissertation is divided into three chapters, organized as follows:
Chapter 1 is essentially devoted to the project framework. The first part concerns
the host company presentation and its services. The second one is reserved
for the description of the automotive field, more specifically its evolution and
electronics.
Contents
3
4 Chapter 1. Presentation of The Project Framework
1.1 Introduction
This chapter is reserved to present the project framework. The STIMM company and
its associated services are described, at first. Then, we define the automotive functions
and electronics. State of the art and eventually the problematic are exhibited at last.
Oil maintains as long as possible the life span of the car engine. It reduces friction,
wear, provides lubrication, acts as a seal between the pistons, rings and the cylinder
walls while helping to cool the engine parts. To avoid severe engine damage, this
service should be regularly scheduled after a well determined Mileage.
Maintenance
This may be one of the most demanded service from the average person to take care
for his or her own vehicle. Experts at 360 auto fulfill these needs by installing new
1.3. Automotive functions 5
parts if ever required and doing all kinds of repairs, for instance:
• Engine
• Radiator
• Brakes
• Steering
• Wheel alignment
• Suspension
When temperatures rise, there’s nothing more refreshing than climbing into a cool,
air–conditioned car. Over time, however, A/C fittings become loose. O-rings, hoses
and seals wear. In case of malfunction, the garage offers the best possible repair.
Diagnostic
• Engine
• Transmission
• Exhaust system
• Brakes.
• Ignition coils
• Throttle.
• The body domain: control of door locking and unlocking, interior and exterior
lighting, windshield washing, wiping, and air conditioning
1.4.1 Evolution
Autombiles have come a long way since their beginning in the late 19th century.
Fig. 1.3 compares two models of the Mercedes E–class from 1985 and 2018. One of
the major things that have helped automobiles to provide more safety and conve-
nience, though, is electronics. With the advances in technology and electronics, car
manufacturers have been able to offer a wide variety of services and conveniences
that many new automobile owners appreciate. The field of computer diagnosis
has also helped to shape the way that automobile owners use their cars. The cars
manufactured in the last couple decades have been built with an on-board computer
to help owners easily perceive every engine problems or other problems before any
damage is done. Before the computer diagnosis technology, most car owners did
1.4. Automotive electronics 7
not know something was wrong with the engine until something drastic happened,
such as overheating or running out of gas. Mechanics generally had to endure a
trial–and–error method to find out what was the problem in many cases.
Now, however, modern cars computers, as shown in Fig. 1.4, constantly check the
engine and its components to make sure it is always up to its optimum performance.
It uses many sensors to detect temperature, fluid levels and many other aspects of an
engine’s performance. Many times, the computers in the car will provide a code that
mechanics can read so they know exactly what has malfunctioned.
The equipment used can be attached to the car and help find out the reason for the
malfunction [Gre15]. It does require however:
1.4.2 Architecture
Automotive systems consist of mechanical, hydraulic, software and hardware compo-
nents that implement specific vehicle functions. Such architecture have distributed
control and information systems implemented in multiple Electronic Control Units
(ECUs) interconnected by serial communication buses, together with sensors and ac-
tuators locally connected to the Input/Output ports of the ECUs or to sensor/actuator
buses, as indicated in Fig. 1.5 [Uff11].
1. Engine Management ECU
1 2 3 7 2. Transmission ECU
8
3. Anti-Lock Braking ECU
CAN-bus
4. Traction Control ECU
5. Airbag ECU
9
6. Power Steering ECU
ECU is the electronic control unit. This refers to an on-board system controlling one
or more systems or subsystems in a motor vehicle. The ECU often consists of an 8-bit
microprocessor, random access memory (RAM), read only memory (ROM), and an
input/output interface as demonstrated in Fig. 1.6.
They look a lot like a computer hard drive. There are different types of ECUs
implanted in several parts of a car:
• Airbag Control Unit (ACU)
• Body Control Unit (BCU): controls the closing of doors, power windows, interior
lights
• Engine Control Unit (ECU): not to be confused with electronic control unit
Injection Engine
driver IC Injection
Switch
Switch monitor
IC
MCU
Solenoid
high-side
driver IC
Relay
Sensor Integrated
power IC Solenoid
Multi Low-side
for LAN Power IC driver IC
Relay
Other ECUs
Input Output
In any control system application, sensors and actuators are in many cases the
critical components for determining system performance. This is especially true for
automotive control system applications. The availability of appropriate sensors and
actuators dictates the design of the control system and the type of function it can
perform. Fig. 1.7 illustrates the data transmitting process[Rib02].
1.4. Automotive electronics 11
Error
Set point + Control
- calculations
Sensor Actuator
measurement Output
System
Sensors
A sensor is a gauge used to register specific physical characteristics and convert them
to an electronic signal. It is the interface between the monitored component and the
control system. Fig. 1.7 shows two types of sensors that can be found in a vehicle.
Among them many others, we can mention:
• Detonation sensor
• Oxygen sensor
• Knock sensor
(a) Manifold absolute pressure sensor. (b) Mass air flow sensor.
Actuators
Actuators are an essential part of electronic control systems in vehicles. It is their job
to convert the electrical signals from the control unit into an action. Most actuators
are electric motors, stepper motors as illustrated in Fig. 1.9a or electro–magnetic
valves. In the engine control system, actuators regulate and set the correct idle speed,
control air flaps for torque and power optimization and meter fuel for optimum
combustion using an injection nozzle as indicated in Fig. 1.9b below.
In convenience systems, they are used to lock and unlock car doors, for example,
or for the remote control of fuel filler flaps, boot lids, engine bonnets and storage
compartments.
In this section, we present the problematic and a brief but exhaustive state of art.
1.5. Project charters 13
• Speed bumps
These factors can be the reason to shattering the shock absorbers and cause damages
to the steering wheels and the under–carriage. The weather temperatures can
influence the engine, increase oil consumption and damage also the tires. Vehicles
manufacturers are using more and more information indicators on the dashboard
as shown in Fig. 1.10 to inform drivers of what features are in use and display a
detected problem with the car and alert the conductor about the issue.
Tab. 1.1 illustrates the most important warning lights that appear on the dashboard.
Despite all of these warnings, the ignorance of the drivers and inattention to the
details due to the increasing pace of life that keeps them under tremendous pressure
and stress makes them ignore the malfunction light indicator when it illuminates on
the dashboard of their vehicles that can lead to major car failures, stays the number
one concern of STIMM.
14 Chapter 1. Presentation of The Project Framework
We can thus notice that the precise and fast detection of the breakdown is a real
problem in our context, when it is poorly made or simply not done, it can cause
enormous losses on various levels: economic, material, time or even the loss of
human lives in the worst case scenario. The purpose of our work is to:
• Accurately detect the origin of a defect in order to inform the driver or the
mechanic about its appearance
• Assure the clients and take their minds off the regular worries about their cars
safety
• Reduce and win time by taking brief mechanic visits and fixing a pre–appointment.
In this part we will study more precisely what we need to do. To this end, we will
follow these steps:
To begin with, this need is basically to study, develop and implement a real time
e–Service platform for automobiles.
This accurately expresses the purpose and limitations of the study by asking the
following three questions:
This investigation is summarized into the “Horned beast” as drawn in Fig. 1.11.
E-service
platform
for automotive
For what?
To determine our service functions, we first define the diagram “Octopus” as illus-
trated in Fig. 1.12. This method defines the main functions (MF) in addition to the
constraint functions (CF) to have a global view of our product.
Monitoring the
The mechanic car performance
and data
MF1
CF1 CF4
E-service platform
Electrical power Price
for automotive
CF2 CF3
Safety Time
Tab. 1.2 below clarifies our service functions. It constitutes an essential data set
enabling to have a good knowledge of our product.
MF1 The e–Service allows the mechanic to monitor car performance and date distantly.
CF1 The e–Service runs with electrical power.
CF2 The e–Service provides safety for the driver by anticipating breakdowns.
CF3 The e–Service permits reduced mechanic visits.
CF4 The e–Service has a reasonable price.
1.5.3 Teleservice
At the automobile core market, to make a difference, companies are banking on
new technologies that make the vehicle connected and anticipate failures. Adopting
this strategy yields to positive aspects of safety. Among these new technologies we
shall mention teleservice. In the traditional process of making appointments by
telephone, when a maintenance operation is necessary, the customer is not always
able to accurately determine the nature of the intervention to be performed on his
car but today with teleservice the driver will no longer have to worry about it. This
technology consists of a range of features, all of which are geared to making life as
convenient as possible. It is a remote diagnostic tool that has the major advantage
1.6. Project specifications 17
of real–time inspection of the state of health of the driver’s car. The transmission of
accurate data to its preferred dealer will allow it to prepare in the best conditions
for the visit by ordering the required components, thereby reducing the duration of
its next passage in concession to a minimum. The driver’s visits are limited to what
is strictly necessary and the fixed maintenance intervals are over. This function is a
guarantee of quick and relevant troubleshooting methodology [Hir09].
This section describes the specificities of the project that will be used as guidelines
when developing and implementing the system.
• Choose the appropriate hardware and software for the achievement of the
project
1.6.3 Methodology
In order to satisfy the objectives of the project, a well determined strategy should be
taken to achieve the expected result:
1.7 Conclusion
Throughout this chapter, we presented the company STIMM and its services. We also
have located the subject of the project and detailed its specifications. We will try to
specify in the next chapters the steps used to carry out this project.
CHAPTER 2
Theoretical Framework
Contents
19
20 Chapter 2. Theoretical Framework
2.1 Introduction
CAN is a data exchange system for computing network realized in order to find a
serial communication solution in motor vehicles, which tend to integrate more and
more electronic controls [Nil]. This section will contain the CAN history at first, then
we will explain the CAN protocol. The messages communication process will be
defined at last.
In February of 1986, Robert Bosch introduced the Controller Area Network (CAN), a
multi–master serial bus that provides communications between controllers, sensors,
and actuators. In the past, automotive manufacturers connected electronic devices in
vehicles using point–to–point wiring systems. Fig. 2.1 as in [Fai16a] is the pictorial
view of the point to point wiring connection which worked fine when the functions in
the system were limited. Then, manufacturers began using more and more electronics
in vehicles, which resulted in bulky wire harnesses that were heavy and expensive.
Dashboard
Trans-
Active Power Power
mission Airbag
Suspension Seats Windows
Control
Later, they replaced dedicated wiring with in-vehicle networks, which reduced wiring
cost, complexity, and weight. Fig. 2.2 as in [Fai16b], symbolizes this tremendous
change.
CAN, a high-integrity serial bus system for networking intelligent devices, emerged
as the standard in-vehicle network. The automotive industry quickly adopted CAN
and, in 1993, it became the international standard known as ISO 11898. Since 1994,
several higher–level protocols have been standardized on CAN, such as CANopen and
DeviceNet. Other markets have widely adopted these additional protocols, which are
now standards for industrial communications.
Trans-
Active Power Power
mission Airbag
Suspension Seats Windows
Control
The CAN protocol specifies five different frame types for communication:
• Error frame: It is generated by any bus entity during the detection of an error
On a CAN bus, data messages passed on from any node that do not contain either
the sending node address or any expected receiving node. Instead, the message
content is tagged with a unique identifier across the network. All other nodes in the
network receive the same message and each one perform an acceptance test on the
identifier to determine whether the message, and thus its content, is relevant to that
particular node. If it is the case, it will be processed; otherwise, it will be ignored.
The unique identifier also determines the priority of the message. The identifier
with the lowest numerical value has the highest priority. In situations where two
or more nodes attempt to transmit messages at the same time, a non–destructive
arbitration technique ensures that messages are sent in order of priority to prevent
loss of messages [Kvab]. Fig. 2.5 simplifies the data transmission process.
The on-board diagnostic refers to the automotive electronic system that provides
self–diagnostic and reports capabilities for repair technicians to access the subsystem
of information for purposes of monitoring and repair performance [Kvaa]. The OBD
is what makes telematics and fleet solutions possible. Without it, there would be no
way to send all of the valuable data that the car collects. This section will provide all
relevant pieces of information about the OBD.
2.3.1 History
1980 1996
OBD-I
OBD-II
1994 present
To better understand how the OBD–II port grants unrestricted access to the CAN bus,
it is worth delving deeper into the Diagnostic Link Connector(DLC). Fig. 2.7 shows a
color–coded diagram of the DLC. Tab. 2.1 lists the standard assignments for each pin.
For this project, the J1850 bus (pins 2 and 10) and ISO 9141–2 bus (pins 7 and 15)
Tab. 2.1 are out of scope, but they are essentially diagnosis buses that operate in
a similar manner to CAN. As noted in the table below, there are also various pins
dedicated to manufacturer–specific bus types.
Depending on the model of the vehicle being targeted, it may be necessary to delve
into those other bus types to gain greater access to the vehicle’s internal systems.
Other noteworthy pins are pins 4 and 5, which are dedicated to the ground pins,
and pin 16, which provides a constant supply of 12 volts power from the vehicle’s
battery. The purpose of pin 16 is to provide power to scan tools being plugged into
the OBD–II port, so that they do not require an external power source. The most
important pins within the scope of this project, however, are pins 6 and 14, which
are dedicated to the Controller Area Network, or CAN bus. The terms “CAN High”
(CAN–H) and “CAN Low” (CAN–L) are derived from the way in which CAN messages
are physically transmitted.
Diagnostic Trouble Codes (DTC) are used to identify an issue or an error. They are
stored in the system and are extracted from the OBD–II port. The codes are not
necessarily the same across all vehicles [Kvaa; Lov16].
These codes, can either be generic or unique to the vehicle manufacturer, they take
the following format:
• xxx00 to xxx99 these are based on the systems defined in the third digit.
2.4.1 Connections
CAN bus uses a physical layer comprised of a shielded twisted pair a two wire system,
CAN–H and CAN–L. Each one of them has its own characteristics as indicated in
Tab. ??. These two wires carry anti-phase signals in opposite directions to minimize
noise interruption that simultaneously interferes on the bus. When the CAN bus is
IDLE (free state), both wires carry 2.5V of electricity [201d]. But when transmitting
data, the CAN–H wire voltage increases to 3.75V and the CAN–L wire voltage drops
to 1.25V, creating a 2.5V voltage differential between the two wires. It is this voltage
differential on which CAN communication is based, and which makes the CAN bus
so tolerant to electrical noise and interference. In order to verify that data is being
continuously exchanged along the CAN bus and that a signal is present on both CAN
lines we visualized signals from the OBD connector pins using an oscilloscope. Each
speed visualization requires a specific connection:
• To display the CAN high speed, we plugged the pin 5 (Ground) and the pin 6
(CAN–H) of the OBD connector to channel A of the oscilloscope as shown in
Fig. 2.8b. The obtained waveform is illustrated in Fig. 2.9.
(a) Plugging.
(b) Oscilloscope connection.
Clk
CAN–High
27
Output current > 1 mA over 2.2 kΩ 25 to 50 mA over 60 Ω
Number of nodes on the bus 2 to 20 2 to 20
Dominant level CAN–H = 4V / CAN–L = 1V CAN–H = 3.5V / CAN-L = 1.5V
Recessive level CAN–H = 1.75V / CAN–L = 3.25V CAN–H = 2.5V / CAN–L = 2.5V
Characteristic of the cable 30 pF between line cables 2 × 120 Ω
28 Chapter 2. Theoretical Framework
• To display the CAN low speed, we plugged the pin 5 (Ground) as well as the
pin 14 (CAN–L) of the OBD connector to the channel B of the oscilloscope as
demonstrated in Fig. 2.10b. The waveform is shown in Fig. 2.11.
Clk
CAN–Low
We dual visualize both the CAN–H and the CAN–L signals. The obtained waveform
shown in Fig. 2.12. It is a clear evident that the signals are completely synchronized
and opposite. They are mirror image of one another. The edges are linear and
coincide with each other which means that we have a fully functioning system. In
other words CAN bus allows communication between the nodes and the CAN control
unit. This test effectively checks the integrity of the bus at this point in the CAN
network.
Clk
CAN–High
CAN–Low
2.5 Requirements
Before beginning to design the monitoring system for automobiles, some require-
ments were set.
2.5.1 Design
The e–Service system design is divided into two layers: Hardware and Software. The
architecture model of the system is shown in Fig. 2.13. The hardware layer consists
of electrical specifications of the design. The software layer has the programming
design of the system.
Mass air flow Vehicle Engine Throttle Engine coolant
Oxygen
sensor speed speed position temperature
sensor
(MAF) sensor sensor sensor sensor
Arduino UNO R3 CAN-bus shield
30
Controller
Area
Network
(CAN)
O2 Vehicle Engine Coolant
MAF Throttle
Voltage speed RPM Temperature
Figure 2.13: Block diagram of the system.
2.5. Requirements 31
2.5.2 Hardware
Although the OBD–II port is an unsecured interface, data reading is not as simple as
plugging the computer directly into the OBD–II port. In order to use a computer to
communicate on the CAN bus, some additional hardware peripherals are necessary.
CAN–bus shield
Shields are boards that can be stacked on top of the Arduino circuit board allowing
to extend its capabilities. The CAN–bus shield displayed in Fig. 2.14 provides the
Arduino with CAN–bus data. It will allow us to extract informations from the ECU.
Arduino Uno
Arduino is an easy and an efficient tool to use for wide spectrum of embedded system
applications, due to its open source software availability it was the perfect choice
for this project. Tab. 2.3 represents a comparison chart between the commonly used
boards for this type of application including their most important characteristics.
Clock frequency
Microcontroller
Output current
Flash memory
Analog inputs
Input voltage
PWM output
Digital I/O
EEPROM
SRAM
32
Arduino Board
Due ATSAM3X8E 7–12 V 3, 3 V 130 mA 84 MHz 512 KB 96 KB 54 12 12
Leonardo ATmega32U4 7–12 V 5V 40 mA 16 MHz 32 KB 2, 5 KB 1 KB 20 7 12
Mega ATmega2560 7–12 V 5V 20 mA 16 MHz 256 KB 8 KB 4 KB 54 12 16
Pro ATmega328P 5–12 V 5V 40 mA 8 MHz 32KB 2 KB 1 KB 14 6 6
Uno ATmega328P 7–12 V 5V 20 mA 16 MHz 32 KB 2 KB 1 KB 14 6 6
2.5. Requirements 33
DB9 to OBD–II adapter allows the CAN bus shield to mate with the OBD–II port
directly. It has an OBD–II connector on one end and a DB9 female serial connector
on the other end [Ele], as illustrated in Fig. 2.16.
2.5.3 Software
With the appropriate hardware in place to establish an appropriate link between the
computer and the CAN-based system, it is also necessary to download and install
the appropriate software to enable computer to vehicle communication. Therefore,
we are going to use the Arduino IDE for programming, as well as LabVIEW for
developing the graphical user interface.
Arduino IDE
Arduino IDE is a programming environment that allows the user to sketch different
kind of programs and load them into the Arduino microcontroller. Arduino uses a
programming language called Processing. IDE compiles and translates the code to the
assembler language, after that it uploads the program to the Arduino microcontroller.
Arduino IDE has a built–in code parser that will check the user written code before
sending it to the Arduino [201b].
LabVIEW
Any instrumentation application will have two components, namely, the user interface
and the underlying code. This program will allow us to monitor the car performance
[201a].
2.6 Implementations
This section shows the hardware required implementation for the project.
The Arduino board comes with an built–in female pin header which has connections
to its input/output pins. The shield comes with the same alignment of pins so it can
be overlaid on the Arduino R3, so there is no need for wires to join the CAN bus
shield and the Arduino. In order to clarify this connection, we created a prototype
using Fritzing as illustrated in Fig. 2.17.
To extract CAN bus data from the OBD–II system, we need to connect the DB9 pinout
of the CAN–bus shield to the OBD–II port of the vehicle. These connections are
displayed in Fig. 2.18a and Fig. 2.18b.
2.7. Programming 35
2.7 Programming
2.7.1 Software overview
As a global overview of Arduino programming, it is divided, as established in the
IDE code development, in two main parts: setup and loop functions. The first one
36 Chapter 2. Theoretical Framework
is executed once the application runs. The second one is executed as a loop. it will
run repeatedly unless the power off or reset button is activated as demonstrated in
Fig. 2.20. At the beginning of the Arduino code all the components are delimited:
type, the pin to which is associated and the operation mode. In addition, the global
variables and the librariesto be used are defined.
START
YES
SETUP()
Reset
LOOP() NO
button
Powered YES
NO
END
• Canbus.h
• defaults.h
• global.h
2.7. Programming 37
• mcp2515.h
• mcp2515–defs.h.
Every vehicle might use different bitrate speeds. For our example, we use 500 kbps.
Fig. 2.21 shows the successful setup loop execution.
• Ext: represents the status of the frame ‘0’ means standard frame, ‘1’ means
extended frame
38
write:
”1.Speed
2.RPM
3.Throttle
4.Coolant temperature
5.Oxygen voltage
6.MAF sensor”
if if if if if if
UserInput NO UserInput NO UserInput NO UserInput NO UserInput NO UserInput
=’1’ =’2’ =’3’ =’4’ =’5’ =’6’
YES YES YES YES YES YES
Vehicle Engine Engine Coolant Oxygen
MAF
Speed RPM Throtlle Temp Voltage
END
Figure 2.22: Data reading flowchart.
2.7. Programming 39
When writing on the can bus, we can manipulate various things, for instance:
Fig. 2.23 presents the code flowchart that allows us to write to the CAN bus.
START
Include libraries
Variables declaration
Serial setup
if
write:
CAN speed NO
”can’t init OK ”
=500
YES
write:
”CAN init OK ”
CAN.setMode
(MCP-NORMAL)
byte sndStat =
CAN.sendMsgBuf
(INT32U ID,
INT8U Ext,
INT8U Len,
INT8U *Buf)
if write:
(sndStat NO ”Error Sending
= CAN-OK) Message”
YES
write:
”Message Sent
Successfully!”
END
2.8 Conclusion
In this chapter, we have presented the operating principle of the Controller Area
Network and the On Board Diagnostic system. We also specified and implanted both
needed hardware and software for the project. The following and final chapter will
present the results validation.
CHAPTER 3
Monitoring and Validation Results
Contents
41
42 Chapter 3. Monitoring and Validation Results
3.1 Introduction
In this chapter, we will precede to the project software implementation. It will start
by explaining the used program, followed by the design of both user and programmer
interfaces developed for the monitoring process. Afterward, the program will be
put to the test and the obtained results will be discussed. The chapter then ends by
creating a web page.
As we mentioned previously that the goal of this project is to create a system that
will allow a qualified agent to distantly monitor a car performance on the garage
computer, who will instantly call the conductor and fix a checkup appointment in
case of the appearance of an anomaly. In order to achieve this goal and to guarantee
the serial communication between the hardware and the monitor that should contain
real–time data collected by the multiple sensors implanted in the vehicle, we used
LabVIEW to insure this process, as displayed by Fig. 3.1.
Component Description
Terminals Terminals are the entry and exit ports that exchange information
between the front panel and block diagram. You can view terminals
as icon conserve space.
Nodes Nodes are objects on the block diagram that have inputs and/or
outputs and perform operations when a VI runs. Nodes are analogous
to statements, operators, functions, and subroutines in text-based
programming languages. Nodes can be functions, subVIs, or structures.
SubVIs SubVIs are VIs that run on the block diagram of another VI. They have
front panels and block diagrams. Any VI has the potential to be used as
a subVI. When you double–click a subVI, the front panel and block diagram
open.
Icon Icons are the graphical representations of VIs.
Use the icon from the upper–right corner of the front panel as the icon that
appears when you place the subVI on a block diagram.
Connector pane The connector pane is the map of inputs and outputs of a VI.
The connector pane terminals correspond to the controls and indicators on the
front panel of the VI. You cannot access the connector pane from the
block diagram window.
3.4.1 Arduino
Once we upload the sketch onto the Arduino board using a USB connector, we open
up the serial monitor window to visualize the data streaming in from the OBD–II
port, as represented in Fig. 3.2.
44 Chapter 3. Monitoring and Validation Results
3.4.2 LabVIEW
Using LabVIEW software, we created a similar interface to the Arduino’s, that allows
us to receive continuous data from serial port.
Front panel
All of the Data will be displayed on the following interface as indicated in Fig. 3.3. In
order to initialize the monitoring process, the used COM port must be chosen from
the VISA resource name out control. Six indicators will be laid out, each one of them
will show a specific data.
Block diagram
Fig.3.4 shows the details of the block diagram that describes the monitoring process.
The operation begins with placing a VISA configure serial port which is a standard
Input/Output language for instrumentation programming, then connecting a control
to the input. The default baud rate is 9600. The obtained response shows the
complete data that is coming from the serial port, so we used several VISA read
functions that scans the specified number of bytes from the interface specified by
VISA resource name in order to split and show each data in deferent sequence as
follow:
• Engine RPM
• Vehicle speed
• Temperature
• Throttle
• O2 Voltage
The obtained output enters the match regular expression function which splits the
string into two substrings, for the purpose of extracting the units that comes with the
data:
• rpm
• km
• °C
• %
• V
• g/s.
This entire process is inside six frames in a flat sequence structure. The chosen loop
executes from left to right when all data values wired to a frame are available. The
data leaves each frame as the frame finishes executing. This means that the input of
one frame can depend on the output of another frame. Finally, we have placed a Visa
close function that closes the device session when the program is finished.
46
Figure 3.4: Serial reading block diagram
3.5. Authentication 47
3.5 Authentication
The visualization of the car’s performance is confidential between the customer and
the maintenance garage. The purpose of the login interface is to implement security,
so access will only be granted to a particular garage agent. This section is dedicated
to design the front panel and the graphical representation of the authentication
interface.
The block diagram of the access VI as shown in Fig. 3.7 contains an event structure
that allows the user to write highly efficient code that waits for the events to happen.
Inside the loop, both login and password strings are connected to a sub VI as indicated
in Fig. 3.8. This whole operation is placed inside a “While Loop” which is enabled by
the RUN/STOP switch. As long as the switch is in the “RUN” position, its terminal
counterpart in the block diagram outputs a “TRUE” to the condition terminal keeping
the While Loop enabled and a “FALSE” disables the “While Loop”. As long as the
Loop is enabled, the code inside it is repeatedly executed.
Link diagram
The block diagram as represented in Fig. 3.9 was designed for the purpose of creating
a link between the access VI and the main VI. The code will allow the user to have an
instantaneous transfer to the main VI once the access is granted. This operation was
created using at first an open VI function and declaring main as a reference VI, the
output will go through the invoke node and at the end we used the close reference
function. This process is inside a flat sequence structure.
1. Start
2. Stop
3. Exit.
50
Figure 3.10: Main VI front panel.
3.7. Virtual dashboard 51
• Temperature
• RPM.
Fig.3.12 illustrates our design that contains two virtual digital gauges.
The left one indicates the rounds per minute (RPM) of the vehicle which is scaled
from 0 to 10000, as for the right one, it displays the car velocity and it is scaled from
0 to 200. The car temperature appears in the center of the dashboard, a rated scale
was associated as well as a numeric display.
52
Figure 3.12: Virtual dashboard VI front panel.
3.8. Running the program 53
3.8.1 Overview
Once the system is designed, the next step is to run the program. The execution of
the VIs will not be all at once, the access VI has the highest priority to guarantee the
confidentiality. If the access is granted, the monitor VI will start working to provide
data to the main VI that will appear instantaneously to the user followed by the
virtual dashboard interface. The flowchart in Fig. 3.14 describes this order.
54 Chapter 3. Monitoring and Validation Results
START
Access VI
Access
NO SOS
guaranteed
YES
Monitor VI
Main VI
Dashboard VI
END
Monitor VI
After running the program and selecting the appropriate serial COM port, the monitor
VI will start showing the divided car parameters in their convenient indicators, as
presented in Fig. 3.15.
3.8. Running the program 55
Main VI
Fig. 3.16 shows the obtained results of the main VI simulation, the operation started
by pressing the “Start” button. Once activated, both waveforms began displaying the
point–by–point data variation over time.
Dashboard VI
The virtual needles as displayed in Fig. 3.17 follows the exact same pace of the actual
dashboard that exists in the conductor’s car.
56 Chapter 3. Monitoring and Validation Results
This feature greatly expands the application as several persons sitting at different
locations can simultaneously access the same front panel. In order to proceed the
remote communication operation, a LabVIEW configuration must be held. The default
port number for the web server is 8080, we changed it to 8000. In web server local
debugging, we enable remote panel server and ticked to allow distant connection
while debugging. Also, from web configuration we changed HTTP port in local
debugging window to 8000, this number must be the same one as the debug HTTP
port that we set previously. The next step was to set the control time limit which is
very useful if the VI will be accessed by multiple users. If there is no control time
limit, a single user could monopolize control of the application, preventing other
users from assuming control. In our configurations, we ticked allow access in case
more than one garage agent wanted to visualize the interfaces. The final step is to
tick the first icon in the browser access, this will allow the user to have viewing and
controlling privileges. Fig. 3.19, presents the parameter’s configuration of the web
server option.
Figure 3.19: Screen–shot of configuring visible VIs and browser access list.
We followed the exact same previous steps and created four web pages for each VI.
Fig. 3.21 shows an example of the obtained results of the web page for the Main VI,
published on the browser window.
3.10 Conclusion
This chapter describes the entire process of the software design and the achieved
results. The obtained system is considered as a competitive product in the market
thanks to its low cost and its efficiency comparing to the regular diagnostic systems.
General Conclusion
We recapitulate here the results obtained during our internship at the maintenance
workshop “360 Auto”, then we present the perspectives relative to this work.
Summary
Our major contributions in this work revolves the realization of a system that can
monitor the condition of the vehicle in real time. The first contribution concerns the
understanding of the automotive field and the electronics being involved, as well as
the identification of the project subject and its specifications.
The second contribution considers the theoretical framework. The approach is based
on the study of both Controller Area Network and the On Board Diagnostic followed
by programming the Arduino R3 and the CAN–bus shield.
The third and final contribution is dedicated to the design of the monitor interfaces
using LabVIEW. The proposed solution successfully detected the vehicle parameters
and displayed them on the designed virtual dashboard and show it point–by–point
on the main VI charts. Since this whole project, research and implementation work,
a lot of advancement can be added.
61
62 General Conclusion
63
64 Bibliography