Skip to content

Commit 2526873

Browse files
committed
Application note content update
1 parent d723630 commit 2526873

File tree

4 files changed

+39
-10
lines changed

4 files changed

+39
-10
lines changed

content/hardware/04.pro/boards/portenta-x8/tutorials/16.edge-ai-docker-container/content.md

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 'Edge Impulse on Portenta X8 with Docker'
33
difficulty: intermediate
4-
description: 'Learn how to deploy and run an Edge Impulse model on Portenta X8 using Docker containers and a Flow Sensor for real time anomaly detection.'
4+
description: 'Learn how to create and deploy an Edge Impulse model on Portenta X8 using Docker containers and a flow sensor for real time anomaly detection.'
55
tags:
66
- Portenta X8
77
- Edge Impulse
@@ -31,7 +31,7 @@ Classification results can be used for quick decision making, such as triggering
3131

3232
## Goals
3333

34-
The project showcased in this application note has the following objectives:
34+
The application note has the following objectives:
3535

3636
- Monitor fluid movement using a flow sensor.
3737
- Classify flow patterns in real time with a machine learning model trained in Edge Impulse.
@@ -43,7 +43,7 @@ The project showcased in this application note has the following objectives:
4343

4444
### Hardware Requirements
4545

46-
This project uses the Portenta X8, integrating a flow sensor for real time fluid monitoring. The required hardware includes:
46+
This application note uses the Portenta X8, integrating a flow sensor for real time fluid monitoring. The required hardware includes:
4747

4848
- [Portenta X8](https://store.arduino.cc/products/portenta-x8) (x1)
4949
- Portenta Carrier Family: [Hat Carrier](https://store.arduino.cc/products/portenta-hat-carrier) / [Mid Carrier](https://store.arduino.cc/products/portenta-mid-carrier) (x1)
@@ -95,7 +95,7 @@ This machine learning model can be applied in different industrial and automotiv
9595
|------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
9696
| **Small Automotive Cooling Systems** | - Engine cooling for motorcycles, ATVs, and small passenger vehicles (<1.5L displacement).<br />- Electric vehicle (EV) battery thermal management to prevent overheating.<br />- Turbo intercooler water circuits for efficient heat dissipation. |
9797
| **Industrial Equipment & Electronics Cooling** | - CNC spindle cooling systems ensuring precision machining.<br />- Laser cooling loops for maintaining stable laser operation.<br />- Small heat exchanger loops used in industrial automation and process control. |
98-
| **Medical & Laboratory Cooling** | - Medical imaging devices (MRI, CT scanners) requiring controlled cooling loops.<br/ >- Laboratory chillers used in chemical processing and biomedical research. |
98+
| **Medical & Laboratory Cooling** | - Medical imaging devices (MRI, CT scanners) requiring controlled cooling loops.<br />- Laboratory chillers used in chemical processing and biomedical research. |
9999

100100
### Flow Rate Categorization and Anomaly Detection
101101

@@ -182,7 +182,7 @@ The following Arduino sketch (`sensor-data-generation.ino`) configures the Porte
182182
183183
// Define Flow Sensor Type (Change if using another model)
184184
#define SENSOR_TYPE YFS201
185-
#define SENSOR_PIN PD_15 // Flow sensor signal pin
185+
#define SENSOR_PIN PC_7 // Flow sensor signal pin
186186
187187
FlowSensor flowSensor(SENSOR_TYPE, SENSOR_PIN);
188188
@@ -281,6 +281,7 @@ These extracted features form the input dataset used to train the machine learni
281281
The *Impulse Design* in Edge Impulse structures the feature extraction pipeline, ensuring data is properly preprocessed before being passed to the learning model.
282282

283283
**Time-Series Data Block:**
284+
284285
| **Parameter** | **Value** |
285286
|---------------------|----------------------------------------------|
286287
| **Window size** | 10,000 ms (10 seconds) |
@@ -532,7 +533,7 @@ The M4 core needs to have the **`rpc-flow-sensor.ino`** uploaded to collect and
532533
533534
// Define Flow Sensor Type and Pin
534535
#define SENSOR_TYPE YFS201
535-
#define SENSOR_PIN PD_15 // Flow sensor signal pin
536+
#define SENSOR_PIN PC_7 // Flow sensor signal pin
536537
537538
FlowSensor flowSensor(SENSOR_TYPE, SENSOR_PIN);
538539
@@ -582,8 +583,21 @@ services:
582583
environment:
583584
M4_PROXY_HOST: m4proxy
584585
M4_PROXY_PORT: 5001
586+
volumes:
587+
- '/run/arduino_hw_info.env:/run/arduino_hw_info.env:ro'
588+
- '/sys/devices:/sys/devices'
589+
- '/sys/class/pwm:/sys/class/pwm'
590+
- '/sys/bus/iio:/sys/bus/iio'
591+
- '/var/sota:/var/sota'
585592
extra_hosts:
586-
- "m4proxy:host-gateway"
593+
- "m4proxy:host-gateway"
594+
devices:
595+
- '/dev/gpiochip0'
596+
- '/dev/gpiochip1'
597+
- '/dev/gpiochip2'
598+
- '/dev/gpiochip3'
599+
- '/dev/gpiochip4'
600+
- '/dev/gpiochip5'
587601
networks:
588602
sensorfusion:
589603
aliases:
@@ -746,13 +760,17 @@ docker compose up
746760

747761
***You can add `-d` prefix in the end of the command to start the container in the background, allowing you to continue using the terminal without keeping the container logs displayed. If you skip `-d`, the logs from the containers will be shown in the terminal and it will remain attached to the process until you manually stop it.***
748762

763+
When the application starts for the first time, the shell shows similar output as follows:
764+
765+
![Application Start](assets/ei-docker-start-inteference.gif)
766+
749767
To verify the inference engine is running, check logs:
750768

751769
```bash
752770
docker compose logs -f -n 10
753771
```
754772

755-
The system will now collect flow sensor data, process it with the Edge Impulse model inside a Docker container and detect anomalies.
773+
The system will start to collect flow sensor data, process it with the Edge Impulse model inside a Docker container and detect anomalies.
756774

757775
### Arduino Cloud Integration
758776

@@ -888,9 +906,20 @@ services:
888906
FLOWRATE_VARIABLE_ID: ${FLOWRATE_VARIABLE_ID}
889907
CLASSIFICATION_VARIABLE_ID: ${CLASSIFICATION_VARIABLE_ID}
890908
volumes:
891-
- "/tmp:/tmp"
909+
- '/run/arduino_hw_info.env:/run/arduino_hw_info.env:ro'
910+
- '/sys/devices:/sys/devices'
911+
- '/sys/class/pwm:/sys/class/pwm'
912+
- '/sys/bus/iio:/sys/bus/iio'
913+
- '/var/sota:/var/sota'
892914
extra_hosts:
893-
- "m4proxy:host-gateway"
915+
- "m4proxy:host-gateway"
916+
devices:
917+
- '/dev/gpiochip0'
918+
- '/dev/gpiochip1'
919+
- '/dev/gpiochip2'
920+
- '/dev/gpiochip3'
921+
- '/dev/gpiochip4'
922+
- '/dev/gpiochip5'
894923
networks:
895924
sensorfusion:
896925
aliases:

0 commit comments

Comments
 (0)