0% found this document useful (0 votes)
1K views

Application Note AN04 - ELM327 and Bluetooth: Using Serial To Bluetooth Adapters

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Application Note AN04 - ELM327 and Bluetooth: Using Serial To Bluetooth Adapters

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Application Note

AN04 - ELM327 and Bluetooth ®

We are often asked how to connect our ELM327 you’ll have to set it for 9600 baud (or learn to program
to a Bluetooth wireless system. In addition to working it). Decide on which rate you prefer, and then make
at speeds of up to 700kbps, Bluetooth offers several sure that you set the ELM327’s pin 6 logic level to
other advantages over wired interfaces. For example, allow it.
it provides galvanic isolation between the vehicle and Regardless of which Bluetooth adapter that you
the computer’s wiring, and it also allows connections choose, the next step is to ‘pair’ the device with your
with devices that do not have RS232 or USB ports. computer. Follow the manufacturer’s instructions on
The following provides a few ideas on how you how to do this. Do not be surprised if there is no
might add Bluetooth to your ELM327 circuit. software needed, as many modern operating systems
will have default Bluetooth drivers built in. Simply
follow the procedure to add the device (as a ’Serial
Using Serial to Bluetooth Adapters
Port’) and then use it as you would any physically
There are a few RS232 to Bluetooth converters on connected serial device.
the market that can simply connect to a 9 pin RS232
connector, and provide Bluetooth capability. Two of
these devices are the Firefly from Roving Networks Using Serial to Bluetooth Modules
(www.rovingnetworks.com) and the GBS301 from Connecting a Bluetooth adapter to the RS232
IOGEAR (www.iogear.com). connector may be convenient, but your connection
Both the FireFly and the IOGEAR provide a speeds are severely limited by the RS232 circuitry. If
connector for an external power source, but also allow you could bypass the RS232 stage and connect the
DC to be provided through the RS232 connector (on ELM327 directly to the Bluetooth transceiver, then you
pin 9). Your ELM327 circuit can be modified as shown would be able to operate at much higher baud rates.
in Figure 1 to provide this power, so that you do not Several modules that contain a complete serial
need to connect the DC supply each time: Bluetooth system (including an antenna) are now
available in the marketplace. These provide a logic
+5V
4 (DTR) level RS232 interface for your circuitry and a standard
n.c. Bluetooth protocol for ‘connecting’ to your controlling
6 (DSR)
16 15
RS232 device. One such module is the LMX9838 from
7 (RTS) Interface National Semiconductor (www.national.com).
327 U1 (DB9F)
8 (CTS) The LMX9838 is a terrific little (1.0cm x 1.7cm)
14 0.1µF
solution, but it needs a 3.3V supply to operate. Since
9 (RI)
the ELM327 uses 5V, it would seem that the two are
not compatible. We often get questions concerning
Figure 1. 5V for the Bluetooth Adapter such an interface, so will discuss it here.

Note that these modules draw a significant current Interfacing to 3.3V


when operating (about 50mA), so you may need to
modify your ELM327’s 5V supply in order to provide Connecting to a 3.3V system usually requires
the required power. If your circuit uses a small 78L05 some form of voltage conversion. Some 3.3V ICs have
regulator (as is shown in Figure 9 of the ELM327 data inputs that are ‘5V tolerant’ (but not all), and most 5V
sheet), we recommend that you change it to a larger logic (the ELM327 included) will not tolerate 3.3V on
7805 type regulator. an input, so in general a circuit is required.
If you are using the RS232 interface from the You can buy ‘level translator’ integrated circuits to
ELM327 data sheet, you will find that it does not handle the voltage translation for you. Examples are
always work reliably at 115200 baud, so should only the TXB0102 by Texas Instruments (www.ti.com), and
be used at speeds of 57600 or less. The IOGEAR the ST2129 by ST Microelectronics (www.st.com).
GBS301 offers 9600, 19200, 38400, and 57600 baud Their connection is straight-forward as can be seen in
rates from the dip switch, so can be easily set for the bubble of Figure 3.
38400 or 57600 baud and connected to your ELM327 If you wish to build your own interface circuit, it
circuit. The FireFly adapter only offers 9600 or 115200 can be done with commonly available parts. Figure 2
baud from the dip switch, however, which means that shows one example that works well for most of the

AN04 rev B Elm Electronics – Circuits for the Hobbyist 1 of 3


www.elmelectronics.com
Application Note
AN04 - ELM327 and Bluetooth ®

+5V
its output. To meet the extra current requirements of
+3.3V the module (65mA maximum), be sure that your 5V
4.7KΩ supply uses a 7805 type regulator, and not a 78L05
Rx type.
10KΩ
The LMX9838 module can be set for 9600 or
ELM327
115200 baud by changing the logic levels on pins 25
Tx and 26. Initially, set the module for 9600 baud, but
3.3V
2.7KΩ Device make provisions for switching to 115200 baud later (as
Tx Rx 9600 baud is too slow).
4.7KΩ
The ELM327 comes from the factory set for 9600
and 38400 baud - to provide a rate of 115200 requires
changing the 38400 baud rate with Programmable
Figure 2. A 5V to 3.3V Interface
Parameter 0C.
baud rates that you would encounter with an ELM327. To change the ELM327’s baud rate, first connect
the circuit of Figure 3 for 9600 baud (see the chart for
This circuit uses a simple resistor voltage divider
the connections). Power your circuit, and set up your
to reduce the ELM327’s 5V Tx output to approximately
PC to use Bluetooth for a serial port. Follow the
3.3V. The 2.7KΩ and 4.7kΩ resistors shown work well
Operating System’s procedure to ‘pair’ to the
over a wide range of frequencies while still presenting
LMX9838 (the code is 0000), and then connect to the
a reasonable load to the ELM327.
ELM327 through the new serial port at 9600 baud. You
Interfacing a 3.3V output to the ELM327’s 5V input should be able to perform simple commands such as
requires a little more circuitry. Amplification is needed AT I, even if no vehicle is connected:
to increase the 3.3V level, so we add a transistor to
the circuit, as shown. When the Tx output from the >AT I
‘3.3V Device’ is above about 2.8V, the transistor will ELM327 v1.4b
be turned off, and the ELM327’s Rx input will have 5V
applied to it through the 4.7kΩ resistor. When the 3.3V Once you know that all is working well at 9600
output switches to a low level, the transistor will be baud, set the ELM327 for a power on default baud rate
driven into saturation and the Rx input will go to about of 115200 (when pin 6 is high). To do this, assign the
0V. value 23 to PP 0C:
Since the transistor is operated in saturation, there
>AT PP 0C SV 23
will be a slight delay in turning off due to the charge
storage. Because of this delay, the rising edge of the and then enable the use of this new value:
ELM327 Rx input will show a very slight pause in the
voltage while the charge is depleted. This does not >AT PP 0C ON
really affect the operation here, but if you wish to adapt
this circuit for use at higher frequencies, it is That’s all that is required is to permanently change
something that you must be aware of. the baud rate. Now, change the wiring so that the
ELM327 and the LMX9838 power up to the high speed
baud rate. That is, connect pin 6 of the ELM327 to 5V,
Connecting to the Bluetooth module and connect the resistors on the LMX9838 module
The next page shows an LMX9838 Bluetooth pins 25 and 26 to 0V and 3.3V, respectively.
module connected to an ELM327 through the circuit of Apply power to your circuit, and test the Bluetooth
Figure 2. (The ELM327 circuit is from Figure 9 of the connection. You may have to change your software for
ELM327 Data Sheet.) 115200 baud instead of 9600. If all has gone well, you
The module requires a 3.3V power supply, so a should now have a high speed wireless OBD
voltage regulator has been added. We show an interpreter.
MIC5200-3.3 from Micrel (www.micrel.com), but there
are many alternatives (such as Microchip’s MCP1700).
The regulator has been connected directly to the +5V
supply, and filter capacitors have been connected to

AN04 rev B Elm Electronics – Circuits for the Hobbyist 2 of 3


www.elmelectronics.com
Application Note
AN04 - ELM327 and Bluetooth ®

CAN-L Vbat +12V +5V


14 In Out
16 7805
6 Battery PWR
CAN-H Positive
100Ω 100Ω 8 7 6 5 0.1µF 0.1µF
4.7KΩ 470Ω
560pF 560pF MCP2551 5
Signal
or use a level Ground
1 2 3 4
translator
+5V chip:

Vbat Vbat +5V +5V


0.1µF +3.3V
13
8 7 6 5
+3.3V
510Ω 510Ω 4.7KΩ +3.3V
TXB0102 +3.3V
15 10KΩ
ISO-L 2.2KΩ 1 2 3 4 1KΩ
12
7 +3.3V 16 0.01µF
ISO-K 17 13
2.2KΩ LMX9838
18
12 Module
+5V 4.7KΩ 25 26
ELM327 Link
pin 12 1KΩ 1KΩ
47KΩ
22KΩ 2.7KΩ 330Ω
B C
4x +5V +5V
470Ω
Vbat n.c.
28 27 26 25 24 23 22 21 20 19 18 17 16 15
+5V
+3.3V
47KΩ 327 In
MIC5200
Out
+5V - 3.3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 +
1µF
10KΩ 0.1µF
to
to R15
+12V A
R21
4.00MHz
OBD Out
317L
In
470Ω Notes:
Interface 27pF - The LMX9838 module requires +3.3V
240Ω Adj
(J1962) 27pF on pins 6, 10 and 11.
470Ω
- The LMX9838 requires circuit common
to be connected to pins 3, 4, 15, 17,
10KΩ 470Ω 18, 24, 27, 29, 30, 31, and 32.
4.7KΩ - Connections to A, B and C depend on
22KΩ the desired baud rate as follows:
4.7KΩ

connections
10KΩ baud rate A B C
2
J1850 Bus +
22KΩ 10KΩ +5V 9600 +3.3V
10
J1850 Bus - 4.7KΩ 115200 +5V +3.3V
100KΩ
4.7KΩ
ELM327
pin 14
10KΩ Figure 3. Adding Bluetooth to
the OBD Interpreter

AN04 rev B Elm Electronics – Circuits for the Hobbyist 3 of 3


www.elmelectronics.com

You might also like