Académique Documents
Professionnel Documents
Culture Documents
Hardware
14 digital I/O pins
Automotive OBD
16 MHz clock speed
ISO Interface 32 KB memory
Software About $30 online
Data
Conclusions
Arduino
Program sketches in
Multi-platform Java-
based IDE
Code in C/C++
Serial Communication
(currently USB)
Hardware
Goals of this project:
Arduino
Communicate with an automotive
Hardware
engine control unit (ECU) via the
Arduino
Automotive OBD
Conclusions
?
Hardware
Vehicles produced in
the U.S. after 1996 are
required to have an
OBD-II (on-board
diagnostic) connector
Hardware
OBD-II Interface
Very simple connection
for most applications
Most important pins
K-Line
Ground
+12V
Hardware
Open-source project
called OBDuino
offered the interface
schematic
(which is fortunate,
because I am not an
EE major)
Hardware
Open-source project
called OBDuino
offered the interface
schematic
(which is fortunate,
because I am not an
EE major)
Hardware
Freescale MC33290 handles the tricky parts
K-Line, Ground, and +12V go in
Serial Tx/Rx come out
Hardware
OBD-II
Software
A few functions to perform:
Arduino
Initialize ISO connection
Hardware Request data from vehicles ECU
Automotive OBD
Display the result on the LCD and
ISO Interface
record the value to retrieve later
Software
Data
Conclusions
Software
Initialization:
Starts by bit-banging 0x33 at 5 baud
i.e.
00110011
200ms pause = 1.6 seconds
Software
Initialization:
Starts by bit-banging 0x33 at 5 baud
Code:
byte
b
=
0x33;
for
(byte
mask
=
0x01;
mask;
mask
<<=
1)
{
if
(b
&
mask)
//
Choose
bit
digitalWrite(K_OUT,
HIGH);
//
Send
1
else
digitalWrite(K_OUT,
LOW);
//
Send
0
delay(200);
}
Software
Then you can start 10.4 kbps communication and
perform these steps to finish initialization:
Software
Parameter IDs (PIDs)
SAE J1979 standard
Examples:
byte message[6];
byte buf[11];
Byte(s) Description
0 Message Header 1
1 Message Header 2
2 Source Address
39 Data (up to 7 bytes)
Final byte Checksum
Software
3. Convert returned value with formula
ie.:
double
rpm;
rpm
=
((double)buf[0]
*
256)
+
(double)buf[1])
/
4.0;
Software
4. Record/display value and repeat
LiquidCrystal
lcd;
lcd.print(rpm);
Software
4. Record/display value and repeat
Writing to an SD card:
File
log;
log.print(rpm);
Software
One last note on PIDs
Automotive OBD
1-2 seconds
ISO Interface Vehicle Speed
Software
Calculated MPG
Data
mph
Data
mph rpm
Data
C
Data
C mph
Conclusions
Embedded computing is
Arduino ubiquitous
Hardware
Data
machines
Elec. Engineering and CS
Conclusions