OBD-2 Application
The application was tested on Renault Twingo II reading only current data, no fault codes included. The bluetooth obd2 plug is from Ebay, it has ELM327 IC that connects to all OBDII protocols. The computer's bluetooth pairs with the OBD-II plug and connects to the app via COM Port. On windows computer you can find the COM port number in 'device manager' and enter the port to the VB app. If you use OBD-II USB you can enter the port number of that. In Android the port connects automatically.
Included OBD-II - Simulator VB6 app to simulate the car ECU, it is useful for development or testing the app. When it receives a request the simulator reply with a text messege similar to a response by the ECU. To use the simulator You need a software that creates COM Port pair like "com0com". You can also run the simulator on another PC and connect the PCs with a null cable or bluetooth.
The VB6 app takes bytes A and B and calculates the readable data.
The Android app was made using MIT App Inventor which is an easy way to make
Android apps. The apk file has to be manually installed to the Android device. The .aia file can be imported if you install the MIT App Inventor, the app can be modified to your needs.
In here https://en.wikipedia.org/wiki/OBD-II_PIDs#Bitwise_encoded_PIDs you can find the parameter IDs of data request. A request is 2 hexadecimal numbers and the ELM response is several bytes that contain the data. Every car responds to different request, the app has only 12 popular requests, others can be added.
The bluetooth plug used:
https://www.ebay.co.uk/itm/Mini-ELM327-V2-1-OBD2-II-Bluetooth-Diagnostic-Car-Auto-Interface-Scanner-UK/192143114420?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2648
If you buy it locally, make sure it's ELM327 V2.1
You are free to use the circuit diagram and the VB software with no limitations.

OBD2 CAR SIMULATOR
OBD2 car simulator Using Arduino Nano and MCP2515 CAN driver. It simulate ISO
15765-4 CAN BUS 11 bit, 500 Kb/s. Only most common PIDs are simulated. The
simulator listen to messages from an Diagnostic tool and reply as an ECU. It
can be used to test Diagnostic tool or to be used for development. More
PIDs can be added to the Arduino code. The code is a revised code from
example in the GitHub MCP CAN LIB library that needs to be added to the
Arduino IDE, https://github.com/coryjfowler/MCP_CAN_lib
. The ODB socket I used is:
https://www.ebay.co.uk/itm/OBD2-Female-angle-connector-OBD-Female-Sockets-Connector-Diagnostic-Tools-ATF/192501602036?hash=item2cd1fd56f4:g:dn4AAOSwB7JaxIlt
REV COUNTER ANDROID B4A
A rev counter connected
to OBD2 Bluetooth diagnostic plug with ELM327. This RPM meter works with all
OBD protocols. The Android program is written using B4A (basic for Android).
The Android device, phone or tablet, have to be paired with the BT plug. The
display is digital and traditional analogue. The app request data from the
car ECU every 0.5 sec. The app APK file, has to be transferred to the device
and when opened it instructs how to be installed. B4A code is included, if
you want to edit the code free IDE can be found at
https://www.b4x.com/. The Bluetooth plug I used: https://www.ebay.co.uk/itm/Mini-ELM327-V2-1-OBD2-II-Bluetooth-Diagnostic-Car-Auto-Interface-Scanner-UK/192143114420?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2648 If you buy it locally, make sure it's ELM327 V2.1
REV COUNTER ANDROID APP INVENTOR
A rev counter connected
to OBD2 Bluetooth diagnostic plug with ELM327. This RPM meter works with all
OBD protocols. The Android program is written using MIT App Inventor. The
Android device, phone or tablet, have to be paired with the BT plug. The
display is digital and traditional analogue. The app request data from the
car ECU every 0.5 sec. The app APK file, has to be transferred to the device
and when opened it instructs how to be installed. .aia file is the app and
can be modified in the MIT App Inventor. The Bluetooth plug I used: https://www.ebay.co.uk/itm/Mini-ELM327-V2-1-OBD2-II-Bluetooth-Diagnostic-Car-Auto-Interface-Scanner-UK/192143114420?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2648 If you buy it locally, make sure it's ELM327 V2.1

LCD
OBD-2 Tachometer
This project is suitable for cars with OBD2 protocol ISO 15765 11 bits 500 Kb/s, most European car has this protocol. The application reads data of the ECU using CAN. The MCP2 module drives the CAN BUS. The circuit supply is from the car 12V and a 78L05 regulator that supply the Arduino and the CAN module. It is preferred to take the 12V from a connection that switches off when the engine is off, you can take 12V from the obd2 plug, pin 16 and add a switch. You need also a ground connection to the car ground. For compiling the code you need to install a lib from GitHub. I left the debugging in the code for help in adding features. The code requests the data twice every second. The request is an address 7DF, number of bytes, service #, PID and padding 5 bytes of 0x55. The reply from the ECU is address 7E8, number of bytes, 0x41, PID and 2 bytes of data. The data i calculatedRPM = (byte1*256+byte2)/4. Lib for the Arduino can be downloaded from GitHub: Download a lib from GitHub, install the lib and open example obd_tachometer.

Circuit Description
See also Technical Tips
MCP2515 CAN driver https://www.ebay.co.uk/sch/i.html?_from=R40&_trksid=p2047675.m570.l1313.TR1.TRC0.A0.H0.Xmcp2515.TRS0&_nkw=mcp2515&_sacat=0
LCD 16 x 2 module https://www.ebay.co.uk/sch/i.html?_osacat=0&_odkw=mcp2515&_from=R40&_trksid=p2334524.m570.l1313.TR2.TRC1.A0.H0.Xlcd+16x2.TRS0&_nkw=lcd+16x2&_sacat=0
OBD2 plug https://www.ebay.co.uk/sch/i.html?_osacat=0&_odkw=lcd+16x2&_from=R40&_trksid=p2334524.m570.l1313.TR1.TRC0.A0.H0.Xobd2+plug.TRS0&_nkw=obd2+plug&_sacat=0
10K pot can be replaced by 470 ohm to GRD.
|