cancel
Showing results for 
Search instead for 
Did you mean: 

How to use NanoEdge AI Studio to create a data logger

B.Montanari
ST Employee

Summary

This article presents a comprehensive guide on utilizing NanoEdge AI Studio to develop a data logger for embedded projects on Arm® Cortex® -M MCUs. It addresses the essential prerequisites, initiates a project with data logger generation, and offers clear, step-by-step instructions for project development within the NanoEdge AI Studio. The tutorial underscores the user-friendly nature of the process, making it accessible to individuals new to AI. It concludes with the deployment of the machine learning library to an STM32 device, specifically leveraging the ISM330DHCX accelerometer as the sensor for movement identification. The data logger implementation configures access to the sensor, manages its sampling process, and transmits this data over the serial bus using the USART peripheral.

Introduction

NanoEdge AI Studio is a free AutoML software for adding edge AI to embedded projects offered by ST. It simplifies the integration of AI into any embedded project running on Arm® Cortex®-M MCUs. It enables embedded engineers, including those with limited AI experience, to identify the optimal AI model for their specific needs through intuitive processes.

NanoEdge AI Studio facilitates the generation of ML libraries for various project types, utilizing data from one or more sensors, potentially of diverse types. Presently, it supports the creation of four project types: Anomaly Detection (AD), 1-Class classification (1CC), n-Class classification (nCC), and Extrapolation (E).

This article provides a quick guide on creating a data logger using NanoEdge AI Studio, so you can start creating your own custom database. It includes detailed steps for configuring and deploying firmware on any STM32 device.

Prerequisites

1. Data logger generation

The NanoEdge AI Studio incorporates a feature that enables seamless collection and import of data from serial USB, facilitating the creation of datasets.

To access the data logging screen in NanoEdge AI Studio, navigate to the home page and click on the DL or data logger buttons.

Figure 1 - Data Logger ButtonsFigure 1 - Data Logger Buttons

Then, choose the board you want to use with for your project. In this case, we use the B-U585I-IOT02A board and its available accelerometer.

Figure 2 - NanoEdge Board SelectionFigure 2 - NanoEdge Board Selection

Once the board is selected, you need to configure the sensor and its parameters, including the number of axes, data rate, range, and samples per axis. In this demonstration project, the ISM330DHCX accelerometer is utilized. Choose the parameter values and proceed to click on [Generate Data Logger].

Figure 3 - Sensor SettingsFigure 3 - Sensor Settings

 

On this page, you can also view:

  1. Board product page: For more information regarding the selected board.
  2. Data logger source code: Available on our GitHub Hotspot Page, with the source code to create a custom data logger project. This is extremely valuable if you are planning to use this logger on your custom board. This code can be easily adapted to work on any STM32, as long as a serial port is available to stream data out.
  3. Simple connection instructions: Inform the baud rate for the VCOM.

 Figure 4 - Useful InformationFigure 4 - Useful Information

 

2. Code validation

After generating the data logger, you have downloaded a “NanoEdgeAI_Datalogger” (*.zip) file with a binary (*.bin) file in it. Connect your board to your PC, then drag and drop this binary file to your connected board.

 

Figure 5 - Binary Programming (Drag and Drop)Figure 5 - Binary Programming (Drag and Drop)

The onboard STLINK’s COM LED blinks while the binary is flashed onto the board. You can check the data logger in action by opening a VCOM Terminal and configuring it to your board’s serial communication settings.

For example, when using Tera Term, you can see the board’s sensor raw data being printed on the terminal:

Figure 6 - Raw Data DisplayFigure 6 - Raw Data Display

 

3. Use cases for the data logger and conclusion

The newly created binary for data logger and the overall process can be used for all cases addressed in the NanoEdge. This includes anomaly detection, 1-Class classification, n-Class classification and extrapolation if the developer does not have the dataset previously saved.

A more in-depth tutorial that covers all main settings (data rate, buffer size, sample time etc.) in consideration when creating and tuning your data logger is available in our wiki page.

Hope this article was helpful and for more information, visit our dedicated page: https://stm32ai.st.com/

Related links

Version history
Last update:
‎2024-07-17 07:07 AM
Updated by: