Pictures of World Maker Faire in NYC
Programming The Freematics OBD-II Adapter
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
Visiting Sydney’s Hackerspace
Today I was very happy to visit Sydney’s hackerspace OzBerryPi at Chippendale EngineRoom and presented my project Freematics there. The awesomeness of hackerspace is wherever you go around the world, you can immediately find a group of people sharing the same interests.
OBD-II Emulator Ready for Order
Freematics OBD-II Emulator is a vehicle data bus emulation device. It is a 12x8x3cm box equipped with a 16-pin OBD-II port, 9 dials, 3 switches, a USB debug port, a 12V power input and a power button, emulating a car’s data bus with emulated data adjustable by physical dials. The OBD-II port is physically identical to the one of a real car. OBD-II complaint device can be plugged into the port and work as if in real cars. The emulator is practically useful and cost effective in OBD-II application development by saving the time and fuel for debugging and testing programs with real cars.
Following protocols are simulated:
- CAN 500Kbps/11bit
- CAN 250Kbps/11bit
- CAN 500Kbps/29bit
- CAN 250Kbps/29bit
- ISO9141-2
- KWP2000 Fast
- KWP2000 5Kbps
By default following OBD-II PIDs can be controlled through the 9 dials:
- Engine RPM
- Engine coolant temperature
- Vehicle speed
- MAF air flow rate
- Engine load
- Fuel level
- Fuel pressure
- Intake MAP pressure
- Throttle position
The dial controlled PIDs can be customized. If customization is needed, please provide the list of PIDs (in HEX, e.g. 010C, 010D…) or contact before placing an order.
Product Gallery





Links
OBD logger/timer sketch now fits for ATMega328 again
Recently since I added performance box features to the OBD logger sketch the size of compiled code keeps exceeding the limit of Arduino Nano or UNO’s program space. Today I tuned up the code to make it fit the 30KB program space and also fixed the compiling issue with Arduino IDE 1.5.x.
MultiLCD library supports ILI9341 based TFT LCD on Arduino DUE
MultiLCD library now supports ILI9341 based TFT LCD (SPI interface). The library also compiles in Arduino IDE 1.5.x and works with Arduino DUE in addition to all 8-bit counterparts.
With the new library, I just got a SPI TFT LCD module working with Arduino DUE perfectly.
Sydney Mini Maker Faire
CodeBlocks Arduino Edition and Arduino Builder updated
CodeBlocks Arduino Edition and Arduino Builder have just been both updated today. Support for Freematics OBD-II Adapter was added in both software. Several bugs were fixed for Arduino Builder.
CodeBlocks Arduino Edition is ideal for productive Arduino project development. It comes with all latest libraries supporting hardware distributed on this website, including OBD-II products, OLED/LCD products etc. The latest version has built-in support for Freematics OBD-II Adapter.
Data2KML – a conversion utility for Arduino data loggers
Data2KML is a command line program which takes in data log files generated by the MEGA logger, an Arduino sketch developed for Arduino OBD-II Data Logger Kit, and outputs KML file for viewing the logged data with Google Earth. A data log file is originally recorded in CSV format by MEGA logger, in which, each line represents a record with time, data type and data value(s) like this:
[Time Elapsed],[Data Type],[Data Value]
Time Elapsed is the time elapsed in milliseconds since previous data record. Data type is based on the HEX number of standard OBD-II PIDs (e.g. 0x10C is engine RPM), as well as some extensions for GPS and sensor data (refer to the MEGA Logger source code). Here is an example data clip:
169,10D,0
171,111,12
170,143,21
165,10B,30
175,10C,705
169,10D,0
This KMZ file (KMZ is zipped KML file) is an example which was generated by Data2KML and shows in Google Earth like following.
The source code and Windows build of the utility is available here.
Freematics Data Charting Service online for beta testing
Freematics Data Charting Service is set up to provide users of Arduino OBD-II data logger kits an easier way to review logged data. Simply by choosing and uploading a log file (with CSV extension), charts for OBD-II data and a GPS track will be illustrated on the spot in web browser. The service is for beta testing now and is being improved actively.
The rendering of GPS track in web browser requires Google Earth. Please install Google Earth if you don’t have it.
Some tips about the service:
- Once you see the map, hold Shift or Ctrl key and then scroll with mouse to adjust the view point angle. This is something Google Maps don’t provide.
- The yellow marks in the map are the brake points in the track.
- The URL of chart/map page is static so you can share it with others
If you have got your log files ready, head up for Freematics Data Charting Service now. Even if you don’t have anything, you can still view some sample data there.
New TFT LCD shield being developed
The prototype of a new TFT LCD shield being developed is working on my desk now. On this shield, XH-2.5 connector sockets for I2C and UART are provided, as well as microSD socket which is important for us to do data logging. The TFT LCD used is interfaced with Arduino via SPI, which makes the display draw faster and consume much fewer pins than common parallel interface. This shield will be part of a new lower cost data logger kit based on DFRobot Bluno, an Arduino UNO with onboard BLE (Bluetooth Low Enery).
Freematics OBD App now in App Store
Finally! Freematics OBD App is available in Apple App Store. Apple requests a review of hardware when App communicates with one through wireless data communication (BLE in our case). So we shipped a sample hardware of our Freematics OBD-II Adapter to No. 1 Infinite Loop and the reviewing process didn’t even take longer than the shipping and we were excited to be able to find the App in App Store.
Freematics OBD App works with Freematics OBD-II Adapter and the OBD-II Data Logger Kit #2 (with BLE). By compiling and uploading the OBD Logger or MEGA Logger sketch to the hardware, the App will display information sending from the hardware.
Currently the App only has very limited functions and is basically for verifying the system design, especially the data communication between iOS and our telematics products based on open-source hardware. But we are really eager to make it really useful and interesting. As is already scheduled, a Kickstarter campaign will be started after new year for raising the funds for pushing forward the App development.
Please stay tuned with this blog or our Facebook Page.
PIDs definition updated in OBD library
The definition of commonly use PIDs in OBD library has been updated. That means more vehicle data can be accessed easily with Arduino now. Following is a brief description of defined PIDs in current library, categorized in engine, intake/exhaust, speed/time, driver and electric systems.
Engine
- PID_RPM – Engine RPM (rpm)
- PID_ENGINE_LOAD – Calculated engine load (%)
- PID_COOLANT_TEMP – Engine coolant temperature (°C)
- PID_ENGINE_LOAD – Calculated Engine load (%)
- PID_ABSOLUTE_ENGINE_LOAD – Absolute Engine load (%)
- PID_TIMING_ADVANCE – Ignition timing advance (°)
- PID_ENGINE_OIL_TEMP – Engine oil temperature (°C)
- PID_ENGINE_TORQUE_PERCENTAGE – Engine torque percentage (%)
- PID_ENGINE_REF_TORQUE – Engine reference torque (Nm)
Intake/Exhaust
- PID_INTAKE_TEMP – Intake temperature (°C)
- PID_INTAKE_PRESSURE – Intake manifold absolute pressure (kPa)
- PID_MAF_FLOW – MAF flow pressure (grams/s)
- PID_BAROMETRIC – Barometric pressure (kPa)
Speed/Time
- PID_SPEED – Vehicle speed (km/h)
- PID_RUNTIME – Engine running time (second)
- PID_DISTANCE – Vehicle running distance (km)
Driver
- PID_THROTTLE – Throttle position (%)
- PID_AMBIENT_TEMP – Ambient temperature (°C)
Electric Systems
- PID_CONTROL_MODULE_VOLTAGE – vehicle control module voltage (V)
- PID_HYBRID_BATTERY_PERCENTAGE – Hybrid battery pack remaining life (%)
New hardware store is now open
New feature of Freematics Charting
Just spent some time on Freematics Charting. Besides tweaking up the performance a little bit, a new feature was added. By selecting two points on the driving track in the map window, the data chart on the left will automatically zoom into that range. By double clicking a points on the track, the chart will zoom into that point of time and 10 seconds before and after that point. Now the chart and the track on the map can be kind of synchronized.
Click here to view some sample data on Freematics Charting. Don’t forget you are free to have you own.
The Kickstarter campaign started
Time to help pushing the Project Freematics to next level. The Kickstarter campaign has just started. Please give it boost!
MultiLCD library supports ILI9341 based TFT LCD
MultiLCD library now supports ILI9341 based TFT LCD (SPI interface). The library compiles in Arduino IDE 1.5.x and works with Arduino DUE in addition to all 8-bit Arduino.
With the new library, I just got a SPI TFT LCD module working with Arduino DUE perfectly.
Freematics Kickstarter campaign final spurt
Here comes the final spurt for the funding of Project Freematics on Kickstarter. Some more backers are needed. Please help to make it happen.
Evaluating Nordic nRF51822
Nordic nRF51822 is a SoC chip integrating ARM Cortex M0 and Bluetooth Low Energy. Its advantage over TI CC2540, which is used in current Freematics OBD-II Adapter and OBD-II data logger kits for BLE communication, is that it has a 32-bit ARM core with more sufficient processing power comparing to CC2540′s 8-bit 8051 core, while the cost is only a little higher. That means, more work which previously requires additional chip can be done in that SoC chip. With bold imagination, there is possibility to port Arduino to this chip so that it can be programmed like Arduino or Maple.
I just got a nRF51822 dev board on hand and will start evaluation shortly.
New TFT LCD shield for Arduino with microSD and I/O sockets
Here comes a brand new TFT LCD shield for Arduino. It features:
- 2.2″ TFT LCD screen of 320×240@16bpp driven by SPI
- I2C socket (SDA, SCL, VCC, GND)
- UART socket (Rx, Tx, VCC, GND)
- Analog socket (A2, A3, VCC, GND)
- MicroSD socket (supporting up to 32GB SDHC)
- Push button (D8)
- Reset button
- Compatible with Arduino UNO R3 and Bluno
The screen is driven by SPI with fast rendering speed. For software, it is supported by MultiLCD library which provides easy API for displaying characters/digits of various size and drawing bitmaps.






This shield can be order in Telematics Hardware Store.