Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions content/learning-paths/embedded-and-microcontrollers/edge/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,48 @@ cascade:

minutes_to_complete: 90

who_is_this_for: This learning path is for beginners in Edge AI and TinyML, including developers, engineers, hobbyists, AI/ML enthusiasts, and researchers working with embedded AI and IoT.
who_is_this_for: This learning path is for beginners in Edge AI and TinyML, including developers, engineers, hobbyists, AI/ML enthusiasts, and researchers working with embedded AI and IoT.

learning_objectives:
- Understand Edge AI and TinyML basics.
- Collect and preprocess audio data using Edge Impulse.
- Train and deploy an audio classification model on Arduino Nano RP2040
- Interface with LEDs to switch them on and off .
- Understand Edge AI and TinyML basics.
- Collect and preprocess audio data using Edge Impulse.
- Train and deploy an audio classification model on Arduino Nano RP2040.
- Interface with LEDs to switch them on and off.

prerequisites:
- Explore this [learning path](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/arduino-pico/) if you are an absolute beginner.
- An [Edge Impulse](https://edgeimpulse.com/) Studio account.
- The [Arduino IDE with the RP2040 board support package](https://learn.arm.com/install-guides/arduino-pico/) installed on your computer
- An Arduino Nano RP2040 Connect [board](https://store.arduino.cc/products/arduino-nano-rp2040-connect-with-headers?_gl=1*9t4cti*_up*MQ..*_ga*NTA1NTQwNzgxLjE3NDYwMjIyODk.*_ga_NEXN8H46L5*MTc0NjAyMjI4Ny4xLjEuMTc0NjAyMjMxOC4wLjAuMjA3MjA2NTUzMA..).
- An [Edge Impulse](https://edgeimpulse.com/) Studio account.
- The [Arduino IDE with the RP2040 board support package](https://learn.arm.com/install-guides/arduino-pico/) installed on your computer
- An Arduino Nano RP2040 Connect [board](https://store.arduino.cc/products/arduino-nano-rp2040-connect-with-headers?_gl=1*9t4cti*_up*MQ..*_ga*NTA1NTQwNzgxLjE3NDYwMjIyODk.*_ga_NEXN8H46L5*MTc0NjAyMjI4Ny4xLjEuMTc0NjAyMjMxOC4wLjAuMjA3MjA2NTUzMA..).

author: Bright Edudzi Gershon Kordorwu
### Tags
skilllevels: Introductory
subjects: ML
armips:
- Cortex-M

tools_software_languages:
- Edge Impulse
- tinyML
- Edge AI
- Arduino
operatingsystems:
- Baremetal




further_reading:

- resource:
title: TinyML Brings AI to Smallest Arm Devices
title: TinyML Brings AI to Smallest Arm Devices
link: https://newsroom.arm.com/blog/tinyml
type: blog
- resource:
title: What is edge AI?
title: What is edge AI?
link: https://docs.edgeimpulse.com/nordic/concepts/edge-ai/what-is-edge-ai
type: blog
- resource:
title: Edge Impulse for Beginners
title: Edge Impulse for Beginners
link: https://docs.edgeimpulse.com/docs/readme/for-beginners
type: doc
type: doc



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ layout: learningpathall

### Arduino Nano RP2040

To get started with your first **TinyML project**, a great option is the **Arduino Nano RP2040 Connect**. Built by Arduino, it uses the powerful **RP2040 microcontroller** and is fully supported by the Arduino core package. The board comes with built-in Wi-Fi, Bluetooth, and an onboard IMU—features that make it ideal for deploying machine learning models at the edge.
To get started with your first **TinyML project**, the **Arduino Nano RP2040 Connect** is a good option. Built by Arduino, it uses the **RP2040 microcontroller** and is fully supported by the Arduino core package. The board comes with built-in Wi-Fi, Bluetooth, and an onboard IMU—features that is useful for deploying machine learning models at the edge.

![example image alt-text#center](images/nano.png "Arduino Nano RP2040")

Its compatibility with popular tools like Edge Impulse and the Arduino IDE makes it a beginner-friendly yet powerful choice for TinyML applications. You can learn more about the Arduino Nano RP2040 Connect on the [official Arduino website](https://store.arduino.cc/products/arduino-nano-rp2040-connect-with-headers?_gl=1*1laabar*_up*MQ..*_ga*MTk1Nzk5OTUwMS4xNzQ2NTc2NTI4*_ga_NEXN8H46L5*czE3NDY1NzY1MjUkbzEkZzEkdDE3NDY1NzY5NTkkajAkbDAkaDE1MDk0MDg0ODc.).
Its compatibility with popular tools like Edge Impulse and the Arduino IDE makes it a suitable choice for TinyML applications. You can learn more about the Arduino Nano RP2040 Connect on the [official Arduino website](https://store.arduino.cc/products/arduino-nano-rp2040-connect-with-headers?_gl=1*1laabar*_up*MQ..*_ga*MTk1Nzk5OTUwMS4xNzQ2NTc2NTI4*_ga_NEXN8H46L5*czE3NDY1NzY1MjUkbzEkZzEkdDE3NDY1NzY5NTkkajAkbDAkaDE1MDk0MDg0ODc.).

## Put everything together

### Step 1: Connect the LED to the Arduino Nano RP2040

To visualize the output of the voice command model, we will use a simple LED circuit.
To visualize the output of the voice command model, you will use a simple LED circuit.

### Components Needed

Expand All @@ -40,9 +40,7 @@ To visualize the output of the voice command model, we will use a simple LED cir

To program and deploy your trained model to the Arduino Nano RP2040, you first need to configure your development environment.

Follow the detailed setup instructions provided in the following learning path:

[Arduino Nano RP2040 Setup Guide](https://learn.arm.com/install-guides/arduino-pico/)
Follow the detailed setup instructions provided in the [Arduino Nano RP2040 Install Guide](https://learn.arm.com/install-guides/arduino-pico/)

This guide will walk you through:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: Overview
title: Overview
weight: 2

### FIXED, DO NOT MODIFY
layout: learningpathall
---

This section introduces the related topics that make out the basis for this learning path. Review it before proceeding to the step-by-step tutorial.

# Edge AI
Edge AI refers to artificial intelligence models that run directly on edge devices, processing data locally rather than relying on cloud computing. These models are optimized for real-time decision-making on resource-constrained devices, such as microcontrollers, embedded systems, and IoT sensors.

Expand Down Expand Up @@ -45,9 +47,9 @@ Wearable devices also benefit from Edge AI. Smartwatches monitor health by detec

In industrial settings, predictive maintenance applications rely on IoT sensors to monitor vibrations and temperatures, helping prevent machinery failures. Smart agriculture systems use soil condition sensors to optimize irrigation and fertilization, while autonomous vehicles process sensor data for real-time navigation and obstacle detection.

## Importance of Edge AI
## The BLERP mnemonic

To understand the benefits of **Edge AI**, just **BLERP**, BLERP highlights the critical aspects of deploying machine learning models on edge devices, focusing on **Bandwidth, Latency, Economics, Reliability, and Privacy**. These components are key to understanding the advantages of processing data on-device rather than relying on the cloud. The table below provides an overview of each component and its importance in Edge AI applications "Situnayake, 2023"
To help remember the benefits of **Edge AI**, **BLERP** highlights the critical aspects of deploying machine learning models on edge devices. First used by Situnayake in 2023, the abbreviation expands to **Bandwidth, Latency, Economics, Reliability, and Privacy**. These components are key to understanding the advantages of processing data on-device rather than relying on the cloud. The table below provides an overview of each component and its importance in Edge AI applications.

| Area | Description |
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand All @@ -65,5 +67,5 @@ Edge AI is transforming multiple industries. In healthcare, AI-powered medical d

To build effective TinyML and Edge AI projects, one needs more than just data—**both software and hardware** play a critical role in the development process. While data forms the foundation for training machine learning models, the **software** enables data processing, model development, and deployment, and the **hardware** provides the physical platform for running these models at the edge.

In this learning path, we will build a model that recognize specific voice commands, which will be used to **control LEDs on the Arduino Nano RP2040 Connect**. In the following steps, both software and hardware components will be discussed in detail.
In this learning path, you will build a model that recognize specific voice commands, which will be used to **control LEDs on the Arduino Nano RP2040 Connect**. In the following steps, both software and hardware components will be discussed in detail.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ layout: learningpathall

# Programming your first tinyML device

This Learning Path provides a complete sketch that you can upload onto your Arduino Nano RP2040. Follow the steps below to get started.
This section helps you create a complete sketch that you can upload onto your Arduino Nano RP2040.

## Step 1: Create a New Sketch

Expand All @@ -20,7 +20,7 @@ This Learning Path provides a complete sketch that you can upload onto your Ardu
## Step 2: Upload the Arduino Library from Edge Impulse

1. After creating and saving your sketch, go to **Sketch** > **Include Library** > **Add .ZIP Library**.
2. In the file dialog that opens, navigate to the location of the **ZIP file** you exported from Edge Impulse in [Set up your environment](http://localhost:1313/learning-paths/embedded-and-microcontrollers/egde/software_edge_impulse/)
2. In the file dialog that opens, navigate to the location of the **ZIP file** you exported from Edge Impulse in [Set up your environment](/learning-paths/embedded-and-microcontrollers/edge/software-edge-impulse/)
3. Select the **ZIP file** and click **Open**.

## Step 3: Include the Library in Your Sketch
Expand All @@ -33,9 +33,9 @@ The libray should be of the form `Name_of_your_library_inferencing.h`

# Code walk-through

Before running the code, it’s important to understand what each part does.
In the example repository, you will find a code snippet `Code_Sample.ino`, which is used as a sketch for the project. Before running the code, it’s important to understand what each part does.

Take a few minutes to read through the comments and logic in the sketch before uploading it to your board. The code can be downloaded [here](jkhkjhjk).
Take a few minutes to read through the comments and logic in the sketch before uploading it to your board. The code is available in the example repository, and below is a walk-through of the steps.

## Include Necessary Libraries and Define Data Structure for Inference

Expand Down Expand Up @@ -277,12 +277,12 @@ void print_inference_result(ei_impulse_result_t result) {
```

{{% notice Note %}}
The `ei_printf` command is a custom logging function from the Edge Impulse SDK, used for printing debug or inference-related information to the serial monitor, optimized for embedded systems. It works similarly to `printf` but is tailored for the Edge Impulse environment. You can download the complete [Code_Sample.ino](https://github.com/e-dudzi/Learning-Path.git) and try it out yourself.
The `ei_printf` command is a custom logging function from the Edge Impulse SDK, used for printing debug or inference-related information to the serial monitor, optimized for embedded systems. It works similarly to `printf` but is tailored for the Edge Impulse environment. You can find the complete `Code_Sample.ino` in the example repository and try it out yourself.
{{% /notice %}}

# Run Your Code

Now that you have a good understanding of the code, you should run it on your device. With your **Arduino Nano RP2040** plugged into your computer, and the correct [board and port](http://localhost:1313/learning-paths/embedded-and-microcontrollers/egde/connect-and-set-up-arduino/) selected in the Arduino IDE, follow these steps:
Now that you have a good understanding of the code, you should run it on your device. With your **Arduino Nano RP2040** plugged into your computer, and the correct [board and port](/learning-paths/embedded-and-microcontrollers/egde/connect-and-set-up-arduino/) selected in the Arduino IDE, follow these steps:

#### If you're using the **Upload Button**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ layout: learningpathall
---
# Using Edge Impulse to Train TinyML Models

Now that the foundational concepts of TinyML and Edge AI are clear, it's time to move from theory to practice. One of the most accessible and easy to use platforms for training TinyML models is **Edge Impulse**. It provides an intuitive, end-to-end pipeline for collecting data, designing features, training models, and deploying them to edge devices. In this section, we will explore how Edge Impulse is used to train models specifically for ultra-low-power microcontrollers, bridging the gap between machine learning and real-world embedded applications.
Now that the foundational concepts of TinyML and Edge AI are clear, it's time to move from theory to practice. **Edge Impulse** is an easy to use platform for training TinyML models. It provides an end-to-end pipeline for collecting data, designing features, training models, and deploying them to edge devices. In this section, you will explore how Edge Impulse is used to train models specifically for ultra-low-power microcontrollers, bridging the gap between machine learning and real-world embedded applications.

## What is Edge Impulse?

Expand Down Expand Up @@ -47,7 +47,7 @@ Once you’ve created your account and logged in, the first step is to **create

### Step 2: Configure the Target Device

After creating your project, the next step is to **configure the target device**. Since we are using the **Arduino Nano RP2040 Connect**, click the highlighted button to begin device configuration, as shown in the snapshot below. This ensures that the data collection, model training, and deployment steps are optimized for your specific hardware.
After creating your project, the next step is to **configure the target device**. Since you are using the **Arduino Nano RP2040 Connect**, click the highlighted button to begin device configuration, as shown in the snapshot below. This ensures that the data collection, model training, and deployment steps are optimized for your specific hardware.

The specifications of the Arduino Nano RP2040 Connect board can be found on [Arduino’s official page](https://store.arduino.cc/products/arduino-nano-rp2040-connect).

Expand All @@ -59,7 +59,13 @@ Follow the exact settings in the attached snapshot to complete the configuration

With your device configured, the next step is to **add your dataset** to the project. Click on the **"Add existing data"** button and follow the configuration settings shown in the attached snapshot. This allows you to upload pre-recorded data instead of collecting it live, which can save time during the development phase.

The dataset for this project can be downloaded from the following link: [Download Dataset](https://github.com/e-dudzi/Learning-Path.git). The Dataset has already been split into **training** and **testing**.
An **example repository** has been set up with some assets to be used throughout this Learning Path. You can clone it with the following command:

```bash
git clone https://github.com/e-dudzi/Learning-Path.git
```

The repository contains a `Dataset.zip` file containing the dataset used in the project. Extract it on your local machine. For convenience, the dataset has already been split into **training** and **testing**.

![example image alt-text#center](images/6.png "Figure 4. Add Existing Data")

Expand Down Expand Up @@ -141,7 +147,7 @@ Review these metrics to determine if the model is learning effectively. If neede

![example image alt-text#center](images/15.png "Figure 12. Model Performance")

You can also [download](https://github.com/e-dudzi/Learning-Path.git) a pre-trained model and continue from here.
You can also use the pre-trained model in the `ei-edge-ai-tutorials-arduino-1.0.1.zip` archive, from the example repository.

### Final Step: Deploying the Model

Expand All @@ -150,13 +156,13 @@ To use the trained model on your Arduino Nano RP2040, follow the steps below to
1. Click on the **Deployment** tab from the menu.
2. In the **search bar**, type **"Arduino"** to filter the export options.
3. Select **Arduino library** from the list.
4. The export process will start automatically, and the model will be downloaded as a `.zip` file.
4. If the export process does not start automatically, click **Build**. The model will be downloaded as a `.zip` file.

![example image alt-text#center](images/16.png "Figure 13. Model Deployment")

## Next Steps

In the following steps, you will move from model training to real-world deployment. Specifically, we will:
In the following steps, you will move from model training to real-world deployment. Specifically, you will:

- Connect an **LED** to the **Arduino Nano RP2040** board.
- Set up the **Arduino IDE** for development.
Expand Down