This is a real hack!!
Disclaimer: Please note that the communication protocol that is the end result of this hack is readily available on the ELM327 data sheet. I have just consolidated them. Hence, I have not undone any secret code. My intention is only to let other engineers/ hobbyists (like me) know what goes on between the phone and BT (bluetooth) OBD adapter. No hard feelings please.
Also note that entire ELM327 implement a huge protocol, I have only scratched it superficially. My work is only meant for hobby purpose, not for pro usage.
Purpose of the hack...
If you wanted to know what is going on between any of these android applications and the bluetooth OBD adapters, then, this hack is for you...
I was in a long plan to make my own OBD II scanner, and earlier did communicate with my Hyundai i10 car using home build boards. Please refer to my webpages for more details.
Please note that my home made OBD II scanner was built from scratch on dsPIC33 device, and does not have any connection with the more popular ELM327. Over a period of time, I was able to integrate graphical LCD, SD card, keypad, load switch, but one point was still missing -- connection with my Android phone.
I was already aware of bluetooth OBD adapter which have ELM327 on the back end and that could communicate with android applications such as: -
But, I was not willing to go ahead and purchase one of those bluetooth OBD adapter for reasons: -
Finally, decided that I will purchase any locally available bluetooth serial-modules (not the bluetooth OBD adapter) from local market and integrate that with my own OBD scanner board, and with a littler know how of the protocol, I can connect my home built OBD scanner to android phone.
Outcome is the Simulator...
To understand the protocol between Android phone and bluetooth OBD adapter, I did some hacking of the conversation and later, came up with my simulator. This is required because, writing code directly on the BT serial module and then expecting it to communicate with my phone will be a a heck of task with infinite trials. Implementing the simulator is way easier and saves time. Also, it is easier to debug protocol on PC than on microcontroller. The features and usefulness of the simulator are: -
How did I decode the protocol and wrote the Python script (simulator)
I am not the first guy to make a simulator, in-fact, there are gurus, who have written the "OBDSIM". In fact, I used the OBDSIM to communicate with my phone and used a serial spy to decode the protocol. I believe, OBDSIM is more versatile and feature rich, but I used its few features.