Posts | Comments

Planet Arduino

Archive for the ‘Announcements’ Category

During Bett Show 2020, Arduino will launch the Arduino Education learning evolution: four new STEAM products for students in lower secondary school through to university. Arduino Education will also announce a partnership with the Fraunhofer Initiative: “Roberta – Learning with Robots” in Germany.

Arduino Education‘s latest products — CTC GO! Motions Expansion Pack, Engineering Kit Rev2, Arduino Education Starter Kit, and IoT Starter Kit — will be unveiled at Bett and available in Q1. These new products complement the existing portfolio, which includes the Science Kit, CTC GO!, CTC 101, Arduino Starter Kit, and Certification program.

Arduino CEO Fabio Violante comments: “We are delighted to announce four new products which will expand STEAM learning for lower secondary to university students. Our technology, programming, and curriculum content are creative tools just like brushes and paint that students can use as they become part of our next generation of scientists and artists.”

CTC GO! Motions Expansion Pack (Age: 14+)

Build on your secondary school students’ STEAM knowledge with more complex programming concepts that develop computational thinking and 21st-century skills.

For educators who have taken their students through the CTC GO! – Core Module, the Motions Expansion Pack builds on what they have already learned about how to use technology as a tool and how to apply that knowledge in the real world. The Motions Expansion Pack challenges students to go a step further in computing and design while introducing them to motors and transmission mechanisms such as pulleys and gear concepts that develop their logical reasoning, hands-on building skills, and problem-solving skills. Educators get all the teaching support they need with webinars, videos, guides, and direct contact with an expert.

Engineering Kit Rev2 (Age: 17+)

Challenge upper secondary school and university students and help them develop hands-on engineering skills.

Educators can challenge engineering students and help them develop physical engineering skills with the Arduino Engineering Kit Rev2. Featuring cutting-edge technology, the kit is a practical, hands-on tool that demonstrates key concepts, core aspects of mechatronics, and MATLAB and Simulink programming. Developed in partnership with MathWorks, The Engineering Kit Rev2 is ideal for advanced high school and college students, the three projects teach the basics of engineering — plus they’re fun to do! 

Education Starter Kit (Age: 11+)

Learn electronics and get started with programming in your classroom step-by-step — no experience necessary!

Educators can teach lower secondary school students the basics of programming, coding, and electronics. No prior knowledge or experience is necessary as the kits guide educators through step-by-step, they are well-supported with teacher guides, and lessons can be paced according to students’ abilities. The kit can be integrated throughout the curriculum, giving students the opportunity to become confident in programming and electronics with guided sessions and open experimentation. They’ll also learn vital 21st-century skills such as collaboration and problem-solving.

IoT Starter Kit (Age: 14+)

The first step into the world of connected objects has never been easier. 

Advanced secondary school and university students can get started with the Internet of Things quickly and easily. They’ll learn about using sensors; automation; logging, graphing and analyzing sensor data, and triggering events with serious technology made simple. The kit contains step-by-step tutorials for ten different projects – fun, creative experiments using real-life sensors.

In partnership with the Fraunhofer Initiative: “Roberta – Learning with Robots”

The dream team for classrooms worldwide: Arduino Education has officially partnered up with the Fraunhofer Initiative “Roberta – Learning with Robots.” The Arduino Uno WiFi Rev2 board, part of Arduino CTC GO!, joined the Open Roberta Lab, the biggest open-source coding platform developed in Europe.

The Arduino Uno WiFi Rev2 is the fourth Arduino board to be integrated into the Open Roberta Lab, which currently supports 13 robots and microcontrollers that enable children worldwide to adopt a playful approach to coding. The lab is the technological component of the Roberta Initiative, which was started by Fraunhofer IAIS in 2002. Eighteen years’ experience in STEM education, training teachers, and developing materials as well as launching the Open Roberta Lab in 2014 make Roberta a one-of-a-kind initiative in Germany and beyond, and the perfect partner for Arduino Education.

“Fraunhofer offers guaranteed quality, both on the technical level as well as for community support,” says Arduino CTO David Cuartielles. “There are a lot of synergies in our cooperation. Roberta is really meant for teachers to learn how to teach technology, and that’s also a key part of Arduino Education’s mission.”

“Open Roberta is developed as an open source platform to engage a community worldwide to join our mission. As a popular open source electronics platform, Arduino is the perfect match for us as it also motivates people all over the world to develop their own ideas and move from using to creating technology,” adds Thorsten Leimbach, head of business unit “Smart Coding and Learning” and Roberta manager at Fraunhofer IAIS.

Dream team for classrooms worldwide: Arduino Uno WiFi Rev2 for CTC GO! joins Open Roberta Lab, the biggest open source coding platform made in Europe.

The Arduino Uno WiFi Rev2 is the fourth Arduino board to be integrated into the Open Roberta Lab, which is currently supporting a total of 13 robots and microcontrollers to enable children worldwide to adopt a playful approach to coding. By “dragging and dropping” the colorful programming blocks called “NEPO” hundreds of thousands of users worldwide from more than 100 countries per year create their own programs to make their hardware come to life.

“Fraunhofer offers guaranteed quality, both on the technical level as well as for community support,” says Arduino CTO David Cuartielles. “There are a lot of synergies in our cooperation. Roberta is really meant for teachers to learn how to teach technology which is a key part of the Arduino Education’s mission.”

The CTC GO! – Core Module containing eight Arduino Uno WiFi Rev2 is supporting the joint mission of Open Roberta and Arduino in providing teachers with a getting started program including eight lessons, eight guided projects, and six self-guided projects that teach students how to use electronics and introduces them to programming and coding. The lessons increase in difficulty from the very basics all the way through to learning different programming capabilities and building circuits for different sensors and actuators. During the self-guided projects, students practice building structures and applying the knowledge acquired in the hands-on lessons to develop their critical thinking, creativity and problem solving skills in a collaborative manner.”

Arduino first joined Open Roberta in 2018, when the microcontrollers Arduino Uno, Nano, and Mega were integrated into the Open Roberta Lab. The lab is the technological component of the Roberta initiative, which was started by Fraunhofer IAIS in 2002. 18 years of experience in STEM education, training teachers and developing materials as well as launching the Open Roberta Lab in 2014 make Roberta a one of a kind initiative in Germany and beyond.

For enthusiasts, the Fundamentals Exam is the first tier in the Arduino Certification Program (ACP), designed to test entrants knowledge in Arduino-related electronics, programming, and physical computing.

The exam is available for everyone interested in officially certifying their skills and knowledge on Arduino, that could, for example, be referred to in a resume for academic or professional purposes.

Get your students, colleagues and friends certified!

The Fundamentals Exam is now also open to schools, academic institutions, universities, and companies that are interested in getting their students and employees officially certified!

The Fundamentals Certification offers the right balance of academic excellence and real world skills to give students the confidence and motivation they need to succeed both in educational and professional environments.

It is a great opportunity for companies who are interested in certifying their employees to refresh and add new skills to their repertoire.

Want to learn more? Additional information can be found here.

El examen de Certificación Fundamentals, está ahora disponible en Español e Italiano

Para entusiastas, el examen de Certificación Fundamentals, es el primer nivel del Programa de certificación Arduino (ACP), diseñado para evaluar el conocimiento de los participantes en electrónica, programación y computación física relacionadas con Arduino.

El examen está disponible para todos los interesados ??en certificar oficialmente sus habilidades y conocimientos en Arduino, que podrían, por ejemplo, mencionarse en un currículum con fines académicos o profesionales.

¡Certifica a tus estudiantes, colegas y equipo de trabajo!

La certificación también está disponible para escuelas, instituciones académicas, universidades y empresas que estén interesadas en certificar oficialmente a sus estudiantes y equipo de trabajo.

La Certificación Fundamentals ofrece el equilibrio adecuado entre excelencia académica y habilidades del mundo real, para brindar a los estudiantes la confianza y la motivación que necesitan para tener éxito tanto en entornos académicos como profesionales.

También es una gran posibilidad para compañías que están interesadas en certificar a su equipo de trabajo para actualizar y agregar nuevas habilidades a su repertorio.

Para saber más visita: https://store.arduino.cc/digital/cert_fundamentals.

Siamo lieti di annunciare che l’esame per la certificazione Arduino Fundamentals è da adesso disponibile anche in spagnolo e italiano! 

Desideriamo rendere accessibile la Certificazione alle scuole, alle istitutuzioni, università e aziende che siano interessate a certificare ufficialmente i propri studenti e dipendenti! La certificazione Arduino Fundamentals offre il giusto equilibrio fra l’acquisizione di abilità accademiche e lavorative, fornendo agli studenti la sicurezza e la motivazione necessarie per riuscire nel mondo accademico e professionale. E’ inoltre un increndibile possibilità per le aziende interessate ad aggionarne, migliorare e/o accrescere le capacità dei propri dipendenti.

Per saperne di più, visitate: https://store.arduino.cc/digital/cert_fundamentals.

We’re kicking off this year’s CES with some big news.

Millions of users and thousands of companies across the world already use Arduino as an innovation platform, which is why we have drawn on this experience to enable enterprises to quickly and securely connect remote sensors to business logic within one simple IoT application development platform: a new solution for professionals in traditional sectors aspiring for digital transformation through IoT. 

Combining a low-code application development platform with modular hardware makes tangible results possible in just one day. This means companies can build, measure, and iterate without expensive consultants or lengthy integration projects.

Built on ARM Pelion technology, the latest generation of Arduino solutions brings users simplicity of integration and a scalable, secure, professionally supported service. 

By combining the power and flexibility of our production ready IoT hardware with our secure, scalable and easy to integrate cloud services we are putting in the hands of our customers something really disruptive,” commented Arduino CEO Fabio Violante. “Among the millions of Arduino customers, we’ve even seen numerous businesses transform from traditional ‘one off’ selling to subscription-based service models, creating new IoT-based revenue streams with Arduino as the enabler. The availability of a huge community of developers with Arduino skills is also an important plus and gives them the confidence to invest in our technology”.  

But that’s not all. At CES 2020, we are also excited to announce the powerful, low-power new Arduino Portenta family. Designed for demanding industrial applications, AI edge processing and robotics, it features a new standard for open high-density interconnect to support advanced peripherals. The first member of the family is the Arduino Portenta H7 module – a dual-core Arm Cortex-M7 and Cortex-M4 running at 480MHz and 240MHz, respectively, with industrial temperature-range (-40 to 85°C) components. The Portenta H7 is capable of running Arduino code, Python and JavaScript, making it accessible to an even broader audience of developers.

The new Arduino Portenta H7 is now available for pre-order on the Arduino online store, with an estimated delivery date of late February 2020.

We’re kicking off this year’s CES with some big news.

Millions of users and thousands of companies across the world already use Arduino as an innovation platform, which is why we have drawn on this experience to enable enterprises to quickly and securely connect remote sensors to business logic within one simple IoT application development platform: a new solution for professionals in traditional sectors aspiring for digital transformation through IoT. 

Combining a low-code application development platform with modular hardware makes tangible results possible in just one day. This means companies can build, measure, and iterate without expensive consultants or lengthy integration projects.

Built on ARM Pelion technology, the latest generation of Arduino solutions brings users simplicity of integration and a scalable, secure, professionally supported service. 

By combining the power and flexibility of our production ready IoT hardware with our secure, scalable and easy to integrate cloud services we are putting in the hands of our customers something really disruptive,” commented Arduino CEO Fabio Violante. “Among the millions of Arduino customers, we’ve even seen numerous businesses transform from traditional ‘one off’ selling to subscription-based service models, creating new IoT-based revenue streams with Arduino as the enabler. The availability of a huge community of developers with Arduino skills is also an important plus and gives them the confidence to invest in our technology”.  

But that’s not all. At CES 2020, we are also excited to announce the powerful, low-power new Arduino Portenta family. Designed for demanding industrial applications, AI edge processing and robotics, it features a new standard for open high-density interconnect to support advanced peripherals. The first member of the family is the Arduino Portenta H7 module – a dual-core Arm Cortex-M7 and Cortex-M4 running at 480MHz and 240MHz, respectively, with industrial temperature-range (-40 to 85°C) components. The Portenta H7 is capable of running Arduino code, Python and JavaScript, making it accessible to an even broader audience of developers.

The new Arduino Portenta H7 is now available for pre-order on the Arduino online store, with an estimated delivery date of late February 2020.

Our dev team is about to head out for holiday break, but not without sharing some exciting news first: the release of arduino-cli 0.7.0!

Highlights include:

  • Notarization compliance for macOS
  • Some breaking changes:
    • Remove Sketchbook concept, introduce user data folder
    • “lib list” now returns an empty JSON array when there are no libraries installed
    • Change configuration file format
    • Terminate daemon command when parent process exits; added “–daemonize” flag to keep old behavior
  • Added a lot of bugfixing and minor features

The latest version will be available on the other distribution channels (i.e. Homebrew) in the coming days. Stay tuned!

We’re excited to announce the launch of the official Arduino Amazon Alexa Skill. 

You can now securely connect Alexa to your Arduino IoT Cloud projects with no additional coding required. You could use Alexa to turn on the lights in the living room, check the temperature in the bedroom, start the coffee machine, check on your plants, find out if your dog is sleeping in the doghouse… the only limit is your imagination! 

Below are some of the features that will be available:

  • Changing the color and the luminosity of lights
  • Retrieving temperature and detect motion activity from sensors
  • Using voice commands to trigger switches and smart plugs

Being compatible with one of the most recognized cloud-based services on the market, bridges the communication gap between different applications and processes, and removes many tricky aspects that usually follows wireless connectivity and communication.

Using Alexa is as simple as asking a question — just ask, and Alexa will respond instantly. 

Integrating Arduino with Alexa is as quick and easy as these four simple steps:

1. Add the Arduino IoT Cloud Smart Home skill.

2. Link your Arduino Create account with Alexa.

3. Once linked, go to the device tab in the Alexa app and start searching for devices.

4. The properties you created in the Arduino IoT Cloud now appear as devices!

Boom — you can now start voice controlling your Arduino project with Alexa!

IoT – secure connections

The launch of the Arduino IoT Cloud & Alexa integration brings easy cross platform communication, customisable user interfaces and reduced complexity when it comes to programming. These features will allow many different types of users to benefit from this service, where they can create anything from voice controlled light dimmers to plant waterers. 

While creating IoT applications is a lot of fun, one of the main concerns regarding IoT is data security. Arduino IoT Cloud was designed to have security as a priority, so our compatible boards come with an ECC508 crypto chip, ensuring that your data and connections remain secure and private to the highest standard. 

The latest update to the Arduino IoT Cloud enables users with a Create Maker Plan subscription to use devices based on the popular ESP8266, such as NodeMCU and ESPduino. While these devices do not implement a crypto chip, the data transferred over SSL is still encrypted. 

Getting started with this integration

In order to get started with Alexa, you need to go through a few simple steps to make things work smoothly:

  • Setting up your Arduino IoT Cloud workspace with your Arduino Create account
  • Getting an IoT Cloud compatible board
  • Installing the Arduino Alexa Skill

Setting up the Arduino IoT Cloud workspace

Getting started with the Arduino IoT Cloud is fast and easy, and by following this tutorial you will get a detailed run through of the different functionalities and try out some of the examples! Please note, you will need an Arduino Create account in order to use the Arduino IoT Cloud and a compatible board.

Getting an IoT Cloud compatible board

The Arduino IoT Cloud currently supports the following Arduino boards: MKR 1000, MKR WiFi 1010, MKR GSM 1400 and Nano 33 IoT. You can find and purchase these boards from our store

The following properties in the Arduino IoT Cloud can currently be used with Alexa:

  • Light
  • Dimmable light
  • Colored light
  • Smart plug
  • Smart switch
  • Contact sensor
  • Temperature sensor
  • Motion sensor

Any of these properties can be created in the Arduino IoT Cloud platform. A sketch will be generated automatically to read and set these properties.

Installing the Arduino Alexa Skill

To install the Arduino Alexa Skill, you will need to have an Amazon account and download the latest version of the Alexa app on a smartphone or tablet, or use the Amazon Web application. You can find the link to the Amazon Alexa app here. Once we are successfully logged into the app, it is time to make the magic happen. 


To integrate Alexa and Arduino IoT Cloud, you need to add the Arduino skill. Then link your Arduino Create account with Alexa. Once linked, select the device tab in the Alexa app and start discovering devices.

The smart home properties already in existence in the Arduino IoT Cloud now appear as devices, and you can start controlling them with the Alexa app or your voice!

For more information, please visit the Arduino Alexa Skill.

Step-by-step guide to connecting Arduino IoT Cloud with Alexa

 A simple and complete step-by-step guide showing you how to connect the Arduino IoT Cloud with Alexa, is available via this tutorial.

Share your creativity with us!

Community is everything for Arduino, so we would love to see what you create! Make sure you document and share your amazing projects for example on Arduino Project Hub and use the #ArduinoAlexa hashtag to make it discoverable by everyone! 

With the latest release of Arduino IoT Cloud (version 0.8.0) we did a lot of work behind the scenes, and while it might be transparent to most users, it introduced some big changes. But the one we’re most excited about is that the Arduino IoT Cloud has begun supporting a number of third party devices.

Starting  with the uber-popular ESP8266 by Espressif — NodeMCU, Sparkfun’s ESP Thing, ESPDuino, and Wemos (to name a few) — along with other inexpensive commercially available plugs and switches based on this module. You can now add one to your Cloud Thing and control it using our intuitive web-based Dashboard.

Like every new release, there were plenty of obstacles to get around, especially providing security between the third party boards and the  Arduino IoT Cloud, where there’s no possibility to go through our secure certificate provisioning process because the hardware is lacking an essential component: the cryptographic element.

The Arduino IoT Cloud was born with security in mind and developed around the Arduino MKR series of boards featuring Microchip’s ATTECx08, an encryption chip capable of elliptic-curve cryptography. These boards store the bits necessary to authenticate with a server in a very secure way, guaranteeing your board is connecting to the real server and exchanging data over TLS.

When it comes to boards that don’t have enough RAM and do not feature such cryptographic elements, we had to enable a secondary way to get in. Data transfer will still be encrypted over SSL, but the server authentication part will be a little less strict, allowing the Arduino IoT Cloud to be available to a wider user base. Nevertheless, we do inform users that if they want the highest levels of security they’ll have to use a board which embeds a cryptographic chip. As more and more IoT device users become concerned with security, manufacturers are starting to implement such technologies. We have just recently seen standalone ECC modules which can be paired with your microcontroller of choice. It’s looking bright, and we’re proud to have been amongst the first to bring about this change.

For third party boards without a crypto chip, we had to extend our API and allow the creation of a device-exclusive unique identifier (which will be used as a username) and the generation of a Device Key, providing the final user to access the platform using a username: password pair. 

Internally we already used those tools and APIs; we’re just opening them up for use by a broader audience.

One small requirement for this to work is that you’ll need to upgrade your Arduino Create plan to the ‘Maker plan.’ This will give you access to ESP8266 compilation and IoT Cloud pairing of the device. The Maker plan will also extend the amount of original Arduino boards and Things you can create and manage.

This is just the first step in opening up to more and more hardware, and we have a lot of things lined up for our users. We really hope you’ll enjoy the ease of development and the tools to bring your application to the Cloud in the shortest possible time.

Head over to Arduino IoT Cloud and show us what you got!

Live from Maker Faire Rome on Saturday, October 19th at 16.00 CET, Massimo Banzi and Luca Cipriani will push the button to release the new Arduino Pro IDE (alpha) — watch this space.

The hugely popular Arduino IDE software is easy-to-use for beginners, yet flexible enough for advanced users. Millions of you have used it as your everyday tool to program projects and applications. We’ve listened to your feedback though, and it’s time for a new enhanced version with features to appeal to the more advanced developers amongst you.

We are very excited to be releasing an “alpha” version of a completely new Development Environment for Arduino, the Arduino Pro IDE. 

The main features in this initial alpha release of the new Pro IDE are:

  • Modern, fully featured development environment 
  • Dual mode, classic mode (identical to the classic Arduino IDE) and pro mode (file system view)
  • New Board Manager 
  • New Library Manager
  • Board List
  • Basic auto completion (Arm targets only)
  • Git integration
  • Serial Monitor
  • Black theme

But the new architecture opens the door to features that the Arduino community have been requesting like these that will be following on soon:

  • Sketch synchronisation with Arduino Create Editor
  • Debugger
  • Fully open to third party plug-ins 
  • Support for additional languages than C++

The new Arduino Pro IDE is based on the latest technologies as follows: 

Available in Windows, Mac OSX and Linux64 versions; we need your help in improving the product. Before releasing the source code to move out of the alpha, we would greatly appreciate your feedback. Like all things in the Arduino community, we grow and develop together through your valued contributions. Please test the Arduino Pro IDE to it’s breaking point, we want to hear all the good and bad things you find. We’re open to recommendations for additional features, as well as hearing about any bugs you may find – there’s bound to be a few as it is an alpha version afterall!

Versions (released from 16.00 CET on Saturday, October 19th)

Arduino Pro IDE Windows v0.0.1-alpha.preview

Arduino Pro IDE OSX v0.0.1-alpha.preview

Arduino Pro IDE Linux v0.0.1-alpha.preview

So give it a go and let us know of any feature requests or bugs at: https://github.com/arduino/arduino-pro-ide/issues

For those of you who love and cherish the classic Arduino IDE, don’t worry it will continue to be available forever.

This post was originally published by Sandeep Mistry and Dominic Pajak on the TensorFlow blog.

Arduino 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. In this article, we’ll show you how to install and run several new TensorFlow Lite Micro examples that are now available in the Arduino Library Manager.

The first tutorial below shows you how to install a neural network on your Arduino board to recognize simple voice commands.

Example 1: Running the pre-trained micro_speech inference example.

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 Dan Coleman, an updated version of which is now online

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. 

Example 2: Training your own gesture classification model.

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!

Note: The following projects are based on TensorFlow Lite for Microcontrollers which is currently experimental within the TensorFlow repo. This is still a new and emerging field!

Microcontrollers and TinyML

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, washing machines. The trend to connect these devices is part of what is referred to as the Internet of Things.

Arduino is an open-source platform and community focused on making microcontroller application development accessible to everyone. The board we’re using here has an Arm Cortex-M4 microcontroller running at 64 MHz with 1MB Flash memory and 256 KB of RAM. This is tiny in comparison to Cloud, PC, or mobile but reasonable by microcontroller standards.

Arduino Nano 33 BLE Sense board is smaller than a stick of gum.

There are practical reasons you might want to squeeze ML on microcontrollers, including: 

  • Function – wanting a smart device to act quickly and locally (independent of the Internet).
  • Cost – accomplishing this with simple, lower cost hardware.
  • Privacy – not wanting to share all sensor data externally.
  • Efficiency – smaller device form-factor, energy-harvesting or longer battery life.

There’s a final goal which we’re building towards that is very important:

  • Machine learning can make microcontrollers accessible to developers who don’t have a background in embedded development 

On the machine learning side, there are techniques you can use to fit neural network models into memory constrained devices like microcontrollers. One of the key steps is the quantization of the weights from floating point to 8-bit integers. This also has the effect of making inference quicker to calculate and more applicable to lower clock-rate devices. 

TinyML is an emerging field and there is still work to do – but what’s exciting is there’s a vast unexplored application space out there. Billions of microcontrollers combined with all sorts of sensors in all sorts of places which can lead to some seriously creative and valuable TinyML applications in the future.

What you need to get started

The Arduino Nano 33 BLE Sense has a variety of onboard sensors meaning potential for some cool TinyML applications:

  • Voice – digital microphone
  • Motion – 9-axis IMU (accelerometer, gyroscope, magnetometer)
  • Environmental – temperature, humidity and pressure
  • Light – brightness, color and object proximity

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 LE connectivity so you can send data (or inference results) to a laptop, mobile app or other BLE boards and peripherals.

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.

TensorFlow Lite for Microcontrollers examples

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:

  • micro_speech – speech recognition using the onboard microphone
  • magic_wand – gesture recognition using the onboard IMU
  • person_detection – person detection using an external ArduCam camera

For more background on the examples you can take a look at the source in the TensorFlow repository. 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.

How to run the examples using Arduino Create web editor

Once you connect your Arduino Nano 33 BLE Sense 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 web editor:

Compiling an example from the Arduino_TensorFlowLite library.

Focus on the speech recognition example: micro_speech

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 recognise voice keywords. It has a simple vocabulary of “yes” and “no”. Remember this model is running locally on a microcontroller with only 256KB 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.

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.

Running the micro_speech example.

How to run the examples using the Arduino IDE

Alternatively you can use try the same inference examples using Arduino IDE application.

First, follow the instructions in the next section Setting up the Arduino IDE.

In the Arduino IDE, you will see the examples available via the File > Examples > Arduino_TensorFlowLite menu in the ArduinoIDE.

Select an example and the sketch will open. To compile, upload and run the examples on the board, and click the arrow icon:

For advanced users who prefer a command line, there is also the arduino-cli.

Training a TensorFlow Lite Micro model for Arduino

[optimize output image]
Gesture classification on Arduino BLE 33 Nano Sense, output as emojis.

Next we will use ML to enable the Arduino board to recognise gestures. We’ll capture motion data from the Arduino Nano 33 BLE Sense board, import it into TensorFlow to train a model, and deploy the resulting classifier onto the board.

The idea for this tutorial was based on Charlie Gerard’s awesome Play Street Fighter with body movements using Arduino and Tensorflow.js. 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-ifiy” it by performing gesture classification on the Arduino board itself. This is made easier in our case as the Arduino Nano 33 BLE Sense board we’re using has a more powerful Arm Cortex-M4 processor, and an on-board IMU.

We’ve adapted the tutorial below, so no additional hardware is needed – the sampling starts on detecting movement of the board. 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.

Setting up the Arduino IDE

Following the steps below sets up the Arduino IDE application used to both upload inference models to your board and download training data from it in the next section. There are a few more steps involved than using Arduino Create web editor because we will need to download and install the specific board and libraries in the Arduino IDE.

  • In the Arduino IDE menu select Tools > Board > Boards Manager…
    • Search for “Nano BLE” and press install on the board 
    • It will take several minutes to install
    • When it’s done close the Boards Manager window
This image has an empty alt attribute; its file name is k88wXiRDpbadmTW1EreSetBJwHgMN3IP4skuTRywedIgp2aAWvzg3mqyDPZ2_fafH7tFXK-GtFwPEcnMAM0fqfa8XeYCc7orh6LXg4pD2_fKu1JQqw8LALMHfv6lFIBA3a_9pYeg
  • Now go to the Library Manager Tools > Manage Libraries…
    • Search for and install the Arduino_TensorFlowLite library

Next search for and install the Arduino_LSM9DS1 library:

  • Finally, plug the micro USB cable into the board and your computer
  • Choose the board Tools > Board > Arduino Nano 33 BLE
  • Choose the port Tools > Port > COM5 (Arduino Nano 33 BLE) 
    • Note that the actual port name may be different on your computer

There are more detailed Getting Started and Troubleshooting guides on the Arduino site if you need help.

Streaming sensor data from the Arduino board

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.

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. 

We’ll be using a pre-made sketch IMU_Capture.ino which does the following:

  • Monitor the board’s accelerometer and gyroscope 
  • Trigger a sample window on detecting significant linear acceleration of the board 
  • Sample for one second at 119Hz, outputting CSV format data over USB 
  • Loop back and monitor for the next gesture

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 sampling.

To program the board with this sketch in the Arduino IDE:

  • Download IMU_Capture.ino and open it in the Arduino IDE
  • Compile and upload it to the board with Sketch > Upload

Visualizing live sensor data log from the Arduino board

With that done we can now visualize the data coming off the board. We’re not capturing data yet this is just to give you a feel for how the sensor data capture is triggered and how long a sample window is. This will help when it comes to collecting training samples.

  • In the Arduino IDE, open the Serial Plotter Tools > Serial Plotter
    • If you get an error that the board is not available, reselect the port:
    • Tools > Port > portname (Arduino Nano 33 BLE) 
  • Pick up the board and practice your punch and flex gestures
    • You’ll see it only sample for a one second window, then wait for the next gesture
  • You should see a live graph of the sensor data capture (see GIF below)
Arduino IDE Serial Plotter will show a live graph of CSV data output from your board.

When you’re done be sure to close the Serial Plotter window – this is important as the next step won’t work otherwise.

Capturing gesture training data 

To capture data as a CSV log to upload to TensorFlow, you can use Arduino IDE > Tools > Serial Monitor to view the data and export it to your desktop machine:

  • Reset the board by pressing the small white button on the top
  • Pick up the board in one hand (picking it up later will trigger sampling)
  • In the Arduino IDE, open the Serial Monitor Tools > Serial Monitor
    • If you get an error that the board is not available, reselect the port:
    • Tools > Port > portname (Arduino Nano 33 BLE) 
  • Make a punch gesture with the board in your hand (Be careful whilst doing this!)
    • Make the outward punch quickly enough to trigger the capture
    • Return to a neutral position slowly so as not to trigger the capture again 
  • Repeat the gesture capture step 10 or more times to gather more data
  • Copy and paste the data from the Serial Console to new text file called punch.csv 
  • Clear the console window output and repeat all the steps above, this time with a flex gesture in a file called flex.csv 
    • Make the inward flex fast enough to trigger capture returning slowly each time

Note the first line of your two csv files should contain the fields aX,aY,aZ,gX,gY,gZ.

Linux tip: If you prefer you can redirect the sensor log output from the Arduino straight to a .csv file on the command line. With the Serial Plotter / Serial Monitor windows closed use:

 $ cat /dev/cu.usbmodem[nnnnn] > sensorlog.csv

Training in TensorFlow

We’re going to use Google Colab to train our machine learning model using the data we collected from the Arduino board in the previous section. Colab provides a Jupyter notebook that allows us to run our TensorFlow training in a web browser.

Arduino gesture recognition training colab.

The colab will step you through the following:

  • Set up Python environment
  • Upload the punch.csv and flex.csv data 
  • Parse and prepare the data
  • Build and train the model
  • Convert the trained model to TensorFlow Lite
  • Encode the model in an Arduino header file

The final step of the colab is generates the model.h file to download and include in our Arduino IDE gesture classifier project in the next section:

Let’s open the notebook in Colab and run through the steps in the cells – arduino_tinyml_workshop.ipynb

Classifying IMU Data

Next we will use model.h file we just trained and downloaded from Colab in the previous section in our Arduino IDE project:

  • Open IMU_Classifier.ino in the Arduino IDE.
  • Create a new tab in the IDE. When asked name it model.h
  • Open the model.h tab and paste in the version you downloaded from Colab
  • Upload the sketch: Sketch > Upload
  • Open the Serial Monitor: Tools > Serial Monitor
  • Perform some gestures
  • The confidence of each gesture will be printed to the Serial Monitor (0 = low confidence, 1 =  high confidence)

Congratulations you’ve just trained your first ML application for Arduino!

For added fun the Emoji_Button.ino example shows how to create a USB keyboard that prints an emoji character in Linux and macOS. Try combining the Emoji_Button.ino example with the IMU_Classifier.ino sketch to create a gesture controlled emoji keyboard ?.

Conclusion

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 with the Arduino community.

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.”



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook