Android code to interface with TgForce running impact sensor.
Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
app
gradle/wrapper
.gitignore
LICENSE.TXT
Readme.textile
TgForceSensor.iml
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

Readme.textile

TgForce Impact Running Sensor Andoid API

The TgForceSensor repository contains Android code to interface with the TgForce Impact Running Sensor. The TgForce sensor is a Bluetooth LE device that measures tibial shock. It follows the
Bluetooth LE standards and is relatively easy to interface with.

This repository contains Android code to interface with the device. The protocol is encoded in the source code and is documented belowbelow.

TgForce Impact Running Sensor Protocol

The protocol consists of four standard Bluetooth GATT services and a custom service.

The protocol below is documented as follows, with every xxxxxx-xxxx-xxxx-xxxx-xxxxx representing a UUID:

  • xxxxxx-xxxx-xxxx-xxxx-xxxxx Service name
    • xxxxxx-xxxx-xxxx-xxxx-xxxxx Characteristic name
      • xxxxxx-xxxx-xxxx-xxxx-xxxxx Description name

The BlueTooth 4.0 services the device exposes are:

The last service, the custom TgForce service, is of course the most interesting. It implements the main functionality of the device. To make sense of the data that is returned, some more information is needed about how to convert the returned numbers to values with meaningful units:

  • PPA: The PPA is the peak positive acceleration. It represents the size of the peak of downwards acceleration. The signal is sampled at 1600Hz and filtered using a low pass filter of 50Hz. The characteristic uses unsigned integers in the range of [0-255]. The to convert the values to g the following factor is needed: 23.9141g/254, since 23.9g is the maximum acceleration.
  • gThreshold: The gThreshold is the minimum acceleration that needs to be exceeded before a peak is considered. It is represented using a value [0-85]. The default is 3.6g. To set the threshold multiply the value in g with 5.32, so the default value is 5.32*3.6g = 19.
  • delay: The delay instructs the device to discard superflous peaks for a certain period after a peak is detected. It is assumed that strides take a minimum amount of time: this is encoded as the delay. The default value is 550ms. It is represented using an integer from zero to 19999. To set the delay multiply the value in ms with 17.53. The default value is 550*17.53 = 9642.
  • Cadence: The cadence is given as a number of steps pre minute. No conversion is necessary.

Source Code Organization & Developing

The source code is organized following the Android Studio project settings.

License and Credits

This code was developed at University Ghent, IPEM by Joren Six. It is licensed under a BSD License.

Thanks to Kelsec Systems for providing documentation and support via email.

Change Log

01/10/2015 First version