If you want to start car hacking through your OBD-II port using a bluetooth scanner - ELMduino is for you.
ELMduino download and GitHub Link
This library is also installable via the Arduino IDE's Libraries Manager.
You can use this library to interface with OBD-II scanners such as this common one and will work with any car that has an OBD-II port:
And you can use it to query any pieces of data as specified by the OBD-II public PIDs. Here is a list of PIDs supported. Some notables include speed, rpm, MAF pressure, etc.
Below is an example code that will print rpm data from a (running) car.
#include <SoftwareSerial.h>
#include "ELMduino.h"
SoftwareSerial mySerial(2, 3); // RX, TX
#define ELM_PORT mySerial
ELM327 myELM327;
uint32_t rpm = 0;
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
Serial.begin(115200);
ELM_PORT.begin(115200);
Serial.println("Attempting to connect to ELM327...");
if (!myELM327.begin(ELM_PORT))
{
Serial.println("Couldn't connect to OBD scanner");
while (1);
}
Serial.println("Connected to ELM327");
}
void loop()
{
float tempRPM = myELM327.rpm();
if (myELM327.status == ELM_SUCCESS)
{
rpm = (uint32_t)tempRPM;
Serial.print("RPM: "); Serial.println(rpm);
}
else
{
Serial.print(F("\tERROR: "));
Serial.println(myELM327.status);
delay(100);
}
}
Note that you will need to connect to the bluetooth scanner using an HC-05 or other bluetooth to UART converter.