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
Copy file name to clipboardExpand all lines: content/hardware/03.nano/boards/nano-33-ble-rev2/datasheet/datasheet.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ All Arduino IoT-enabled products are supported on Arduino IoT Cloud which allows
148
148
149
149
### Sample Sketches
150
150
151
-
Sample sketches for the Nano 33 BLE Rev2 can be found either in the “Examples” menu in the Arduino IDE or in the “Documentation” section of the Arduino Pro website.
151
+
Sample sketches for the Nano 33 BLE Rev2 can be found either in the “Examples” menu in the Arduino IDE or in the “Built-in Examples” section of the Arduino Docs website.
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
+27-34Lines changed: 27 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: 'Learn how to train and use machine learning models with the Arduin
6
6
tags:
7
7
- Machine learning
8
8
- Tensorflow Lite Micro
9
-
author: 'Sandeep Mistry and Dominic Pajak'
9
+
author: 'Sandeep Mistry, Dominic Pajak, and Hannes Siebeneicher'
***This post was originally published by Sandeep Mistry and Dominic Pajak on the [TensorFlow blog](https://medium.com/tensorflow/how-to-get-started-with-machine-learning-on-arduino-7daf95b4157).***
22
+
***This post was originally published by Sandeep Mistry and Dominic Pajak on the [TensorFlow blog](https://medium.com/tensorflow/how-to-get-started-with-machine-learning-on-arduino-7daf95b4157) and uses the Arduino [Nano 33 BLE Sense Rev2](https://store.arduino.cc/products/nano-33-ble-sense-rev2). This revision of the tutorial is adapted to the [Arduino Nano 33 BLE Rev2](store.arduino.cc/products/nano-33-ble-rev2) which comes without a microphone and therefore leaves out the speech recognition.***
23
23
24
24
## Introduction
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
-
[Arduino](https://www.arduino.cc/) is on a mission to make machine learning simple enough for anyone to use. We’ve been working with the TensorFlow Lite team over the past few months and are excited to show you what we’ve been up to together: bringing TensorFlow Lite Micro to the [Arduino Nano 33 BLE Sense Rev2](/hardware/nano-33-ble-sense-rev2). In this article, we’ll show you how to install and run several new [TensorFlow Lite Micro](https://www.tensorflow.org/lite/microcontrollers/overview) examples that are now available in the [Arduino Library Manager](https://www.arduino.cc/en/guide/libraries).
28
+
[Arduino®](https://www.arduino.cc/) is on a mission to make machine learning simple enough for anyone to use. We’ve been working with the TensorFlow Lite team over the past few months and are excited to show you what we’ve been up to together: bringing TensorFlow Lite Micro to the [Arduino Nano 33 BLE Rev2](/hardware/nano-33-ble-rev2). In this article, we’ll show you how to install and run several new [TensorFlow Lite Micro](https://www.tensorflow.org/lite/microcontrollers/overview) examples that are now available in the [Arduino Library Manager](https://www.arduino.cc/en/guide/libraries).
29
29
30
30
The first tutorial below shows you how to install a neural network on your Arduino board to recognize simple voice commands.
31
31
@@ -48,27 +48,27 @@ We’re excited to share some of the first examples and tutorials, and to see wh
48
48
- Use the [BMI270_BMM150](https://www.arduino.cc/reference/en/libraries/arduino_bmi270_bmm150/) and [Arduino_TensorFlowLite](https://github.com/tensorflow/tflite-micro-arduino-examples) libraries
49
49
50
50
## Hardware & Software Needed
51
-
- An [Arduino Nano 33 BLE Sense Rev2](/hardware/nano-33-ble-sense-rev2) board
51
+
- An [Arduino Nano 33 BLE Rev2](/hardware/nano-33-ble-rev2) board
52
52
- A Micro USB cable to connect the Arduino board to your desktop machine
53
53
- To program your board, you can use the [Arduino Web 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
54
54
55
-
The Arduino Nano 33 BLE Sense Rev2 has a variety of onboard sensors meaning potential for some cool TinyML applications:
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
60
- Light – brightness, color and object proximity
61
61
62
-
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.
62
+
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
63
64
-
**Tip: Sensors on a USB stick** – Connecting the BLE Sense board over USB is an easy way to capture data and add multiple sensors to single board computers without the need for additional wiring or hardware – a nice addition to a Raspberry Pi, for example.
64
+
**Tip: Sensors on a USB stick** – Connecting the BLE board over USB is an easy way to capture data and add multiple sensors to single board computers without the need for additional wiring or hardware – a nice addition to a Raspberry Pi, for example.
65
65
66
66
## Microcontrollers and TinyML
67
67
Microcontrollers, such as those used on Arduino boards, are low-cost, single-chip, self-contained computer systems. They’re the invisible computers embedded inside billions of everyday gadgets like wearables, drones, 3D printers, toys, rice cookers, smart plugs, e-scooters, and washing machines. The trend to connect these devices is part of what is referred to as the Internet of Things.
68
68
69
-
Arduino is an open-source platform and community focused on making microcontroller application development accessible to [everyone](https://create.arduino.cc/projecthub). The [board](https://store.arduino.cc/usa/nano-33-ble-sense) 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.
69
+
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
70
71
-

71
+

72
72
73
73
There are practical reasons you might want to squeeze ML on microcontrollers, including:
74
74
@@ -87,27 +87,20 @@ TinyML is an emerging field and there is still work to do – but what’s excit
87
87
88
88
## TensorFlow Lite for Microcontrollers Examples
89
89
90
-
***The TensorFlow Lite examples are currently not compatible with the [Arduino Nano BLE Sense Rev2](/hardware/nano-33-ble-sense-rev2) board.***
90
+
***The TensorFlow Lite examples are currently not compatible with the [Arduino Nano BLE Rev2](/hardware/nano-33-ble-rev2) board.***
91
91
92
92
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
93
94
-
- micro_speech – speech recognition using the onboard microphone
95
94
- magic_wand – gesture recognition using the onboard IMU
96
-
- person_detection – person detection using an external ArduCam camera
95
+
- person_detection – person detection using an external ArduCam® camera
97
96
98
-
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. In the next section, we’ll discuss training.
97
+
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.
99
98
100
-
## How to Run the Examples Using Arduino Create Web Editor.
101
-
Once you connect your Arduino Nano 33 BLE Sense 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 [Arduino Create](https://create.arduino.cc/editor) web editor:
99
+
## How to Run the Examples Using Arduino Web Editor
102
100
103
-

104
-
105
-
## Focus On The Speech Recognition Example
106
-
One of the first steps with an Arduino board is getting the LED to flash. Here, we’ll do it with a twist by using TensorFlow Lite Micro to recognize voice keywords. It has a simple vocabulary of “yes” and “no.” Remember this model is running locally on a microcontroller with only 256 KB of RAM, so don’t expect commercial ‘voice assistant’ level accuracy – it has no Internet connection and on the order of 2000x less local RAM available.
107
-
108
-
Note the board can be battery-powered as well. As the Arduino can be connected to motors, actuators and more this offers the potential for voice-controlled projects.
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 [Web Editor](https://create.arduino.cc/editor):
109
102
110
-

103
+

111
104
112
105
## How To Run The Examples Using the Arduino IDE
113
106
@@ -117,17 +110,17 @@ First, follow the instructions in the next section Setting up the Arduino IDE.
117
110
118
111
In the Arduino IDE, you will see the examples available via the **File > Examples > Arduino_TensorFlowLite** menu in the ArduinoIDE.
119
112
120
-
Select an example and the sketch will open. To compile, upload and run the examples on the board and click the arrow icon:
113
+
Select an example and the sketch will open. To compile, upload and run the examples on the board click the arrow icon:
121
114
122
115

123
116
124
117
## Training a TensorFlow Lite Micro Model For Arduino
125
118
126
-

119
+

127
120
128
-
Next we will use ML to enable the Arduino board to recognize gestures. We’ll capture motion data from the Arduino Nano 33 BLE Sense Rev2 board, import it into TensorFlow to train a model, and deploy the resulting classifier onto the board.
121
+
Next, we will use ML to enable the Arduino board to recognize gestures. We’ll capture motion data from the Arduino Nano 33 BLE Rev2 board, import it into TensorFlow to train a model, and deploy the resulting classifier onto the board.
129
122
130
-
The idea for this tutorial was based on Charlie Gerard’s awesome [Play Street Fighter with body movements using Arduino and Tensorflow.js](https://medium.com/@devdevcharlie/play-street-fighter-with-body-movements-using-arduino-and-tensorflow-js-6b0e4734e118). In Charlie’s example, the board is streaming all sensor data from the Arduino to another machine which performs the gesture classification in Tensorflow.js. We take this further and “TinyML-ify” it by performing gesture classification on the Arduino board itself. This is made easier in our case as the Arduino Nano 33 BLE Sense Rev2 board we’re using has a more powerful Arm Cortex-M4 processor and an onboard IMU.
123
+
The idea for this tutorial was based on Charlie Gerard’s awesome [Play Street Fighter with body movements using Arduino and Tensorflow.js](https://medium.com/@devdevcharlie/play-street-fighter-with-body-movements-using-arduino-and-tensorflow-js-6b0e4734e118). In Charlie’s example, the board is streaming all sensor data from the Arduino board to another machine which performs the gesture classification in Tensorflow.js. We take this further and “TinyML-ify” it by performing gesture classification on the Arduino board itself. This is made easier in our case as the Arduino Nano 33 BLE Rev2 board we’re using has a more powerful Arm® Cortex®-M4 processor and an onboard IMU.
131
124
132
125
We’ve adapted the tutorial below, so no additional hardware is needed – the sampling starts once movement is detected. The original version of the tutorial adds a breadboard and a hardware button to press to trigger sampling. If you want to get into a little hardware, you can follow that version [instead](https://github.com/sandeepmistry/aimldevfest-workshop-2019).
133
126
@@ -141,22 +134,22 @@ We’ve adapted the tutorial below, so no additional hardware is needed – the
141
134
142
135

143
136
144
-
There are more detailed [Getting Started](https://www.arduino.cc/en/Guide/NANO33BLESense) and [Troubleshooting](https://support.arduino.cc/hc/en-us) guides on the Arduino site if you need help.
137
+
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.
145
138
146
139
## Streaming Sensor Data From the Arduino Board
147
140
148
141
First, we need to capture some training data. You can capture sensor data logs from the Arduino board over the same USB cable you use to program the board with your laptop or PC.
149
142
150
-
Arduino boards run small applications (also called sketches) which are compiled from .ino format Arduino source code, and programmed onto the board using the Arduino IDE or Arduino Create.
143
+
Arduino boards run small applications (also called sketches) which are compiled from .ino format Arduino source code, and programmed onto the board using the Arduino IDE or Web Editor.
151
144
152
145
With the sketch we are creating we will do the following:
153
146
154
147
- Monitor the board’s accelerometer and gyroscope
155
148
- Trigger a sample window on detecting significant linear acceleration of the board
156
-
- Sample for one second at 119Hz, outputting CSV format data over USB
149
+
- Sample for one second at 119 Hz, outputting CSV format data over USB
157
150
- Loop back and monitor for the next gesture
158
151
159
-
**The sensors we choose to read from the board, the sample rate, the trigger threshold, and whether we stream data output as CSV, JSON, binary or some other format are all customizable in the sketch running on the Arduino. There is also scope to perform signal preprocessing and filtering on the device before the data is output to the log – this we can cover in another blog. For now, you can just upload the sketch and get a sampling.**
152
+
**The sensors we choose to read from the board, the sample rate, the trigger threshold, and whether we stream data output as CSV, JSON, binary or some other format are all customizable in the sketch running on the Arduino board. There is also scope to perform signal preprocessing and filtering on the device before the data is output to the log – this we can cover in another blog. For now, you can just upload the sketch and get a sampling.**
160
153
161
154
The complete sketch can be found below:
162
155
@@ -168,9 +161,9 @@ The complete sketch can be found below:
168
161
when the significant motion is detected.
169
162
You can also use the Serial Plotter to graph the data.
170
163
The circuit:
171
-
- Arduino Nano 33 BLE or Arduino Nano 33 BLE Sense Rev2 board.
164
+
- Arduino Nano 33 BLE Rev2 board.
172
165
Created by Don Coleman, Sandeep Mistry
173
-
Modified by Dominic Pajak, Sandeep Mistry
166
+
Modified by Dominic Pajak, Sandeep Mistry, Hannes Siebeneicher
174
167
This example code is in the public domain.
175
168
*/
176
169
@@ -284,7 +277,7 @@ To capture data as a CSV log to upload to TensorFlow, you can use **Arduino IDE
284
277
285
278

286
279
287
-
***Linux tip:****If you prefer you can redirect the sensor log output from the Arduino straight to .csv file on the command line. With the Serial Plotter / Serial MOnitor windows close use:
280
+
***Linux tip:****If you prefer you can redirect the sensor log output from the Arduino board straight to .csv file on the command line. With the Serial Plotter / Serial MOnitor windows close use:
288
281
```
289
282
$ cat /dev/cu.usbmodem[nnnnn] > sensorlog.csv
290
283
```
@@ -322,7 +315,7 @@ We will be starting a new sketch, you will find the complete code below:
322
315
discouraged in Arduino examples, and in the future the TensorFlowLite library
323
316
might change to make the sketch simpler.
324
317
The circuit:
325
-
- Arduino Nano 33 BLE or Arduino Nano 33 BLE Sense Rev2 board.
0 commit comments