STWIN SensorTile Wireless Node Dev Kit - Review

Table of contents

RoadTest: STWIN SensorTile Wireless Node Dev Kit

Author: saicheong

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?:

What were the biggest problems encountered?: The WIFI kit is optional so no review about this

Detailed Review:

STWIN SensorTile RoadTest



The STWIN sensorTile is a tidy compact cubic have STM32 MPU attached with several of ST's sensors chips selected for IoT purpose, designed communicate wirelessly though the Bluetooth Low Power or optional WIFI, the package also supplied with a small LiPO and the plastic enclosure, make it easy for develop and test for portable mobile applications.


The kits come with SDK with essence STM32 libraries, additional with sensors and bluetooth drivers, the reference firmware allow connect to Android/IOS ST BLE Sensor APP out of box for exploring the sensor data, logging or review of the Predictive and check the battery level, both of them are Open source 3-Clause BSD license, mean you can modification and apply to yourself project freely.


In this road tests, at beginning, will brief review out-of-box hardware and softwares ST provided, study the MLC core, and future develop a TaiChi (Chinese version of Yoga) gesture recognising device, which is a wearable activies recorder for calorie burning tracking, we implement a IOS companion app to collect and save from Bluetooth LE toIOS HealthKit, thanks of ISM330DHCX machine learning core, the recognising directly working by the sensors chips by the machine learning core and wake up the STM32 by interrupt, as a result minimum the power consumption. The firmware and sources codes can be download at the end.

Out of Board


The STWIN SensorTile delivered with a plastic tray, have a pleasing symmetry placement on four conners.

Upper Left is the main board, Upper Right is the STLINK-V3MINI Debugger/Programer,

the Lower Left is the plastic box and mounting screws, a small LiPO battery on Lower Right.


The development kit require two USB ports once for programming, another for main board (or external 5V power supply supply to main board).

The battery is optional connected to the BATT connector and the Battery will be changed when USB/5V power supply supplied.


The programmer connect to the main board by the provided 14-pin flat cable, the STM32CubeProgrammer used for erase and write of firmware, the STM32CubeIDE is for develop and debug, both support MacOS and Multi-platform can be free download on ST website.…


The FP-IND-PREDMNT1 is function pack which included all of sensors and mic drivers, bluetooth middleware make it is a great starting points for a new project.…


For developing Android/IOS cohesive APP, ST provided full set of open sources for their reference design APP and the protocol, make developer easy to learn and involve their creative.


The UNICO is ST MEMS software kits for ISM330DHCX, which help developer working for the Machine Learning Core.



Use of Machine Learning Core for Condition Monitoring


The MLC designed rapidly implementation  for conditions monitoring and classified of sensors data by machine learning, typical such alert of malfunction or detect suddenly impaction. For evaluation purpose, we use a set of hobby stepping motor continues rotate for emulate the motor movement, a simple task for identifying the Normal/Failure status.


The methodology of machine learning is collect set of sensor's data on different circumstances, specified those and feed those data to the software tools. The tools read it and process it by some  algorithms, review the accuracy, learn it, optimum it and rerun this process to improve the model. After repeat to serve times, we get the final model, which is a set of decision trees that MLC used for predict or classified the type of situation.


The Machine Learning Core embedded on ISM330DHCX only for apply (using) the model for prediction tasks. Sure the sensor IC is not powerful enough for train and build the model. Our model is trained by the UNICO and import the C configuration array to our project.


Therefore, we need capture the data from the SensorTile to our computer for sampling.


Simply attached the SensorTile Box on one conner of the Stepping motor, a Arduino device control of Stepping motor speed.


As current UNICO do not support of direct communication with SensorTile. A function is built for print the sensors on UART console every 38ms.


static voidMotionMLTrainingData(void){
    MOTION_SENSOR_Axes_t GYR_Value;
    MOTION_SENSOR_Axes_t MAG_Value;

    /* Read the Acc values */
      ACC_Value.x = ACC_Value.y = ACC_Value.z =0;

    /* Read the Magneto values */
      MAG_Value.x = MAG_Value.y = MAG_Value.z =0;

    /* Read the Gyro values */
      GYR_Value.x = GYR_Value.y = GYR_Value.z =0;



The output pattern match of UNICO MLC data pattern, so we just capture it on a USB serial terminal (such as MacOS: screen), add the specified header, and save the txt file for every situation, like below:


A_X [mg]A_Y [mg]A_Z [mg]G_X [dps]G_Y [dps]G_Z [dps]



The ISM330DHCX support attached external magnetometer sensors though AUX pins and use the data on the MLC. However, the SensorTile Magnetometer is direct connected to the STM32, make the magnetometer data is not available apply to MLC and should omit the external sensor on configuration.


Load the txt data for each condition, label and import the data. Click Configuration and select Acc+Gyro, select mean, variance and max for ACC_X,ACC_Y_ACC_Z,GY_X,GY_Y,GY_Z, click next for default and finally output of .ucf


The C code generation under option used for convert ucf to standard C config.h file, this header content a config[] array for MLC config and the decision tree algorithm. Copy this file to our project include directory.


When initiating , we load the config[] for initialising the sensor and inject the algorithm for the MLC core:


int n = sizeof(config)/sizeof(config[0]);

  // Load config data for ML engine
  for(int i=0;i<n;i++){

  ISM330DHCX_Write_Reg( MotionCompObj[ISM330DHCX_0], config[i].address , config[i].data );



We also enable the MLC1 Interrupt so that the MLC will interrupt the MCU when status predicted.


stmdev_ctx_t* ctx = &(((ISM330DHCX_Object_t *)MotionCompObj[ISM330DHCX_0])->Ctx);
ism330dhcx_pin_int2_route_t intRoute;


  intRoute->mlc_int2.int2_mlc1 = status;

  if (!ism330dhcx_pin_int2_route_set(ctx,intRoute) &&
       !ism330dhcx_int_notification_set(ctx, ISM330DHCX_BASE_PULSED_EMB_LATCHED)){
      PREDMNT1_PRINTF("theEnabled MLC1 interrupt\r\n");


We capture the interrupt event from M_INT2_0_PIN (GPIO_PIN_4) and obtain the result from Machine Learning Core, finally print out on USB UART output.


Testing BootLoaderCompliance:
        Version  2.0.0
        BL Version  Ok
        MagicNum    OK
        MaxSize  0xfc000
        OTAStartAdd OK
        OTADoneAdd  OK
BootLoader Compliant with FOTA procedure

Enabled MLC1 interrupt
MLC: 0 - 0x00
MLC: 1 - 0x04


The 0x00 or 0x04 is the result value read from MLC, in this example, 0x00 mean Normal run and 0x04 is error of stepping motor, which is corresponding on UNICO setting.


Thank for the Machine Learning Core and the interrupt, the MCU is free and able to sleep for reduce overall system power consumption, however the MLC is suitable for relative simple machine learning tasks which is not good for too many decision trees or nodes because of limited resources. Carefully considering only include necessary inputs features to optimum the final output to avoid overfitting or bulk nodes.


Next step, we will turn the Sensor.Tile to a wearable heath smart device.


HealthKit TaiChi Recognising


This cube is flexible for established a smarts device start from ST extended open sources SDK. We future implemented a Tai Chi gesture recogniser and integrate to the iOS HeathKit become a calorie tracking, which is a wearable wrist gesture device like Apple Watch but only for dedicated task and relative lower cost.

A simple companion APP developed for received our custom Bluetooth LE packets, translate and record each workout to HealthKit and display the corresponding data on the dynamic list. Either foreground and background, the App will collect and transfer data to HealthKit, and will auto recovery our APP when killed by system due to low memory. However, due to the iOS restriction, disconnected and loss the background monitoring when user force close the APP explicitly (i.e under App Switcher and swipe the running App upwards). In this case, if the bluetooth disconnected and buffer with data waiting to send, the device will broadcast iBeacon's which is a specify identity format advertising though Bluetooth LE.


When the device and iPhone nearby, a notification will be push to encourage the user launch the APP as soon as possible. This APP required any iPhone that support IOS13 (no support IPAD because no HealthKit ) and we use SwiftUI for the dynamic list as well as click it to erase it. In additional, private authorised should be gained from the iPhone Owner.


More Information about iBeacon and HeathKit can be reference of Apple development:



Prepare of Training Material


A good youtube video by Leia's  is showing what Tai Chi is and the very easy beginning.


The Tai Chi is similar to Yoga, originated as a local religion meditation activities in Ancient Chinese. The theory is everything with an anti-force (just some as Newton third law), when our body movement together with a force come back and we need learn to conscious, balance and harmony of both. As currently, this become a heath spiritual practices, normally the Tai Chi is less harder and slower that Yoga and good for elderly. People classically practice on outdoor such in parks or open air mountain views because feeling naturally is a part of training but never mind it also suitable practice it indoor.


We attached a string as a bands and attached to right hand and record the training data by doing the action showed on this youtube video :


0. 0x00 Rest - normal stand up and no activities (with slightly hand movement)

1. 0x04 Flow - 1.30-2.08

2. 0x08 Updown - 2.12-3.00

3. 0x12 Open 3.07-3.38

4. 0x16 Push 3.40-4.15

5. 0x20 Circle 4.25-4.48


Our model able to identify five types of TaiChi gestures, together with the 0x00 Rest for user stop detection.

Import the training sample data in UNICO, carefully select the configuration and get the final config array.


Custom Bluetooth


Firstly, our project started based on the sample FP-IND-PREDMNT1 function pack, which already implemented bluetooth stack, on top of that we change the DeviceID and add new custom services  and Characteristic.


Under sensor_service.c function setConnectable(void), we change the DeviceID from 0x02 to 0x92 representative our new device.


uint8_t manuf_data[26] = {
    2,0x0A,0x00 /* 0 dBm */, // Trasmission Power
    //8,0x09,NAME_BLUEMS, // Complete Name
    8,0x09,NodeName[1],NodeName[2],NodeName[3],NodeName[4],NodeName[5],NodeName[6],NodeName[7], // Complete Name
    13,0xFF,0x01/*SKD version */,
    0x92,  /* Changed  default Sensor.tile DeviceID 0x02 to 0x92 for TaiChi Device */
    0x00, /* AudioSync+AudioData */
    0xE0, /* ACC + Gyro + Mag + Environmental + Battery Info */
    0x00, /*  FFT Amplitude */
    0x00, /* BLE MAC stop */


Under main.c Init_BluNRG_Custom_Services(void), we added a new custom Service by implement Add_TaiCHi_servW2ST_Service()

static void Init_BlueNRG_Custom_Services(void)
  int ret;


  ret = Add_TaiChi_ServW2ST_Service();
       PREDMNT1_PRINTF("Config TaiChi Char added successfully\r\n");
       PREDMNT1_PRINTF("\r\nError while adding Config TaiChi Char\n");



It similar of typical custom service initiation process, as a new set of UUID assigned.

#define COPY_TAICHI_W2ST_SERVICE_UUID(uuid_struct)   COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x00,0x00,0x0D,0x11,0xe1,0x9a,0xb4,0x00,0x02,0xa5,0xd5,0xc5,0x1b)
#define COPY_TAICHI_W2ST_CHAR_UUID(uuid_struct)      COPY_UUID_128(uuid_struct,0x00,0x00,0x00,0x01,0x00,0x0D,0x11,0xe1,0xac,0x36,0x00,0x02,0xa5,0xd5,0xc5,0x1b)


We assigned UUID -000D- for our taichi services and 0001- for our taichi Characteristic.


We also added a AttributeModified_CB for response gatt attribute change like other done.

static voidTaiChi_AttributeModified_CB(uint8_t *att_data);


Reroute the MLC result to Bluetooth LE


Similar of the experiment for stepping motor, our TaiChi APP triggered from MLC1 interrupt and call function getMotionMLData, the tasks are:


  1. Received 0x4 to 0x20 for the Tai Chi gesture begin, a new taiChiResult_t object have been built, assign the result to the member "type" and assign current timestamp to member "starttime", push on the buffer and wait for next interrupt.
  2. Received 0x0 for user stop the gesture, or 0x4-0x20 for the user changed the gesture. Obviously the current taichi workout have been finished. We assign current object's member "endtime" to current time. For 0x0 go idling, otherwise come back to step 1.


The buffer data is waiting for send to IOS device though Bluetooth LE, the default size of buffer is 10, if more than that size, earliest data will dismiss.


SendTaiChiData run on main loop for send out the buffer data to bluetooth. It reconstruct the data for the bluetooth payload, startdate and enddate transfer to UINT16 seconds from current time to avoid time synchronising issue and reduce the payload sizes.


At the end TaiChi_Update(Buff) send out the bluetooth packet.


To minimum the number of packet, each packet is able to send up to four sets of TaiChi gesture data.


  /* Check have data waiting to send*/
  if (!taiChiResultPos)


    uint8_t buff[4+W2ST_TAICHI_MAX_BUFF_LEN*6];

    uint32_t timestamp = HAL_GetTick();

    // num of items have been send in this event, max 4

    uint16_t num_send = taiChiResultPos>4?4:taiChiResultPos;


    int i=0;



         // Start and End time are the seconds before current timestamp
         uint16_t start = (timestamp-BufftaiChiResult[i]->start)/1000;
         uint16_t end = (timestamp-BufftaiChiResult[i]->end)/1000;





    taiChiResultPos -= num_send;




Tweak of Power


Good power management is obviously important for IoT devices, especially many IoT is battery-powered. A great developer should enthusiasm of tweak the power consumption for maximum of battery and the Earth life.


The Slave_Conn_Interval_Min and Slave_Conn_Interval_Max is the value that peripheral (our device) provided to the Host (iOS Core bluetooth) for the suggestion of connection interval. The apple default is 30ms, lower value obtained lower latency and faster speed but require more power, we changed min to 450, and max to 950ms for balance of speed and power. (This only suggestion and may ignore by iOS)


ret = aci_gap_set_discoverable(ADV_IND, 0x00, 0x00,
sizeof(local_name), local_name, 0, NULL, 0x0168, 0x02D0);


The System clock have been calm down from 120mhz to 60mhz and change VoltageScalling from BOOST mode to SCALE1.

void SystemClock_Config(void)
 RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV2;

When the system idle, push the System to LowPowerRunMode and switch to Low power sleep mode (CPU stopped, and peripherals frequency slow) for additional power reduced.

When the gesture detected, the Machine Learning Core interrupt will be triggered and the System wake up instantly. The bluetooth IRQ also able to trigger the system, so would be wake up when bluetooth disconnected.



We also future switch off irrelative GPIO and sensors for future power saving.


By measured the power consumtion using external 5V power supply, the overall power consumption is about 40ma by stock firmware, and our tweak achieved around 23-30ma. Curiosity is by theory the CPU only draw few uA at Low power sleep mode and all other parts is ultra-low power so that the overall current should down to few ma, I suspect the problem come from power and charger IC (SBTC02) or the LDO may draw up some constant power.


The battery performance is approximate drop about 3% for every hour by using the stocked battery (when the battery under 60%). Be notice that the battery level on reference firmware is inaccuracy especially when the battery low or near full, it is because the developing kit is for general battery and the battery level only calculate by a linear regression. For rigorous, implement a look-up table for specified each type of battery.


The kits stocked with 100ma maximum charging speed, which is too slow for real application (can be change Iset resistor for faster charging speed).




The APP will run background and continue connecting and receive the packets from the device, however the APP will lose connection after the user force close the APP explicitly.

In order to encourage the user relaunch of our companion APP to receive the data.We involved the iBeacon advertising so that a notification will display on the iPhone when new data waiting and within the bluetooth range. (The user may switch off this function)


The user can click the TAICHI notifications to launch the APP directly.


The iBeacon have been based on Bluetooth LE, therefore it is possible implementing on top of our bluetooth stack.


Modify inside of Init_BlueNRG_Stack, add GAP_BROADCASTER_ROLE as iBeacon require Broadcaster role.

ret = aci_gap_init(GAP_PERIPHERAL_ROLE | GAP_BROADCASTER_ROLE, 0, 0x07, &service_handle, &dev_name_char_handle, &appearance_char_handle);


Based on Apple specification, the iBeacon broadcast frequency is fixed 100ms interval, in order to iBeacon and discoverable simultaneously, we will switch two mode alternatively every 50ms, so that IOS APP is able to connect the devices instantly when the notification appear on iPhone.

if (!connected && HAL_GetTick()%100 < 50){

    // Only broadcast iBeacon when Buff have data waiting to send
     if (!isBeacon && taiChiResultPos){

    if (isBeacon){


The setBeacon broadcast the advertising based on the Apple requirement.

0-8 bytes is fixed and specified by Apple, we distinguish ourselves by a unique proximity UUID, Major/Minor all set to 00 ignore it, and set bytes 29 measured power to 0xC6 follow by procedure measured RSSI at a 1 meter distance between the box and iPhone. This value is provided for iOS for distance optimisation.

void setBeacon(void)

/*Set iBeacon avertising packet based on Apple Proximity beacon specification 2.1 */
    uint8_t beacon[31] =
    0x00,0x02,0x00,0x00,0x00,0x0d,0x11,0xe1,0xac,0x36,0x00,0x02,0xa5,0xd5,0xc5,0x1b, //custom UUID 

    /* switch off connectable */

      /* switch off scanable */

/*Set advertising parameters for non connectable avertising */
    tBleStatus ret = hci_le_set_advertising_parameters(0xA0,0xA0,ADV_NONCONN_IND,0x01,0x01,NULL,0x07,0x00);

  /* set beacon advertising data */
  ret = hci_le_set_advertising_data(0x1E,beacon);

  /* enable beacon advertise */
  ret = hci_le_set_advertise_enable(0x01);



Full specification of iBeacon can be download on Apple developer site once you accept the license agreement.


The iOS Companion APP

Finally we built an iOS Companion APP which is a linker between the HealthKit and our Sensor Box though bluetooth LE, the ST BlueSDK is free at


The BlueSDK run on top of Apple Core Bluetooth to provide a higher abstract layer for bluetooth LE data exchange.



This APP with a dynamic list showed the taichi workout that HealthKit stored. The APP involve SwitchUI and HealthKit so it is exclusive for any iPhone (no HealthKit in IPAD) on iOS 13 or above. The device name and connection status showed on bottom (debug only), Top is a dynamic list showed the Taichi type (by icon), start and end time, and the calorie (only for demo purpose and may not accuracy for medical use).

The data is all storage under HealthKit locally on the phone, the TaiChi APP is not storage any user sensitive data, write and read access should authorised when the APP first startup.


User is able to track their Tai Chi data on the Apple Health directly and enjoy system level collaborative and security.


The detail of implementation is out of scope of this RoadTest and welcome to future reference on our Git.


Notice that, all custom service and characteristic need explicit and added to the node before connection. iBeacon UUID also required to match our device setting.

ST provide detail manual for the SDK.




The STWIN SensorTile development kit is a small cube that integrated a range of sensors and mics for wireless industrial node and IoT applications. This kit out of boards provided Android/IOS APP for the reference firmware, in additional, ST also provided open sources software package and libraries for flexible development. This also supplied with a battery and a enclosure make it ideally build of tremendous mobile and portable applications.


Thanks for ISM330DHCX accelerometer and gyroscope with Machine Learning Core embedded, developer can involve trained model for sensors conditional classified and analysis within a single sensor chip, as low latency, power friendly and robustness from the dedicated hardware. It also enhance the security and avoid exploit because the sensitive sensors data processed within a single sensor IC to avoid exposure to external interface or micro-controller. Our TaiChi gesture recognising is fully utilised of the MLC core, it hide all sensor data and only the result value the MCU known.


However, as the WIFI module is optional and not included on the  package, so that i am no opportunity to test it. It also lack of connector for common development modules such as Pmod or Mikro  make it hard to connect additional testing modules. The battery connector is face down, so that if any issue on development status, the system may halt fully, for solve require remove the mounting screw and take out the battery.


image      Small and Portable

image      Machine Learning Core

image      Wide range of high quality ST sensors and mics

image      Included Li-Po battery and enclosure

image      ST provided enrich and open-sources development tools


image      No WIFI module included

image      No expandable for common development interfaces (like Pmod or Mikro)

image      Battery connector face down

image      Current version of UNICO no direct support for this kit

image      Battery charging speed too slow for real product (stock max 100ma, need change Iset Resistor for faster charging)



The sources code for this road test available on:



Thanks element14 and ST provide this opportunity for testing this extraordinarily product.

  • Nice review.


    It looked like using the device is fairly software intensive.

    Would you recommend it for a newbie?



  • It definitely harder that Arduino or Raspberry as those with more support from community, easy of understand and huge abstract resources available. However you don't need too much programming knowledge for just use it as a basic logging, the reference firmware and mobile app just work it well.

    As this is a developing tool which intent for engineer transfer prototype to final products, it may not good for small projects just for few IoT. This is good for a educational tool for anyone wish to study the running on lower-level, which is the essentially skills for design ingenious products.

    For example, if you design a coin battery powered product, actually can eliminate the STM32 main CPU and direct connect the ISM sensor to bluetooth module for future power-save and cost-efficiency, to do that you need more advanced knowledge of how it work in deep.

  • It definitely harder that Arduino or Raspberry as those with more support from community, easy of understand and huge abstract resources available. However you don't need too much programming knowledge for just use it as a basic logging, the reference firmware and mobile app just work it well.

    As this is a developing tool which intent for engineer transfer prototype to final products, it may not good for small projects just for few IoT. This is good for a educational tool for anyone wish to study the running on lower-level, which is the essentially skills for design ingenious products.

    For example, if you design a coin battery powered product, actually can eliminate the STM32 main CPU and direct connect the ISM sensor to bluetooth module for future power-save and cost-efficiency, to do that you need more advanced knowledge of how it work in deep.

No Data