Main Content

Cough Detection with TinyML on Arduino

In this tutorial we show how to build a cough detection system for the Arduino Nano BLE Sense using TinyML and Edge Impulse.

There is a huge need for inexpensive, easily deployable solutions for COVID-19 and other flu related early detection. Together with the UN, Hackster, Edge Impulse and many others we recently launched the UN Covid Detect & Protect Challenge aiming to create easily deployable solutions for the prevention and detection of flu in developing countries. In this tutorial we show how to use Edge Impulse machine learning on an Arduino Nano BLE Sense to detect the presence of coughing in real-time audio. We built a dataset of coughing and background noise samples, and applied a highly optimized TInyML model, to build a cough detection system that runs in real time in under 20 kB of RAM on the Nano BLE Sense. This same approach applies to many other embedded audio pattern matching applications, for example elderly care, safety and machine monitoring. This project and dataset was originally started by Kartik Thakore to help in the COVID-19 effort.

Getting started
This tutorial has the following requirements:

Basic understanding of software development and Arduino
Installed Arduino IDE or CLI
Android or iOS mobile phone
Arduino Nano BLE Sense or equivalent Cortex-M4+ board with a microphone (optional)
We will use Edge Impulse, an online development platform for machine learning on edge devices. Create a free account by signing up here. Log into your account, and give your new project a name by clicking on the title. We call ours the “Arduino Cough Tutorial”.”

Link to article