This product works as a vehicle OBD-II data bridge for Arduino, providing OBD-II data access with Arduino library as well as power supply for Arduino board and its attached devices.
Features:
The adapter plugs into the OBD port usually located under the steering column or slightly to the left of it. To check if your vehicle is OBD-II certified, open your hood and find the sticker that looks like this:
Vehicles using following vehicle protocols are supported.
The OBD-II Adapter is compatible with all Arduino range including Arduino UNO, Arduino Leonardo, Arduino Micro, Arduino Nano, Arduino Mini, Arduino Pro Mini, Arduino MEGA 1280/2560/ADK.
Please be noted this product is designed for cars with 12V battery. This version of OBD-II adapter comes with no built-in MEMS sensor.
\The adapter inserts into the OBD port of a vehicle normally located under the steering column. A cable coming out from the adapter splits into two sets of 2-pin Dupont connectors with one for power (VCC/GND) and one for data (Rx/Tx). They are connected to Arduino to provide both power supply and data connection. Your Arduino setup will look tidy in car with only one cord.
Power Lines:
Data Lines:
Note: Arduino UNO or Nano only has one hardware serial which is also used by USB serial. Avoid using serial output if the adapter is connected to hardware serial. Arduino Leonardo, Mega, Due do not have this limit.
A dedicated Arduino library is developed and maintained regularly, providing a set of easy-to-use APIs to retrieve realtime data from a vehicle.
The library provides easy-to-use APIs for configuring the adapter and accessing vehicle's OBD-II PIDs through ELM327 AT command-set. Following are some useful APIs:
Here is an example code of a simplest engine RPM indicator, which uses the pin 13 LED (built in every Arduino board) to indicate whether the engine is above 5000rpm.
#include <OBD2UART.h> COBD obd; void setup() { // we'll use the debug LED as output pinMode(13, OUTPUT); // start communication with OBD-II adapter obd.begin(); // initiate OBD-II connection until success while (!obd.init()); } void loop() { int value; // save engine RPM in variable 'value', return true on success if (obd.readPID(PID_RPM, value)) { // light on LED on Arduino board when the RPM exceeds 3000 digitalWrite(13, value > 3000 ? HIGH : LOW); } }
The complete source code of the library and examples is hosted on GitHub.
The following table lists the differences among all Freematics OBD-II adapter models.
Features \ Models | OBD-II I2C Adapter | OBD-II UART Adapter V1 | OBD-II UART Adapter V2 |
---|---|---|---|
Connection Interface | I2C | Serial UART | Serial UART |
Additional Interface | N/A | N/A | microUSB |
MEMS Sensor | MPU-6050 | N/A | MPU-6050 |
Voltmeter | Yes | Yes | Yes |
Max. Output Power | 2A | 2A | 2.1A |
Standby Mode Power | 10mA | 5mA | 6mA |
Q: What is this product used for?
A: The most straight-forward use of this product is for making Arduino possible to access vehicle data easily. The OBD-II data, together with other data from GPS or all kinds sensors, can be logged and stored on SD/TF card with Arduino and that makes an open-source vehicle data logger (check out the data logger kits). More extensively, many interesting interaction applications requiring car data can be made.
Q: How is the adapter powered?
A: The adapter gets power from the 12V DC output from the OBD-II port.
Q: Does my Arduino needs power from somewhere in the car?
A: The adapter provides regulated 5V output for powering Arduino and other devices, so no extra power cord is needed.
Q: Do I need a CAN bus shield to use with the adapter?
A: Definitely no. The adapter retrieves data from CAN bus, like a CAN bus shield does and convert the more complicated CAN bus interface to simple serial UART interface which Arduino and most embedded systems are easy to access. The data connection is provided by adapter’s data connector (Rx and Tx).
Q: How do I connect the adapter with my Arduino?
A: The adapter works with all models of Arduino with the dedicated Arduino library and is connected with Arduino by connecting adapter’s Tx to Arduino’s Rx (D0) and adapter’s Rx to Arduino’s Tx (D1). If you want to connect and disconnect the adapter with your Arduino effortlessly, it’s recommended to use a common I/O breakout shield or use an Arduino board with breakout pins for Rx/Tx/VCC/GND.
Q: Is the power provided by the adapter always available in car?
A: This depends on whether the OBD-II port of your car still has power after ignition is off. Actually it is so with most cars.
Q: What’s the maximum frequency of data polling?
A: The OBD-II PIDs are polled one after another. The time for a polling depends on the speed of car’s ECU computer and how busy the computer is in different status. With a typical modern car with CAN bus, the time can be as low as 20ms. In other word, up to 50 times of data polling can be done in one second.