Freematics OBD-II Adapter is the world’s first OBD-II device integrating an Arduino connected to peripherals of accelerometer, gyro, temperature sensor, Bluetooth/BLE and microSD socket. The adapter can optionally lead out a cable connecting with and powering an external device via either SPI, I2C or serial UART.
The onboard main controller is an AVR ATMega644PA which can be programmed in the standard Arduino way. The vehicle OBD-II data as well as all the peripherals connected to the MCU can be easily accessed with Arduino libraries.
What can it really do? It can do a lot with enough imagination, as it is fully programmable and can work standalone. The most straight-forward applications include:
- Smart vehicle data logger with smartphone connectivity
- Data source or controller of another device which wants to interact with vehicle data
Programming – Hardware
The onboard ATMega644PA is programmed via ICSP, either by USBASP or Arduino as ISP.
Programming with USBASP
Following is the 10-pin connector of a USBASP programmer.
To program with USBASP, connect the adapter’s SPI pins with USBASP’s pins as following:
Adapter SPI USBASP
MISO MISO
MOSI MOSI
SCK SCK
RESET RESET
GND GND
5V VCC (*)
* Please be cautious that with some cheap USBASPs with no enough impulse filtering, it is highly recommended that the adapter is powered from the OBD-II port (12V input) instead of USBASP’s VCC pin in order to prevent the board from being damaged by impulse current on the moment of plugging the USBASP to computer.
Programming with Arduino as ISP
To program with Arduino, connect the adapter’s SPI pins to Arduino’s ICSP pins and the reset pin to Arduino’s D10. Following is the ICSP connector pinout.
Programming – Software
To use Arduino IDE as programming environment, please download the addon package and extract to Arduino IDE’s directory. After doing that, additonal board type of Freematics OBD will appear in Arduino IDE’s Tools->Board menu.
You can then use Arduino IDE to develop program for the Freematics OBD-II adapter. Following libraries can be used for access the onboard resources of the adaper:
- Arduino OBD-II Library – for accessing vehicle data
- MPU6050 Library – for accessing accelerometer and gyro data
- SD Library – for storing and accessing data on microSD