ELM327 Adapter on PIC18F25K80

 

 

You are always wanted to built ELM327 adapter but firmware was not available? Not anymore! Everything is here. This was a side project done for testing ELM327 firmware available openly on GitHub. I just wanted to see if it works. And yes, it is pretty much functional! When the original ELM327 based on PIC18F2480, this one is built around PIC18F25K80 chip. From the schematic prospective it is almost the same, the only difference is VCAP/VDDCORE decoupling capacitor C11 on pin 6.

 

 

J1850 voltage regulator is simplified based on the fact that the logical voltage level is 3.3V vs. 5V for PIC18F2480. The adapter uses 9-pin D type female connector to link up to vehicle's OBD-II J1962 connector. The pinout is De-facto a standard for OBD cables. The cable available on eBay or AliExpress from many vendors.

J1962 Pin Description DB9F Pin
2 J1850 Bus + 7
5 Signal Ground 1
6 CAN High 3
7 K Line 4
10 J1850 Bus - 6
14 CAN Low 5
15 L Line 8
16 Vehicle Battery Positive 9

The printed circuit board layout in Eagle 9 format is available on GitHub. The firmware is here.

 

Simplified schematic and improved firmware

One of many additional features of PIC18F25K80 is analog comparator. The previous schematic has comparator-like functionality with transistors Q4 and Q5. It can be replaced with PIC built-in analog comparator, see below. It should improve the reliability J1850 PWM signal handling. The firmware was modified as well to enable the internal comparator (the second in archive). Some unused pins turned to outputs, like RA3 and RC2. Using ULN2003 can reduce the number of external components. The Chinese knock-offs of ULN2003 are quite inexpensive. Another solution here to minimize number of components - using resistor arrays.

 

 

 

 

SMD Bluetooth version

The adapter layout in Eagle format is here and it fits the de-facto standard USB OBD2 connector enclose available on AliExpress. The components are mounted on both sides.

Bluetooth module is JDY-33 with 4.2 dual mode according to the manufacturer datasheet even though the chip itself listed as 5.0 dual mode. Was it updated later on to 5.0? The module itself is based on Beken BK3432 chip and available on AliExpress for $3 including S/H or less. The SoC chip is using ARM968E-S core. Wow! Is ARM giving it away for free? The original ARM968E-S released back to 2004 and rendered obsolete. Apparently they trying to save on the cost of ARM license.

 

 

Configuring JDY-33

By default JDY-33 configured to operate at 9600 bps when the adapter is using 38400 bps. Here are steps to configure it properly:

  1. Connect the serial terminal to JDY-33 at 9600 speed, no parity. Make sure you selected sending CR/LF option
  2. Use "AT+VERSION" to test connectivity
  3. Using "AT+BAUD6" command set the connection speed to 38400 bps
  4. Optionally, "AT+NAME/AT+NAMB" can be used to change the default SSIDs
Here is an example:

AT+NAMEAllPro
AT+NAMBAllPro-BLE
AT+BAUD6

I have just mounted IC3, IC4, D4, C7-C9 components first as well as the BT module itself to do the configuration and mount the rest of components after that.