Application Note AN04 - ELM327 and Bluetooth: Using Serial To Bluetooth Adapters
Application Note AN04 - ELM327 and Bluetooth: Using Serial To Bluetooth Adapters
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.
+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
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