This Arduino sketch is designed for running on Freematics ONE+ and Freematics Esprit development board, to collect vehicle telemetry data from OBD-II, GPS and motion sensor and store the collected data to microSD card.
The sketch collects follow data.
- Vehicle OBD-II PIDs data (from OBD port)
- Battery voltage (from OBD port)
- Geolocation data (from connected GPS receiver)
- Acceleration data (from built-in motion sensor)
- Orientation data (computed from motion sensor data)
When GPS is detected, the sketch waits for GPS singal for a while on startup before starting data logging. Once GPS time is obtained, the data file will be created with the date and time as file name.
A BLE GATT server is brought up to allow BLE capable mobile device to connect and receive some status and stats wirelessly.
The device orientation (yaw, pitch roll) can be calculated from collected motion sensor data with quanterion algorithm. This normally reflects the orientation of the vehicle if the device is fixed to vehicle (e.g. firmly plugged in OBD port) This feature consumes extra computation power and is disabled by default.
- Freematics ONE+
- PlatformIO, Arduino IDE or Freematics Arduino Builder for compiling and uploading code
- A car with OBD-II port or Freematics OBD-II Emulator