stm32cube
stm32cube
(FP-AI-PREDMNT2)
2
1- Hardware and Software overview
STWIN development kit - STEVAL-STWINKT1B
Hardware Overview
STWIN - SensorTile Wireless Industrial Node
The STWIN (STEVAL-STWINKT1B) is a development kit and reference design that simplifies prototyping and testing
of advanced industrial IoT applications such as condition monitoring and predictive maintenance. The kit supports
BLE wireless connectivity through an on-board module and Wi-Fi connectivity through a special plugin expansion
board (STEVAL-STWINWFV1), wired RS485 and USB OTG connectivity.
Key Features
• Multi-sensing wireless platform implementing vibration monitoring and ultrasound detection
• Updated version of STEVAL-STWINKT1, now including STSAFE-A110 populated, BlueNRG-M2S module and
IMP23ABSU MEMS microphone
• Ultra-low-power ARM Cortex-M4 MCU at 120 MHz with FPU, 2048 kbytes Flash memory (STM32L4R9)
• Micro SD Card slot for standalone data logging applications
• Option to implement Authentication and Brand protection secure solution with STSAFE-A110
• Wide range of industrial IoT sensors: ultra-wide bandwidth (up to 6 kHz), low-noise, 3-axis digital vibration sensor
(IIS3DWB), 3D accelerometer + 3D Gyro iNEMO inertial measurement unit (ISM330DHCX) with machine learning core,
ultra-low-power high performance MEMS motion sensor (IIS2DH), ultra-low-power 3-axis magnetometer (IIS2MDC),
digital absolute pressure sensor (LPS22HH), relative humidity and temperature sensor (HTS221), low-voltage digital local
temperature sensor (STTS751), industrial grade digital MEMS microphone (IMP34DT05), analog MEMS microphone with
frequency response up to 80 kHz (IMP23ABSU)
Latest info available at
• Modular architecture, expandable via on-board connectors: STMOD+ and 40-pin flex general purpose expansions, 12-pin www.st.com/stwin
male plug for connectivity expansions, 12-pin female plug for sensing expansions
• Other kit components: Li-Po battery 480 mAh, STLINK-V3MINI debugger with programming cable, Plastic box
STWIN development kit - STEVAL-STWINWFV1
Hardware Overview
Wi-Fi expansion for the SensorTile Wireless Industrial Node (STWIN) kit
The STEVAL-STWINWFV1 expansion board adds 2.4 GHz Wi-Fi connectivity to the STEVAL-STWINKT1B.
Application examples that take advantage of this expansion board can be found also in STSW-STWINKT01 firmware
package as well as in the FP-IND-PREDMNT1 and FP-AI-PREDMNT2 Predictive Maintenance Function Pack.
Key Features
• Wi-Fi adapter for STEVAL-STWINKT1B
• Plugs into STWIN core system board through dedicated 12-pin connector
• Single 3.3 V power supply input
• ISM43362-M3G-L44-E Wi-Fi module:
• 802.11 b/g/n Compatible based on Broadcom MAC/Baseband/Radio device
• Fully contained TCP/IP stack
• Host interface: SPI up to 25 MHz
• Network features ICMP ( Ping), ARP, DHCP,TCP, UDP
• Low power operation (3.3 V supply) with built-in low power modes
• Secure Wi-Fi authentication WEP-128, WPA-PSK (TKIP), WPA2-PSK
• CE, FCC and IC certified
• RoHS and China RoHS compliant
• WEEE compliant
Latest info available at www.st.com
STEVAL-STWINWFV1
FP-AI-PREDMNT2 Software Description FP-AI-PREDMNT2
FP-AI-PREDMNT2 is an STM32Cube function pack that programs the STWIN as an
IoT Edge node, connected to the cloud, able to acquire sensor data, process them and Software Overview
send the results to the DSH-PREDMNT cloud dashboard. It includes dedicated
algorithms for advanced time and frequency domain signal processing and analysis of
3D digital accelerometers with flat bandwidth up to 6 kHz. Overall Software Architecture
Key features
• Compatible with NanoEdge™ AI Studio solution from Cartesiam, to enable AI-
based solution (NanoEdge™ AI library generation is out of the scope of this
function pack and must be generated using NanoEdge™ AI Studio)
• Generic FFT library middleware to enable frequency domain analysis for any kind
of sensor through Fast Fourier Transform (with programmable size, overlapping
and windowing)
• Motion TD library middleware for vibration analysis in time domain (speed RMS
and acceleration peak)
• Configurable alarm and warning thresholds for key parameters
• Compatible with STBLESensor application for Android/iOS, to perform Wi-Fi
configuration and secure certificate provisioning
• Compatible with DSH-PREDMNT web-based predictive maintenance dashboard
for monitoring sensor data and device status
• Easy portability across different MCU families, thanks to STM32Cube
• Firmware modular example based on eLooM (embedded Light object-oriented
fraMework for STM32) to enable code re-usability at application level
• Free, user-friendly license terms
MicroUSB Cable
ST BLESensor App
8
Setup & Demo Examples
HW prerequisites
STLINK-V3MINI
Assembled Kit
Programming cable
9
Setup & Demo Examples
Software and Other prerequisites
• STM32CubeProgrammer Software
• Download and install STM32CubeProgrammer
• FP-AI-PREDMNT2
• Copy the .zip file content into a folder on your PC. The package will contain source code example (Keil, IAR,
STM32CubeIDE) based on STEVAL-STWINKT1B
• ST BLE Sensor Application for Android/iOS to download from Google Store / iTunes
• ST DSH-PREDMNT Account
10
Setup & Demo Examples
Firmware update
12
FP-AI-PREDMNT2
Setup Overview
STWIN Power ON/OFF
13
2.1- Setup wi-fi and security certificates
through ST BLESensor app
Wi-fi configuration and certificate request
• Once the firmware has been loaded, press the [Reset] black button on the STWIN core system. Then, open
STBLESensor app and connect to PM2_100 device.
• Open the menu, select [Board configuration] and open [Certificate Request].
• Select [Predictive Maintenance] and sign in with your MyST credentials.
Wi-fi configuration and certificate request
• Ask for a new certificate by tapping the + symbol placed at the bottom of the screen or retrieve the ones
already associated to your myST account. The certificates valid for your STWIN are highlighted in blue
• Tap on the key to download the security certificates into the STWIN and tap on the Wi-Fi symbol to update Wi-
Fi credentials.
Once the procedure ends correctly, the orange LED switches on.
16
Now the STWIN is connected to the AWS PREDMNT dashboard and is ready to stream data.
2.2- Setup and use DSH-PREDMNT
dashboard
How to use DSH-PREDMNT dashboard
DSH-PREDMNT features
18
How to use DSH-PREDMNT dashboard
Configure periodic update time
1 2
Drag balloons
Configure transmission
periods
19
How to use DSH-PREDMNT dashboard
Configure measures and condition monitoring thresholds
• Configure the measures to take under control and set thresholds for warning and alerts
1 2 3
Threshold
configuration
Configure alarms
20
Measures domains
How to use DSH-PREDMNT dashboard
Add a device to live monitoring
21
How to use DSH-PREDMNT dashboard
Hand Shaking Device – Flexible visualization
• The Dashboard recognizes the device, update the device shadow (that will be used for other
purposes also) and adapt the visualization
Vibration (TDM)
Environmental domain
domain
Acoustic domain
22
FP-AI-PREDMNT2
DHS-PREDMNT dashboard to visualize data and setup STWIN
23
2.3- Setup NanoEdge™ AI library by
Cartesiam
24
Setup a NanoEdge™ AI library into FP-AI-PREDMNT2
Build library using Embed into
Generating contextual data using Use with
NanoEdge™ AI FP-AI-
FP-SNS-DATALOG1 DSH-PREDMNT
Studio PREDMNT2
NanoEdge
Normal Modeling
integration Real-time
Accelerometer
NanoEdge learning
Anomaly Results
implementation
1 2 3 4 5
25
Capture data and create a labelled dataset
Generating contextual data using FP-SNS-DATALOG1
normalDataFull.csv
abnormalDataFull.csv
Serial
Use NanoEdge AI Studio tool
Build library using NanoEdge™ AI Studio
1. Libneai.a
2. NanoEdgeAI.h
27
Integration in the FP
Embed into FP-AI-PREDMNT2
NanoEdgeAI.h
Libneai.a
5 Re-compile the FP
Running and Learning
Use FP-AI-PREDMNT2 with DSH-PREDMNT
NanoEdgeAI_learn() NanoEdgeAI_execute()
29
Running and Re-training
Use FP-AI-PREDMNT2 with DSH-PREDMNT
30
Send a command to NanoEdge™ AI library
A
• DSH-PREDMNT allow you to configure
and setup your custom NanoEdge™ AI
library
A. Click on the Configuration tab
B. Select the symbol of the desired
STWIN board
C. Click on Anomaly detection
B
C
Send a command to NanoEdge™ AI library
D E
• The settings tab allow to setup the sensitivity and the threshold parameters
• The commands tab allow to chose either train or detect command. The result of the
train command is the training of the neai library for the time interval set in the “phase
duration” form. The detect command will trigger the anomaly detection phase in the
application in according with the generated library
Detection phase of NanoEdge™ AI library
2
1 Orange led is blinking
Start detection
Alarm sent
• If the detect command is set, in according with the custom NanoEdge™ AI library, an
anomaly event is sent to the dashboard and an event will be shown in the EVENTS
panel of the dashboard.
• For further details on how NanoEdge™ AI libraries work, read the
detailed documentation of NanoEdge™ AI Studio.
3- Documents & Related Resources
Documents & Related Resources
All documents are available in the DESIGN tab of the related products webpage
FP-AI-PREDMNT2:
• DB4566: STM32Cube function pack for STEVAL-STWINKT1B evaluation kit for predictive maintenance application based on
artificial intelligence (AI) – databrief
• UM2937: Getting started with the STM32Cube function pack for STEVAL-STWINKT1B evaluation kit for predictive
maintenance application based on artificial intelligence (AI) – user manual
• Software setup file
STEVAL-STWINKT1B:
• Gerber files, BOM, Schematic
• DB4345: STWIN SensorTile Wireless Industrial Node development kit and reference design for industrial IoT applications –
databrief
• UM2777: How to use the STEVAL-STWINKT1B SensorTile Wireless Industrial Node for condition monitoring and predictive
maintenance applications – user manual
STEVAL-STWINWFV1:
• Gerber files, BOM, Schematic
• DB3971: Wi-Fi expansion for the SensorTile Wireless Industrial Node (STWIN) kit – databrief
DSH-PREDMNT:
• Cloud based web application for condition monitoring and predictive maintenance
o STM32Cube expansion software. Expansion software provided free of charge for use with
STM32 Nucleo expansion boards, and compatible with the STM32Cube software
framework Function Packs
o STM32Cube Function Packs. Set of function examples for some of the most common
application cases built by leveraging the modularity and interoperability of STM32 Nucleo
development boards and expansions, with STM32Cube software and expansions.
The STM32 Open Development Environment is compatible with a number of IDEs including
IAR EWARM, Keil MDK, mbed and GCC-based environments.
STM32 Open Development Environment:
all that you need
The combination of a broad range of expandable boards based The building blocks Your need Our answer
on leading-edge commercial products and modular software,
from driver to application level, enables fast prototyping of ideas Accelerometer, gyroscope
Inertial modules, magnetometer COLLECT
that can be smoothly transformed into final designs. Pressure, temperature, humidity
Sense
Proximity, microphone
boards. source