Electronic – arduino – Get current gear from rpm and speed through OBD2

arduinogearobdspeed

I would like to modify my car with the help of Arduino to display the current gear. I wasn't quite sure where should I post this question as it is a car topic, as well as an electric engineering and mathematics topic.

I want to get the engine rpm and current speed (and any additional information I need) via the OBD2 port of my car. The best solution would be with a small cable adapter so I could simply hide the cable behind the dashboard. The OBD2 for Arduino adapter is just too big, unfortunately the connector in my car is under the steering wheel so it should be as compact as possible as I don't want to accidentally kick it. For the Arduino part I would like to use an ATtiny85 (since it is so compact) and a small display, 7 segment or LED matrix.

The math part is to calculate the current gear from the OBD data. How should I do it? Is it even possible? There is an extension for the Torque app (RacingMeter) that shows the current gear, I am not sure how, but that is where the idea came from.

Best Answer

First identify the protocol your car is using is it CAN,KWP,J1850 etc. Buy this sparkfun board or build one so that you can communicate with ECU of any above protocol

https://learn.sparkfun.com/tutorials/obd-ii-uart-hookup-guide

RPM

To obtain RPM you have to give 01 0C Refer this link for conversion formula of obtained raw data to required value http://en.wikipedia.org/wiki/OBD-II_PIDs#Mode_01

Current gear

Gear is a proprietary PID so it wont be available from standard PIDs you need the companys PID list. Else just add only gear app in torque.Then use an OBD splitter cable log the data (request and response) passing to ECU byt torque app and identify the PID. But you have to figure out the conversion formulas by your own.