Data Collection Firmware

SensiML Analytics Toolkit uses AI to build edge sensor inferencing models using labeled train/test data to establish features, weights, and parameters for subsequent modeling in the AutoML engine. For this process to work, it is imperative to generate a sufficient volume of labeled training and test data from devices with behavior and sensor characteristics consistent with the intended predictive device.

While it is always possible with SensiML to collect this train/test data by whatever means possible and then import it as CSV data, often the most convenient and efficient means is to acquire this data directly within the SensiML Data Capture Lab (DCL) application in a device connected capture session. Doing so requires DCL to receive properly formatted data from the device firmware which is then responsible for:

  • Initializing and setting all sensor channels to desired gain, offset, calibration, and sample rate. This is done using hardware sensor drivers either written by the user and conforming to datasheets from the sensor IC vendor or using reference code supplied by the sensor IC vendor.

  • Setting up recording sessions with the set of sensors to be included in the sample frame.

  • Starting and stopping data acquisition from messages received from the controlling host system running the DCL application

  • Reading the sensor(s) at the appropriate sample rate and buffering these sample frames into a queue for local flash datafile storage or real-time streaming over MQTT-SN to DCL

  • Transmitting buffered livestream or file stored sample data to the host system.

  • Resetting the device and clearing buffers and memory to restart the process for additional capture sessions.

SensiML uses a simplified version of MQTT messaging protocol known as MQTT-SN to send and receive all command, control, and data messages between the host system and the embedded device. The full protocol for communicating with Data Capture Lab can be found in the SensiML Interface Specification1. We will not cover the details of the protocol in this Application Note overview, as they are discussed at length in the referenced specification.

The components needed to generate SensiML DCL compatible device firmware are shown in the following illustration highlighting (in blue) the components the user will need to create and/or modify from existing example reference code. These components leverage sourced libraries (in gray) available from either SensiML or your specific sensor and hardware platform vendor(s).

To aid in the development of writing firmware required by the user, existing reference implementations in source code form are available for the supported off-the-shelf dev boards and may be revised as needed by the user. At present writing, such reference implementations include:

  • Nordic Thingy52 (an IoT eval kit from Nordic Semi based on their nRF52 MCU)

  • QuickLogic EOS S3 “Merced” (an Industrial IoT eval kit from Quicklogic based on their EOSS3 MCU+FPGA SoC)

  • QuickLogic EOS S3 “Chilkat” (a wearable/consumer IoT eval kit from Quicklogic based on their EOSS3 MCU+FPGA SoC)4

  • STMicro SensorTilev1 (an IoT eval kit from STMicro based on their STM32L4 MCU)

  • STMicro SensorTile.Box (second generation IoT eval kit from STMicro for the STM32L4)

Contact SensiML support for details on how to obtain the reference source code firmware listed above. For full details on generating compatible firmware, refer to the following documentation.