Freematics ONE is a piece of Arduino compatible open-source hardware in form of a OBD-II dongle. It runs compiled Arduino sketch and works accordingly as a vehicle telematics data collector/logger/transmitter after being plugged into car’s OBD-II port. An Arduino library is provided (together with standard Arduino libraries) for easy access to all components in the unit or externally attached, including OBD-II decoder, GPS receiver, MEMS sensor, BLE transceiver, microSD seat, and any plugged-in xBee module.
The main controller of Freematics ONE is an ATmega328p which can be programmed as Arduino UNO through USB or BLE (compatible with Bluno). All standard Arduino libraries (e.g. SD, Wire) can be used unmodified. A Cortex-M3 processor is on board and connected with ATmega328p by SPI to offload protocol decoding (CAN bus, KWP2000, NMEA) and data exchanging with peripherals (GPS and xBee module). A MPU-6050 MEMS sensor is connected with ATmega328p by I2C.
Interfaces and Components
Freematics ONE has following hardware interfaces and components outside and inside its enclosure:
- OBD-II Male Connector (16-pin)
- GPS Connector (4-pin)
- microSD card slot
- Micro SIM card slot (not used for units without cellular module)
- Micro USB Port
- LED Indicator
- xBee Socket (inside)
- BLE Module (inside)
OBD-II Male Connector
OBD-II male connector allows Freematics ONE to be plugged directly into OBD-II female port which is available in most modern cars. The OBD-II port provides connection between Freematics ONE and car’s ECU computer as well as power supply from car battery.
GPS socket allows connection of external GPS receivers which come as an optional accessory. The 4-pin Molex connector is used for serial communication and providing power for GPS receiver. Normally OBD-II port sits underneath dashboard where no good GPS signal reception is available. External GPS receiver with a cable led out from Freematics ONE can be easily placed on dashboard or somewhere else for better signal reception.
Freematics ONE has a microSD card slot and a micro SIM card slot under the plastic cover on one side of the enclosure. Both card seats are self-popping. Please avoid insert anything into SIM card slot if your Freematics ONE has no cellular module installed. Please make sure to insert microSD card and SIM card in the correct direction as shown below.
Micro USB Port
Micro USB port is used for Arduino sketch uploading as well as serial communication which is pretty same as for an Arduino board. The port can also be used for powering the device if no OBD-II connection is available.
LED indicator are on when powered on and flashing when there is USB or BLE communication.
A 2x10pin xBee Socket is set on the PCB. It allows extension for wireless communication including cellular network, WIFI network or xBee communication. By default and standard, xBee VCC is 3.3V. If your Freematics ONE comes with cellular network support, it has a SIM800L xBee module plugged in the xBee socket and VCC is 5V.
A CC2540 based BLE module with on board antenna is attached on the back of PCB for both BLE and serial-USB communication. Arduino sketch is uploaded to Freematics ONE by this module either through USB or wirelessly through BLE.
Compiling and Uploading
As an open-source hardware, the most important thing is being able to compile source code and upload to the unit.
1. Download and install latest Arduino IDE
2. Download and import Freematics ONE Arduino library
You can either get the latest revision of the library from our Github or download directly from here. This step is only required once unless you want to update the previously imported library. No idea about Arduino library and how to import one? Check out this.
3. Download Arduino sketches for Freematics ONE and load one of them into Arduino IDE
This sketch works as a data logger of OBD-II/GPS/MEMS data. Data is saved on inserted microSD card and streamed to mobile phone or tablet via BLE (in readable text). For the file format used for data logging, please refer to Freematics Data Logging Format.
This sketch demonstrates how OBD-II/GPS/MEMS data is collected and transmitted to remote server by HTTP POST operations by a plugged in SIM800L GSM/GPRS module. Standard SIM800 AT command-set is used for GPRS communication. This sketch only works with Freematics ONE with SIM800L module installed.
This is the equivalent Telelogger sketch using ESP8266 WIFI module to transmit data collected data to remote server by HTTP POST operations. Standard ESP8266 command-set is used. This sketch only works with Freematics ONE with ESP8266 module installed.
This sketch tests and demonstrates WIFI connectivity with ESP8266 xBee module plugged in Freematics ONE. It does tasks including configuring ESP8266 module, connecting WIFI hot spot and continuously performing HTTP GET operations (via TCP). No OBD-II operation is involved. Standard ESP8266 command-set is used.
This sketch emulates a ELM327 OBD-II adapter with standard ELM327 AT command-set. Serial data communication goes through USB or BLE.
This sketch retrieves GPS NMEA data and parse it with TinyGPS library on ATmega328p (normally NMEA parsing is done internally).
4. Connect Freematics ONE to computer by USB cable or BLE
Just like connecting an Arduino board to your computer, connect your Freematics ONE to your computer with supplied USB cable (micro USB connector)
If you have purchased BLE USB dongle, you can insert the dongle and it will automatically establish wireless connection with Freematics ONE. The rest is same with a connected USB cable. The uploading speed will be slower than using USB cable due to the speed limit of BLE.
5. Compile and upload the sketch to Freematics ONE
In Arduino IDE, choose Arduino UNO as board and the serial port that Freematics ONE is on. Click upload button or menu to start uploading. Once completed, your Freematics ONE is ready to go with your car.