Skip to content

Commit 7ab9bb8

Browse files
committed
aiotdevfest
1 parent f5cc54e commit 7ab9bb8

17 files changed

+40
-28
lines changed

README.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# TinyML Application Development for Everyone
22

3-
<a href="https://armsummit.bemyapp.com"><img src="aiot-logo.png" alt="AIoT Dev Summit Logo"></a>
3+
<a href="https://aiotdevfest.org"><img src="exercises/images/AI-IOT-devfest-AZ-2020-horiz.png" alt="AIoT Devfest Logo" width="40%" style="padding-right:100px"></a>&nbsp;<a href="https://store.arduino.cc/arduino-nano-33-ble"><img src="exercises/images/nano-33-ble_iso.jpg" alt="Arduino Nano 33 BLE board" width="40%"></a>
44

5-
## Hands-on workshop at Arm AIoT Dev Summit December 2019
5+
## Hands-on workshop at AIoT Devfest January 2020
66

7-
In this tutorial we will teach a board to recognise gestures! We'll capture motion data from the [Arduino Nano 33 BLE Sense](https://store.arduino.cc/arduino-nano-33-ble-sense) board, import it into TensorFlow to train a model, and deploy a classifier onto the board using [TensorFlow Lite for microcontrollers](https://www.tensorflow.org/lite/microcontrollers/overview).
7+
In this workshop we will teach an Arduino board to recognize gestures! We will capture motion data from the [Arduino Nano 33 BLE](https://store.arduino.cc/arduino-nano-33-ble) board<sup>[1](#note1)</sup>, import it into TensorFlow to train a model, and deploy a classifier onto the board using [TensorFlow Lite for microcontrollers](https://www.tensorflow.org/lite/microcontrollers/overview).
8+
9+
The hardware for this workshop has been provided by [Arduino](https://arduino.cc)
810

911
## Exercises
1012

@@ -20,4 +22,15 @@ In this tutorial we will teach a board to recognise gestures! We'll capture moti
2022
* [Exercise 9: Gesture Controlled USB Emoji Keyboard](exercises/exercise9.md)
2123
* [Exercise 10: Next Steps](exercises/exercise10.md)
2224

25+
This workshop material was developed by Sandeep Mistry and Don Coleman.
26+
27+
<a href="https://arduino.cc"><img src="exercises/images/Arduino_logo_R_highquality.png" alt="Arduino Logo" width=30%><a/>
28+
<a href="https://chariotsolutions.com"><img src="exercises/images/ChariotSolutions.png" alt="Chariot Solutions Logo" width=30%></a>
29+
30+
Previous versions
31+
* https://github.com/sandeepmistry/aimldevfest-workshop-2019
32+
* https://github.com/arduino/AIoT-Dev-Summit-2019
33+
34+
<!-- TODO link to SLIDES -->
2335

36+
<a id="note1">1</a>: You can also use the [Arduino Nano 33 BLE Sense](https://store.arduino.cc/arduino-nano-33-ble-sense) for this workshop.

aiot-logo.png

-41.8 KB
Binary file not shown.

arduino_tinyml_workshop.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
"colab_type": "text"
2222
},
2323
"source": [
24-
"<a href=\"https://www.arduino.cc/\"><img src=\"https://raw.githubusercontent.com/sandeepmistry/aimldevfest-workshop-2019/master/images/Arduino_logo_R_highquality.png\" width=200/></a>\n",
25-
"# Tiny ML on Arduino\n",
24+
"<a href=\"https://www.arduino.cc/\"><img src=\"https://raw.githubusercontent.com/don/tinyml-workshop/master/exercises/images/AI-IOT-devfest-AZ-2020-horiz.png\" width=200/></a>\n",
25+
"# TinyML on Arduino\n",
2626
"## Gesture recognition tutorial\n",
2727
" * Sandeep Mistry - Arduino\n",
2828
" * Don Coleman - Chariot Solutions\n",
2929
"\n",
3030
" \n",
31-
"https://github.com/arduino/ArduinoTensorFlowLiteTutorials/"
31+
"https://github.com/don/tinyml-workshop/"
3232
]
3333
},
3434
{
@@ -510,7 +510,7 @@
510510
"source": [
511511
"## Encode the Model in an Arduino Header File \n",
512512
"\n",
513-
"The next cell creates a constant byte array that contains the TFlite model. Import it as a tab with the sketch below."
513+
"The next cell creates a constant byte array that contains the TFlite model. Import the generated model.h file as a tab into your Arduino sketch."
514514
]
515515
},
516516
{
@@ -521,9 +521,9 @@
521521
"colab": {}
522522
},
523523
"source": [
524-
"!echo \"const unsigned char model[] = {\" > /content/model.h\n",
525-
"!cat gesture_model.tflite | xxd -i >> /content/model.h\n",
526-
"!echo \"};\" >> /content/model.h\n",
524+
"!echo \"const unsigned char model[] __attribute__((aligned(4))) = {\" > /content/model.h\n",
525+
"!cat gesture_model.tflite | xxd -i >> /content/model.h\n",
526+
"!echo \"};\" >> /content/model.h\n",
527527
"\n",
528528
"import os\n",
529529
"model_h_size = os.path.getsize(\"model.h\")\n",

exercises/exercise10.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Now that you have things working, here are a few new things to try.
44

55
- Add some more gestures to go with the :punch: and :flex:
66

7-
1. Load the IMU_Capture sketch on your Arduino Nano 33 BLE Sense.
7+
1. Load the IMU_Capture sketch on your Arduino Nano 33 BLE
88
1. Caputure some additional gestures for a new emoji. Perhaps a :smile:, :thumbsup:, :clap:, or :wave:
99
1. Load the new CSV files into your Colab model
10-
1. Put the trained model back on your Nano 33 BLE Sense.
10+
1. Put the trained model back on your Nano 33 BLE
1111

1212
- Try increasing and decreasing the number of recordings per gesture, how does this impact performance?
1313

@@ -19,6 +19,7 @@ Now that you have things working, here are a few new things to try.
1919

2020
- Check out the examples in the [TensorFlow Lite Getting Started Guide](https://www.tensorflow.org/lite/microcontrollers/get_started)
2121

22+
<!--
2223
- Try the [Arudino Fruit to Emoji](https://github.com/arduino/ArduinoTensorFlowLiteTutorials/tree/master/FruitToEmoji) Tutorial
23-
24+
-->
2425
- Grab the [TinyML book](http://shop.oreilly.com/product/0636920254508.do) to continue at home

exercises/exercise2.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Exercise 2: Source Code
22

3-
The [source code](https://github.com/arduino/AIoT-Dev-Summit-2019) for this workshop is available on Github in the Arduino organizaton.
3+
The source code and documentation for this workshop available on Github. The code is in the [ArduinoSketches](../ArduinoSketches) folder.
44

55
If you're familiar with git and Github, clone the repository to your computer. If that last sentence didn't make sense to you, we recommend that you download the code.
66

7-
1. Go to https://github.com/arduino/AIoT-Dev-Summit-2019
7+
1. Go to https://github.com/don/tinyml-workshop
88
1. Click the green **Clone or download** button
99
1. Choose Download ZIP
1010
1. Go to your downloads folder and extract all the files from the zip archive

exercises/exercise3.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Exercise 3: Hardware
22

3-
![Picture of Arduino Nano 33 BLE Sense board](images/ble-sense.jpg)
3+
![Picture of Arduino Nano 33 BLE board](images/nano-33-ble.jpg)
44

55
## Unboxing and set up
66

7-
1. Remove the Arduino Nano 33 BLE Sense board from the box
7+
1. Remove the Arduino Nano 33 BLE board from the box
88
1. Plug the micro USB cable into the board and your computer
99
1. Open the Arduino IDE application on your computer
1010
1. Choose the board `Tools -> Board -> Arduino Nano 33 BLE`
@@ -21,7 +21,7 @@
2121
1. Open the serial monitor `Tools -> Serial Monitor` to see debug messages
2222
1. If everything is working properly, the LED will start blinking quickly
2323

24-
__NOTE:__ The first time you upload a sketch to the Arduino Nano 33 BLE Sense, the USB port name might change. If this happens, you need to re-select the port using the `Tools -> Port` menu.
24+
__NOTE:__ The first time you upload a sketch to the Arduino Nano 33 BLE, the USB port name might change. If this happens, you need to re-select the port using the `Tools -> Port` menu.
2525

2626
Next [Exercise 4: Visualize the IMU Data](exercise4.md)
2727

exercises/exercise4.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The next step is to use an Arduino program you downloaded in [Exercise 2](exercise2.md) to capture motion data from the IMU.
44

5-
1. Open __AIoT-Dev-Summit-2019/ArduinoSketches/IMU_Capture/IMU_Capture.ino__ in the Arduino IDE.
5+
1. Open __tinyml-workshop/ArduinoSketches/IMU_Capture/IMU_Capture.ino__ in the Arduino IDE.
66
1. Compile the sketch and upload it to the board: `Sketch -> Upload`
77
1. Open the Serial Monitor: `Tools -> Serial Monitor`
88
1. Shake the board. The change in acceleration will start recording data from the IMU in the Serial Monitor

exercises/exercise6.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can enable 3rd party cookies, or better yet, add an exception for `[*.]googl
1818

1919
Open the [arduino_tinyml_workshop.ipynb](../arduino_tinyml_workshop.ipynb) notebook in Google Colab and follow the instructions in the notebook to prepare the data and train the model.
2020

21-
https://colab.research.google.com/github/arduino/AIoT-Dev-Summit-2019/blob/master/arduino_tinyml_workshop.ipynb
21+
https://colab.research.google.com/github/don/tinyml-workshop/blob/master/arduino_tinyml_workshop.ipynb
2222

2323

2424
Next [Exercise 7: Classifying IMU Data](exercise7.md)

exercises/exercise7.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Exercise 7: Classifying IMU Data
22

3-
1. Open __AIoT-Dev-Summit-2019/ArduinoSketches/IMU_Classifier/IMU_Classifier.ino__ in the Arduino IDE.
3+
1. Open __tinyml-workshop/ArduinoSketches/IMU_Classifier/IMU_Classifier.ino__ in the Arduino IDE.
44
1. Switch to the model.h tab
55
1. Replace the contents of model.h with the version you downloaded from Colab
66
1. Upload the sketch: `Sketch -> Upload`

exercises/exercise8.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Now that we the code can recognize gestures, let's try printing out some emojis in addition to the text.
66

7-
Open __AIoT-Dev-Summit-2019/ArduinoSketches/IMU_Classifier/IMU_Classifier.ino__ in the Arduino IDE if it's not already loaded.
7+
Open __tinyml-workshop/ArduinoSketches/IMU_Classifier/IMU_Classifier.ino__ in the Arduino IDE if it's not already loaded.
88

99
Create a new char* array named `EMOJIS`. Inside the array defines the emojis as a UTF-8 encoded unicode strings. This array must be the same length at the `GESTURE` array. The order of the emojis in the array must match the order of the gestures.
1010

exercises/exercise9.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ Now you are ready to build a keyboard. Create a new sketch in the Arduino IDE. C
3333

3434
### Note
3535

36-
__NOTE:__ once you load code that runs the USB Keyboard, the Arduino IDE might not be able to see the serial port when you want to load new code. Double click the reset button on the Nano 33 BLE Sense before you run __Sketch -> Upload__.
36+
__NOTE:__ once you load code that runs the USB Keyboard, the Arduino IDE might not be able to see the serial port when you want to load new code. Double click the reset button on the Nano 33 BLE before you run __Sketch -> Upload__.
3737

3838
Next [Exercise 10: Next Steps](exercise10.md)
Loading

exercises/images/ChariotSolutions.png

23.9 KB
Loading
-8.83 KB
Loading

exercises/images/nano-33-ble.jpg

114 KB
Loading

exercises/images/nano-33-ble_iso.jpg

131 KB
Loading

exercises/intro.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ What you know -> | Supervised Learning | -> What you want to know
8080

8181
Running ML models on microcontrollers. Low power, below 1 mW.
8282

83-
## Arduino Nano 33 BLE Sense board
83+
## Arduino Nano 33 BLE board
8484

8585
Based on the Nordic nRF52840
8686
* Arm Cortex-M4F running at 64 MHz
@@ -90,8 +90,8 @@ Based on the Nordic nRF52840
9090

9191
Onboard Sensors
9292
* IMU (measure motion: acceleration, gyro)
93-
* Temperature, pressure, humidity, light, color
94-
* PDM microphone
93+
94+
This workshop also works on the Arduino Nano 33 BLE Sense board. The Sense version of the board adds additional sensors: temperature, pressure, humidity, light, color, PDM microphone.
9595

9696
## What is an IMU?
9797

@@ -105,7 +105,6 @@ This board uses the ST Micro LSM9DS1.
105105

106106
We're only using the accelerometer and gyroscope for this project.
107107

108-
109108
## Workshop
110109

111110
* Record IMU data
@@ -124,7 +123,6 @@ We're only using the accelerometer and gyroscope for this project.
124123

125124
## IMU input data
126125

127-
128126
The Arduino library enables the sensor to report 119 data points every second, this means a new set of data is received every 8.4ms
129127

130128

0 commit comments

Comments
 (0)