Quantcast
Channel: ArduinoDev.com
Viewing all articles
Browse latest Browse all 77

Programming The Freematics OBD-II Adapter

$
0
0

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.

freematics_obd_1 freematics_obd_2

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.

Freematics OBD-II adapter breakout pins

Freematics OBD-II adapter breakout pins

 

SPI pins as ICSP

SPI pins as ICSP

 

Programming with USBASP

Following is the 10-pin connector of a USBASP programmer.

usbasp_10pin

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 USBASP

Programming with USBASP

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.

ISP 6-Pin Connector

Programming with Arduino as ISP

Programming with Arduino as ISP

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.

arduino_ide_freematics

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:


Viewing all articles
Browse latest Browse all 77

Trending Articles