You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Featuretitle="IMU for Motion Detection"image="imu">
18
19
19
20
The board provides a 9-axis inertial measurement unit featuring a 3D accelerometer, gyroscope and magnetometer and allows you to detect orientation, motion or vibrations.
This board can be programmed using MicroPython, which is an implementation of the Python® programming language that comes with a subset of the Python® standard library.
Arm® Mbed™ OS is an open-source operating system which the Nano 33 BLE Rev2 builds upon. It’s the same operating system as the Arduino Portenta H7, which allows for Arduino APIs to be integrated using APIs exposed directly by Mbed OS.
Copy file name to clipboardExpand all lines: content/hardware/03.nano/boards/nano-33-ble-rev2/tutorials/get-started-with-machine-learning/get-started-with-machine-learning.md
+17-37Lines changed: 17 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: 'Get Started With Machine Learning on Arduino'
2
+
title: 'Get Started With Machine Learning on the Arduino Nano 33 BLE Rev2'
3
3
difficulty: intermediate
4
4
compatible-products: [nano-33-ble-rev2]
5
5
description: 'Learn how to train and use machine learning models with the Arduino Nano 33 BLE Rev2'
@@ -25,23 +25,19 @@ software:
25
25
26
26
***Important notice! The [TensorFlow Lite Micro Library](https://github.com/tensorflow/tflite-micro-arduino-examples) is no longer available in the Arduino Library Manager. This library will need to be manually downloaded and included in your IDE.***
27
27
28
-
In this article, we’ll show you how to install and run several [TensorFlow Lite Micro](https://www.tensorflow.org/lite/microcontrollers/overview) examples that are available in the [Arduino Library Manager](https://www.arduino.cc/en/guide/libraries).
28
+
In this article, we’ll show you how to install and run several [TensorFlow Lite Micro](https://www.tensorflow.org/lite/microcontrollers/overview) examples.
29
29
30
-
The tutorial below shows you how to install a neural network on your Arduino board to recognize simple voice commands.
31
-
32
-

33
-
34
-
Next, we’ll introduce a more in-depth tutorial you can use to train your own custom gesture recognition model for Arduino using TensorFlow in Colab. This material is based on a practical workshop held by Sandeep Mistry and Don Coleman, an updated version of which is [online here](https://github.com/arduino/ArduinoTensorFlowLiteTutorials/tree/master/GestureToEmoji).
30
+
We’ll talk about how you can train your custom gesture recognition model for Arduino using TensorFlow in Colab. This material is based on a practical workshop held by Sandeep Mistry and Don Coleman, an updated version of which is [online here](https://github.com/arduino/ArduinoTensorFlowLiteTutorials/tree/master/GestureToEmoji).
35
31
36
32
If you have previous experience with Arduino, you may be able to get these tutorials working within a couple of hours. If you’re entirely new to microcontrollers, it may take a bit longer.
37
33
38
34

39
35
40
-
We’re excited to share some of the first examples and tutorials, and to see what you will build from here. Let’s get started!
36
+
We’re excited to share some examples and tutorials, and to see what you will build from here. Let’s get started!
41
37
42
38
<iframewidth="560"height="315"src="https://www.youtube.com/embed/HzCRZsGJLbI"title="YouTube video player"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"allowfullscreen></iframe>
43
39
44
-
**Note:** The following projects are based on TensorFlow Lite for Microcontrollers which is currently experimental within the [TensorFlow repo](https://github.com/tensorflow/tflite-micro-arduino-examples). This is still a new and emerging field!
40
+
**Note:** The following projects are based on [TensorFlow Lite for Microcontrollers](https://github.com/tensorflow/tflite-micro-arduino-examples).
45
41
46
42
## Goals
47
43
- Learn the fundamentals of TinyML implementation and training.
@@ -50,14 +46,9 @@ We’re excited to share some of the first examples and tutorials, and to see wh
50
46
## Hardware & Software Needed
51
47
- An [Arduino Nano 33 BLE Rev2](/hardware/nano-33-ble-rev2) board
52
48
- A Micro USB cable to connect the Arduino board to your desktop machine
53
-
- To program your board, you can use the [Arduino Cloud Editor](https://www.arduino.cc/en/main/software) or install the [Arduino IDE](https://www.arduino.cc/en/main/software). We’ll give you more details on how to set these up in the following sections
49
+
- To program your board, you can use the [Arduino Cloud Editor](https://app.arduino.cc/) or install the [Arduino IDE](https://www.arduino.cc/en/main/software). We’ll give you more details on how to set these up in the following sections
54
50
55
-
The Arduino Nano 33 BLE Rev2 has a variety of onboard sensors meaning potential for some cool TinyML applications:
- Environmental – temperature, humidity and pressure
60
-
- Light – brightness, color and object proximity
51
+
The Arduino Nano 33 BLE Rev2 has a 9-axis IMU (accelerometer, gyroscope, magnetometer) onboard, which gives it some potential for cool TinyML applications.
61
52
62
53
Unlike classic Arduino UNO, the board combines a microcontroller with onboard sensors which means you can address many use cases without additional hardware or wiring. The board is also small enough to be used in end applications like wearables. As the name suggests it has Bluetooth® Low Energy connectivity so you can send data (or inference results) to a laptop, mobile app or other Bluetooth® Low Energy boards and peripherals.
63
54
@@ -68,7 +59,7 @@ Microcontrollers, such as those used on Arduino boards, are low-cost, single-chi
68
59
69
60
Arduino is an open-source platform and community focused on making microcontroller application development accessible to [everyone](https://create.arduino.cc/projecthub). The [board](store.arduino.cc/products/nano-33-ble-rev2) we’re using here has an Arm® Cortex®-M4 microcontroller running at 64 MHz with 1 MB Flash memory and 256 kB of RAM. This is tiny in comparison to cloud, PC, or mobile but reasonable by microcontroller standards.
70
61
71
-

62
+

72
63
73
64
There are practical reasons you might want to squeeze ML on microcontrollers, including:
74
65
@@ -87,28 +78,18 @@ TinyML is an emerging field and there is still work to do – but what’s excit
87
78
88
79
## TensorFlow Lite for Microcontrollers Examples
89
80
90
-
***The TensorFlow Lite examples are currently not compatible with the [Arduino Nano BLE Rev2](/hardware/nano-33-ble-rev2) board.***
91
-
92
81
The inference examples for TensorFlow Lite for Microcontrollers are now packaged and available through the Arduino Library Manager making it possible to include and run them on Arduino in a few clicks. In this section, we’ll show you how to run them. The examples are:
93
82
94
83
- magic_wand – gesture recognition using the onboard IMU
95
84
- person_detection – person detection using an external ArduCam® camera
96
85
97
86
For more background on the examples, you can take a look at the source in the [TensorFlow repository](https://github.com/tensorflow/tflite-micro-arduino-examples). The models in these examples were previously trained. The tutorials below show you how to deploy and run them on an Arduino board. In the next section, we’ll discuss training.
98
87
99
-
## How to Run the Examples Using Arduino Cloud Editor
100
-
101
-
Once you connect your Arduino Nano 33 BLE Rev2 to your desktop machine with a USB cable you will be able to compile and run the following TensorFlow examples on the board by using the [Cloud Editor](https://create.arduino.cc/editor):
102
-
103
-

104
-
105
88
## How To Run The Examples Using the Arduino IDE
106
89
107
-
Alternatively, you can use the same inference examples used in the Arduino IDE application.
90
+
Follow the instructions in the next section setting up the Arduino IDE.
108
91
109
-
First, follow the instructions in the next section Setting up the Arduino IDE.
110
-
111
-
In the Arduino IDE, you will see the examples available via the **File > Examples > Arduino_TensorFlowLite** menu..
92
+
In the Arduino IDE, you will see the examples available via the **File > Examples > Arduino_TensorFlowLite** menu.
112
93
113
94
Select an example and the sketch will open. To compile, upload and run the examples on the board click the arrow icon:
114
95
@@ -126,13 +107,11 @@ We’ve adapted the tutorial below, so no additional hardware is needed – the
126
107
127
108
## IDE Setup
128
109
129
-
**1.** First, let's make sure we have the drivers for the Nano 33 BLE boards installed. If we are using the online IDE, there is no need to install anything, if you are using the offline IDE, we need to install it manually. This can be done by navigating to **Tools > Board > Board Manager...**, searching for **Arduino Mbed OS Nano Boards**, and installing it.
130
-
131
-

110
+
**1.** First, let's make sure you have the [Nano 33 BLE board package](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-board-manager/#mbed-os-nano) installed.
132
111
133
-
**2.** Also, let's make sure we have all the libraries we need installed. If we are using the online IDE, there is no need to install anything. If we are using the offline IDE, this can be done by navigating to **Tools > Manage libraries...**, searching for **Arduino_TensorFlowLite** and **Arduino_BMI270_BMM150**, and installing them both.
112
+
**2.** Also, let's make sure we have all the libraries we need installed.
134
113
135
-

114
+
***Important notice! The [TensorFlow Lite Micro Library](https://github.com/tensorflow/tflite-micro-arduino-examples) is no longer available in the Arduino Library Manager. This library will need to be manually downloaded and included in your IDE.***
136
115
137
116
There are more detailed [Getting Started](/hardware/nano-33-ble-rev2) and [Troubleshooting](https://support.arduino.cc/hc/en-us) guides on the Arduino site if you need help.
138
117
@@ -153,7 +132,7 @@ With the sketch we are creating we will do the following:
153
132
154
133
The complete sketch can be found below:
155
134
156
-
```
135
+
```arduino
157
136
/*
158
137
IMU Capture
159
138
This example uses the on-board IMU to start reading acceleration and gyroscope
@@ -305,7 +284,8 @@ Let’s open the notebook in Colab and run through the steps in the cells – [a
305
284
Next we will use model.h file we just trained and downloaded from Colab in the previous section of our Arduino IDE project:
306
285
307
286
We will be starting a new sketch, you will find the complete code below:
308
-
```
287
+
288
+
```arduino
309
289
/*
310
290
IMU Classifier
311
291
This example uses the on-board IMU to start reading acceleration and gyroscope
@@ -482,4 +462,4 @@ For added fun, the [Emoji_Button.ino](https://github.com/arduino/ArduinoTensorFl
482
462
## Conclusion
483
463
It’s an exciting time with a lot to learn and explore in TinyML. We hope this blog has given you some idea of the potential and a starting point to start applying it in your own projects. Be sure to let us know what you build and [share it](https://create.arduino.cc/projecthub) with the Arduino community.
484
464
485
-
For a comprehensive background on TinyML and the example applications in this article, we recommend Pete Warden and Daniel Situnayake’s new O’Reilly book “[TinyML: Machine Learning with TensorFlow on Arduino and Ultra-Low Power Microcontrollers](https://www.oreilly.com/library/view/tinyml/9781492052036/).”
465
+
For a comprehensive background on TinyML and the example applications in this article, we recommend Pete Warden and Daniel Situnayake’s O’Reilly book “[TinyML: Machine Learning with TensorFlow on Arduino and Ultra-Low Power Microcontrollers](https://www.oreilly.com/library/view/tinyml/9781492052036/).”
Copy file name to clipboardExpand all lines: content/hardware/03.nano/boards/nano-33-ble-rev2/tutorials/imu-accelerometer/content.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ libraries:
13
13
hardware:
14
14
- hardware/03.nano/boards/nano-33-ble-rev2
15
15
software:
16
-
- web-editor
16
+
- cloud-editor
17
17
- ide-v1
18
18
- ide-v2
19
19
---
@@ -32,8 +32,8 @@ The goals of this project are:
32
32
33
33
34
34
## Hardware & Software Needed
35
-
* This project uses no external sensors or components.
36
-
* In this tutorial, we will use the Arduino Web Editor to program the board.
35
+
* This project uses no external sensors or components apart from the Arduino Nano 33 BLE Rev2.
36
+
* In this tutorial, we will use the Arduino Cloud Editor to program the board.
37
37
38
38
39
39
## The IMU System on Nano 33 BLE Rev2
@@ -55,7 +55,7 @@ The Arduino BMI270_BMM150 library allows us to use the Nano 33 BLE Rev2 IMU syst
55
55
-**Gyroscope** Output data rate is fixed at 104 Hz.
56
56
-**Magnetometer** Output data rate is fixed at 20 Hz.
57
57
58
-
If you want to read more about the sensor modules that make up the IMU system, find the datasheet for the <ahref="https://content.arduino.cc/assets/bst-bmi270-ds000.pdf"target="_blank">BMI270</a> and the <ahref="https://content.arduino.cc/assets/bst-bmm150-ds001.pdf"target="_blank">BMM150</a> here.
58
+
If you want to read more about the sensor modules that make up the IMU system, find the datasheet for the [BMI270](https://download.mikroe.com/documents/datasheets/bst-bmi270-ds000-2_datasheet.pdf)and the [BMM150](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmm150-ds001.pdf) here.
59
59
60
60
61
61
### Accelerometer
@@ -72,13 +72,13 @@ In this example, we will use the accelerometer as a "level" that will provide in
72
72
73
73
**1. Setting up**
74
74
75
-
Let's start by opening the Arduino Web Editor, clicking on the **Libraries** tab and searching for the **BMI270_BMM150** library. Then in **> Examples**, open the **SimpleAccelerometer** sketch and once it opens, rename it as **Accelerometer**.
75
+
Let's start by opening the Arduino Cloud Editor, clicking on the **Libraries** tab and searching for the **BMI270_BMM150** library. Then in **> Examples**, open the **SimpleAccelerometer** sketch and once it opens, rename it as **Accelerometer**.
76
76
77
-

77
+

78
78
79
79
**2. Connecting the board**
80
80
81
-
Now, connect the Arduino Nano 33 BLE Rev2 to the computer and make sure that the Web Editor recognizes it, if so, the board and port should appear as shown in the image below. If they don't appear, follow the [instructions](https://create.arduino.cc/getting-started/plugin/welcome) to install the plugin that will allow the editor to recognize your board.
81
+
Now, connect the Arduino Nano 33 BLE Rev2 to the computer and make sure that the Cloud Editor recognizes it, if so, the board and port should appear as shown in the image below. If they don't appear, follow the [instructions](https://create.arduino.cc/getting-started/plugin/welcome) to install the plugin that will allow the editor to recognize your board.
82
82
83
83
84
84

Copy file name to clipboardExpand all lines: content/hardware/03.nano/boards/nano-33-ble-rev2/tutorials/imu-gyroscope/content.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ libraries:
13
13
hardware:
14
14
- hardware/03.nano/boards/nano-33-ble-rev2
15
15
software:
16
-
- web-editor
16
+
- cloud-editor
17
17
---
18
18
19
19
This tutorial will focus on the 3-axis gyroscope sensor of the IMU system on the Arduino Nano 33 BLE Rev2, to measure the direction of force on the board to emulate an object's crash. This will be achieved by utilizing the values of the gyroscope's axes and later printing the return values through the Arduino IDE Serial Monitor.
@@ -32,8 +32,8 @@ The goals of this project are:
32
32
33
33
## Hardware & Software Needed
34
34
35
-
* This project uses no external sensors or components.
36
-
* In this tutorial, we will use the Arduino Web Editor to program the board.
35
+
* This project uses no external sensors or components apart from the Arduino Nano 33 BLE Rev2.
36
+
* In this tutorial, we will use the Arduino Cloud Editor to program the board.
37
37
38
38
39
39
## The BMI270 & BMM150 Inertial Modules
@@ -55,7 +55,7 @@ The Arduino BMI270_BMM150 library allows us to use the Nano 33 BLE Rev2 IMU modu
55
55
-**Gyroscope** output data rate is fixed at 104 Hz.
56
56
-**Magnetometer** output data rate is fixed at 20 Hz.
57
57
58
-
If you want to read more about the sensor modules that make up the IMU system, find the datasheet for the <ahref="https://content.arduino.cc/assets/bst-bmi270-ds000.pdf"target="_blank">BMI270</a> and the <ahref="https://content.arduino.cc/assets/bst-bmm150-ds001.pdf"target="_blank">BMM150</a> here.
58
+
If you want to read more about the sensor modules that make up the IMU system, find the datasheet for the [BMI270](https://download.mikroe.com/documents/datasheets/bst-bmi270-ds000-2_datasheet.pdf)and the [BMM150](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmm150-ds001.pdf) here.
59
59
60
60
61
61
### Gyroscope
@@ -72,14 +72,14 @@ In this example, we will use the gyroscope as an indicator for the direction of
72
72
73
73
**1. Setting up**
74
74
75
-
Let's start by opening the [Arduino Web Editor](https://create.arduino.cc/editor), clicking on the **Libraries** tab and searching for the **BMI270_BMM150** library. Then in **> Examples**, open the **SimpleGyroscope** sketch and once it opens, rename it as **Gyroscope**.
75
+
Let's start by opening the [Arduino Cloud Editor](app.arduino.cc), clicking on the **Libraries** tab and searching for the **BMI270_BMM150** library. Then in **> Examples**, open the **SimpleGyroscope** sketch and once it opens, rename it as **Gyroscope**.
76
76
77
-

77
+

78
78
79
79
80
80
**2. Connecting the board**
81
81
82
-
Now, connect the Nano 33 BLE Rev2 to the computer and make sure that the Web Editor recognizes it, if so, the board and port should appear as shown in the image below. If they don't appear, follow the [instructions](https://create.arduino.cc/getting-started/plugin/welcome) to install the plugin that will allow the editor to recognize your board.
82
+
Now, connect the Nano 33 BLE Rev2 to the computer and make sure that the Cloud Editor recognizes it, if so, the board and port should appear as shown in the image below. If they don't appear, follow the [instructions](https://create.arduino.cc/getting-started/plugin/welcome) to install the plugin that will allow the editor to recognize your board.
83
83
84
84
85
85

0 commit comments