<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Data Mining and Analysis for Data From Vehicles Based on the OBDII Standard</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Balázs Bánhelyi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Tamás Szabó</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Szeged</institution>
          ,
          <country country="HU">Hungary</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <fpage>29</fpage>
      <lpage>31</lpage>
      <abstract>
        <p>Today every new car has an OBDII (On Board Diagnostic II) port that can be used to retrieve vehicle diagnostic data using an ELM327 or STN1110 chip. This microcontroller can be used to determine the currently measured parameters of the vehicle, such as speed, engine and water temperature, battery charge level, and error codes for fault detection. Our research aimed at developing an application and an algorithm for limited HW resources that performs the relevant analysis of the collected data and produces statistics on whether the currently measured value is within the suitable range. Since the algorithm is executed and the data is stored on a mobile phone, it is impossible to store and analyze all measured values. By examining the diferent readings (if they are alarming several times in a row) it would be possible to warn the user that there may be a problem with the vehicle. By monitoring the data, it would be possible to reduce the probability of major faults occurring and provide information about the occurrence of the fault.</p>
      </abstract>
      <kwd-group>
        <kwd>OBD II</kwd>
        <kwd>Fault Detection</kwd>
        <kwd>Confidence Interval</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        On-board diagnostics (OBD) is an automotive term that refers to the self-diagnosis
and reporting capability[
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. In the development of OBD, the problems caused by
periodic emission monitoring played an important role. CARB (California Air
Resources Board) has recognized this and made continuous monitoring compulsory
for manufacturers.
      </p>
      <p>Copyright © 2020 for this paper by its authors. Use permitted under Creative Commons License
Attribution 4.0 International (CC BY 4.0).</p>
      <p>The Onboard Diagnostic System (called OBDI) became obligatory in the USA
in 1988. The technical specifications were defined by SAE (Society of Automobile
Engineers) standards and recommendations. In 1994 OBDI was replaced by OBDII,
and from 1996 it was also mandatory for diesel vehicles.</p>
      <p>EOBD is the European equivalent of OBDII, which had to be introduced in the
member states of the European Union by Directive 98/69/ EC.</p>
      <p>A large amount of diagnostic information about the car can be obtained via
OBD. To analyze this information, a simple and cheap ELM327 chip was used
based on OBD interfaces (Figure 1), which is powered by the Microchip Technology
PIC18F2480 Micro Controller. Newer devices use the STN1110 chip, which is fully
compatible with ELM. ELM is a preprogrammed microcontroller, and the ELM327
Command Protocol is one of the most popular PC -OBD interfaces.</p>
      <p>
        Many applications process OBD signals and have used Android mobile phones
for that[
        <xref ref-type="bibr" rid="ref2 ref7">2, 7</xref>
        ]. Many applications display basic information for the car owner,
and there are many experiments to process this data for its original purpose. For
example, some developers try to retrieve information that is specific to the driver[
        <xref ref-type="bibr" rid="ref4 ref5 ref6">4–
6</xref>
        ], or the vehicle state[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>
        Some researchers are also working on automatic error detection. Most of them
look at a single data series. In particular, cases when data that are outside the
expected values are reported to the user as fail[
        <xref ref-type="bibr" rid="ref13 ref3">3, 13</xref>
        ]. Another new feature is that
changes in the linear relationship between certain parameters are detected. If these
values change, that indicates a message. This can also be used for special features
based on preliminary tests where they have had good results[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>In contrast, our research aimed at the development of a fully automatic fail
detection system. The detection was based on rare data. The good vehicle works
with typical values for a long time. During this time the correct working values
were recorded, but a failed vehicle usually showed values that were not usual. Our
algorithm tries to find automatically the rare data and the parameters indicating
the failure.</p>
    </sec>
    <sec id="sec-2">
      <title>Android Application</title>
      <p>An Android application was written that communicates with the ELM interface via
Bluetooth. On the main screen, you can see the data of the real-time measurement
(see Figure 2). Benchmarks can also be performed like Engine Load, Throttle
Position, Engine Coolant Temperature, Air Intake Temperature, etc.</p>
      <p>Under settings (Figure 3) further details can be set, e.g. the parameters to be
measured. You can do this under OBD commands. Under OBD protocol one can
select the most frequently used protocols. Supported protocols:
• SAE_J1850_PWM
• SAE_J1850_VPW
• ISO_9141_2
• ISO_14230_4_KWP
• ISO_14230_4_KWP_FAST
• ISO_15765_4_CAN(_B, _C,_D)
• SAE_J1939_CAN</p>
      <p>The ratio of successful communication of interactions between interface and
Android phone was investigated. As it can be seen in Table 1, that below 800ms
too much data are lost. The conclusion is that we can communicate enough data
with a density of 1 second.</p>
      <p>Data collection on mobile phones is fast enough, but still it is impossible to
process this amount of data in the long run on the resources of the phones. However,
communication interval
100 ms
following section, we recommend a procedure that does not require data to be
recorded but uses more recent data to detect errors more accurately.</p>
    </sec>
    <sec id="sec-3">
      <title>Statistical fault detection</title>
      <p>
        The data processing is performed with a confidence interval analysis. The
conifdence ellipsoid is calculated for the data with a normal distribution [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
Previously in our publications, this was used for conditions of optimization problems for
non-independent variables. In the conditions, a better estimate was given of the
co-occurrence probability of non-independent variables. Predicting rare events in
the case of a related variable is useful[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>To calculate the Confidence Ellipsoid, the sum of the measured data ( ∑︀  1), a
sum of the square of the data (∑︀
 12) and a sum of the product (∑︀
 1 2) must be
collected. This information can be calculated with the following methods, where
the new data is  1
( +1) and  2( +1):
︁∑
 1( ) = ∑︁</p>
      <p>1( ) +  1( +1)</p>
      <p>The eigenvalues and eigenvectors determine the confidence ellipsoids for the
normal values with a diferent confidence level. To calculate the confidence interval
of the data, the data was transformed into a normal distribution with expected
values of zero. The transformation whitening matrix is

= 
√
,
where 
is a diagonal matrix of eigenvalues and the 
matrix is the one whose
columns are the corresponding right eigenvectors of the covariance matrix. This
was illustrated for two measured data sets in Figure 4.</p>
      <p>This matrix can be calculated from previous information. If the following
condition applies to the new pair of values:
considered to be not rare.
︁(
 1( )</p>
      <p>,  2( ))︁ , then the measured data is
⃦
⃦
⃦
⃦
 −1 ︂( (︁
 1( )
,  2( ))︁
−
︂( ∑︀  1 ∑︀  2 )︂

,

⃦
⃦
⃦⃦ &gt; ,
where  is the confidence level.</p>
      <p>If the new values are rare, the users can be warned.</p>
      <p>After a certain large
number of warnings, the application displays errors. In other cases, the new values
are inserted into the previously calculated information to improve the statistics of
the rare values.</p>
    </sec>
    <sec id="sec-4">
      <title>Results</title>
      <p>We have completed further measurements with data such as Vehicle Speed, Engine
RPM, Engine Coolant Temperature, Fuel Pressure, Engine Load, Throttle Position,
and Air/Fuel Ratio.</p>
      <p>We have generated some faulty operation, for example, a bad cooling system,
an error in the power source or a poor fuel supply.</p>
      <p>In these measurements we found that although the data showed mean values,
when we looked at 2 data series we could already find pairs of variables where the
data were outside the expected range.</p>
      <p>In one case the power source for the cooling system was switched of. The
measured data of the cooling water and engine compartment temperatures are
shown in Figure 5. The cooling water temperature is on the horizontal axis, while
the engine compartment temperatures are on the vertical axis. The green dots
illustrate the proper operation and the red dots are measured under the cooling
failure system. The values for both sets are in the normal range, but in the worst
cases they will be shifted to the warmer range. It can be seen that the majority
of the values measured for a defective vehicle were outside the 95% confidence
interval, while in the good case they are mostly inside.</p>
      <p>The other faulty cases had similar results. Unfortunately, it is not trivial which
of the two data sets are useful for monitoring. It is a good idea to keep an eye on
all of them, especially when other untested bugs are likely to be helpful.</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>We have developed a system that is capable to detect rare data. If it appears, the
users can be alerted. In the future, we would like to expand the application. We also
plan to generate more errors in cars and investigate whether higher dimensions lead
to better results. The long-term goal is to create a uniform database for comparing
vehicles based on these results.</p>
      <p>Acknowledgements. This research was supported by the projects “Extending
the activities of the HU-MATHS-IN Hungarian Industrial and Innovation
Mathematical Service Network” EFOP-3.6.2-16-2017-00015, the János Bolyai Research
Scholarship of the Hungarian Academy of Sciences, and the Unkp-19-4-Bolyai+
New National Excellence Program of the Ministry of Human Capacities. Special
thanks to Tamás Radványi for the implementation and running the related
computer programs, who was supported by the “Integrated program for training new
generation of scientists in the fields of computer science”,
EFOP-3.6.3-VEKOP-162017-0002.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Bandara</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Amarasinghe</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kottegoda</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , et al.:
          <article-title>Cloud-Based Driver Monitoring and Vehicle Diagnostic with OBD2 Telematics</article-title>
          , in: vol.
          <volume>6</volume>
          ,
          <string-name>
            <surname>Aug</surname>
          </string-name>
          .
          <year>2015</year>
          , doi: 10.4018/IJHCR.2015100104.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Čabala</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gamec</surname>
          </string-name>
          , J.:
          <source>Wireless Real-Time Vehicle Monitoring Based on Android Mobile Device, Acta Electrotechnica et Informatica</source>
          <volume>12</volume>
          (
          <issue>Jan</issue>
          .
          <year>2012</year>
          ), doi: 10.2478/ v10198-012-0039-x.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Grimaldi</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mariani</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>OBD Engine Fault Detection Using a Neural Approach</article-title>
          , in: Mar.
          <year>2001</year>
          , doi: 10.4271/2001-01-0559.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Hwang</surname>
          </string-name>
          , C.-p.,
          <string-name>
            <surname>Chen</surname>
          </string-name>
          , M.-S.,
          <string-name>
            <surname>Shih</surname>
            ,
            <given-names>C.-M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
          </string-name>
          , H.-Y.,
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Apply ScikitLearn in Python to Analyze Driver Behavior Based on OBD Data</article-title>
          ,
          <source>in: May</source>
          <year>2018</year>
          , pp.
          <fpage>6366</fpage>
          -
          <lpage>39</lpage>
          , doi: 10.1109/WAINA.
          <year>2018</year>
          .
          <volume>00159</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Jang</surname>
            ,
            <given-names>J.-W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>A Study on In-Vehicle Diagnosis System using OBD-II with Navigation (Jan</article-title>
          .
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Jang</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          , Jong, D.,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Methodology to improve driving habits by optimizing the in-vehicle data extracted from OBDII using genetic algorithm</article-title>
          ,
          <source>in: Jan</source>
          .
          <year>2016</year>
          , pp.
          <fpage>3133</fpage>
          -
          <lpage>16</lpage>
          , doi: 10.1109/BIGCOMP.
          <year>2016</year>
          .
          <volume>7425936</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Kalmeshwar</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Prasad</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Development of On-Board Diagnostics for Car and it's Integration with Android Mobile</article-title>
          , in: Dec.
          <year>2017</year>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          , doi: 10.1109/CSITSS.
          <year>2017</year>
          .
          <volume>8447540</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Lefever</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Measuring Geographic Concentration by Means of the Standard Deviational Ellipse</article-title>
          ,
          <source>American Journal of Sociology 32.1</source>
          (
          <issue>1926</issue>
          ), pp.
          <fpage>889</fpage>
          -
          <lpage>4</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Moniaga</surname>
            ,
            <given-names>J. V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Manalu</surname>
            ,
            <given-names>S. R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hadipurnawan</surname>
            ,
            <given-names>D. A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sahidi</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Diagnostics vehicle's condition using obd-ii and raspberry pi technology: study literature</article-title>
          ,
          <source>Journal of Physics: Conference Series 978 (Mar</source>
          .
          <year>2018</year>
          ), p.
          <volume>012011</volume>
          ,
          <issue>doi</issue>
          : 10 . 1088 /
          <fpage>1742</fpage>
          - 6596/978/1/012011, url: https://doi.org/10.1088%
          <fpage>2F1742</fpage>
          -
          <lpage>6596</lpage>
          %2F978%
          <fpage>2F1</fpage>
          %
          <fpage>2F012011</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Neumaier</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fuchs</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dolejsi</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          , et al.:
          <article-title>Application of clouds for modeling uncertainties in robust space system design</article-title>
          ,
          <source>tech. rep., ARIADNA Study 05/5201, European Space Agency (ESA)</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>OBD</surname>
            <given-names>II</given-names>
          </string-name>
          -
          <article-title>On-Board Diagnostic System</article-title>
          , url: http://www.obdii.com/.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <article-title>Oracle java documentation</article-title>
          , url: https://docs.oracle.com/javase/7/docs/api/ java/lang/Number.html.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>PCMSCAN-Palmer Performance</surname>
          </string-name>
          Engineering, url: https://www.palmerperformance. com.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>