Built to order

TinyML Cough Detection Wearable

This project builds a wrist-worn cough counter that runs its machine-learning model entirely on the device. An ESP32-S3 with a MEMS microphone captures short audio windows, extracts spectral features and runs a TensorFlow Lite Micro classifier that labels each window as cough or non-cough — no audio ever leaves the wearable. Detected cough events with timestamps and confidence scores are sent over BLE to a phone dashboard showing the day's cough count, an hourly chart and an event log. This is an academic prototype for demonstrating TinyML audio classification; it is not a medical device and

TinyML Cough Detection Wearable — project thumbnail preview
More project photos (2)

The problem

Cough frequency is a useful signal in respiratory studies, but counting coughs today means either manual tallying or shipping audio to the cloud — expensive, power-hungry and a privacy problem. TinyML changes the trade: a microcontroller can run a small neural network on-device, so the wearable decides locally and only the event (timestamp + confidence) leaves the device. This project builds that wearable. An ESP32-S3 board with an INMP441 MEMS microphone samples audio in short windows, computes mel-scale spectral features, and runs a TensorFlow Lite Micro CNN trained on cough-vs-non-cough audio (built from the public COUGHVID corpus plus custom-collected samples). A majority-vote smoother turns window labels into cough events, which are logged to flash and synced over BLE to a phone dashboard with the day's count, an hourly chart and a confidence-filtered event log. The report is explicit about the model's limits: it counts cough-like sounds, it does not diagnose anything, and accuracy is measured on the student's own test set during the build.

How it works

  1. The INMP441 microphone streams audio to the ESP32-S3 over I2S in short overlapping windows.
  2. Firmware computes mel-scale spectral features for each window — the same feature recipe used in training.
  3. The quantized TFLite Micro CNN scores each window as cough or non-cough; scores below the confidence threshold are discarded.
  4. A majority-vote smoother across consecutive windows merges sustained detections into single cough events with timestamps.
  5. Events are written to on-flash storage and advertised over BLE; the phone dashboard pulls new events on connect.
  6. The dashboard renders today's count, the hourly distribution chart and the confidence-filtered event log.
  7. Training happens offline: cough and non-cough clips are curated, augmented, and used to train and quantize the model that is flashed to the device.

Tech stack:

  • ESP32-S3 (TinyML-capable, BLE on board) with Arduino/ESP-IDF firmware
  • INMP441 MEMS I2S microphone
  • TensorFlow Lite Micro (quantized CNN, on-device inference)
  • Python training pipeline (feature extraction, augmentation, training, quantization)
  • COUGHVID public corpus + custom-collected samples for training data
  • Phone web dashboard over BLE (count, hourly chart, event log)
Parameter Value
Controller ESP32-S3 with BLE
Microphone INMP441 MEMS, I2S interface
Model Quantized CNN via TensorFlow Lite Micro, mel-spectrogram input
Training data COUGHVID public corpus + custom-collected cough/non-cough clips
Output Cough events: timestamp + confidence; hourly counts
Privacy On-device inference only; no audio stored or transmitted
Battery Li-Po cell; design target of a full day per charge (usage-dependent estimate)
Evaluation Accuracy, precision, recall on the student's held-out test set — measured during the build
Design target Approximately 85%+ window-level accuracy (target, measured on your build, not guaranteed)

Project features

  • [On-device cough classifier] TFLite Micro CNN on the ESP32-S3 labels short audio windows as cough or non-cough locally — raw audio never leaves the device.
  • [MEMS microphone front end] INMP441 I2S microphone with configurable gain; firmware documents the sampling setup and wind-noise behaviour.
  • [Spectral feature pipeline] Mel-scale spectrogram features computed on-device from each audio window before inference.
  • [Event smoothing] Majority-vote window over consecutive labels converts raw detections into discrete cough events with timestamps.
  • [BLE phone dashboard] Cough count today, hourly bar chart, event log with confidence scores, and device battery level over Bluetooth Low Energy.
  • [On-flash event log] Events persist in flash across power cycles and sync to the phone when it reconnects.
  • [Privacy by design] No audio recording, no cloud upload — only timestamped event labels leave the wearable, stated as an explicit design guarantee.
  • [Complete training pipeline] Dataset curation, augmentation, training and on-device evaluation notebooks; confusion matrix computed on the student's held-out test set.

What is included

  • Complete ESP32-S3 firmware (audio capture, feature extraction, TFLite Micro inference, event logging, BLE)
  • Training pipeline (dataset curation, augmentation, training, quantization, evaluation notebooks)
  • Phone dashboard web app (count, hourly chart, event log, battery) over BLE
  • Wearable assembly guide (board, microphone placement, battery, enclosure)
  • Data-collection procedure for custom cough samples (consent and hygiene notes included)
  • Project report PDF (background, TinyML design, training, evaluation, limitations)
  • PPT presentation for final review
  • Viva Q&A preparation document (TinyML, quantization, spectral features, BLE, evaluation)
  • Setup guide (environment, training, flashing, dashboard pairing)

Limitations & prerequisites

  • This is an academic prototype, not a medical device: cough counts are indicative and must never be used for diagnosis, treatment decisions or health monitoring. The report and dashboard carry this warning.
  • The model detects cough-like sounds — throat clearing, loud laughter and similar transients can trigger false positives; the evaluation documents the confusion patterns openly.
  • Wind noise and a loose microphone mount degrade detection; the assembly guide documents placement and the firmware's gain staging.
  • No clinical accuracy is claimed; performance is measured on the student's own held-out test set, which cannot represent all voices, ages and environments.
  • Battery life is estimated from the power budget — continuous inference plus BLE advertising drains faster than the headline figure in noisy environments.
  • Training a robust model needs a diverse custom dataset; the COUGHVID corpus helps, but the report is honest that dataset bias is the main accuracy risk.

Frequently Asked Questions

Which dataset is used?

The public COUGHVID corpus of crowdsourced cough recordings plus custom-collected cough and non-cough clips. The notebook documents the exact composition, the train/test split and the augmentation used.

Does the wearable record or upload audio?

No. Inference runs entirely on the ESP32-S3; only timestamped cough events with confidence scores leave the device over BLE. No audio is stored or transmitted — this is an explicit design guarantee.

Is the accuracy guaranteed?

No. The design target is approximately 85%+ window-level accuracy, but the training notebook measures accuracy, precision and recall on your held-out test set during the build, and the report documents your own numbers.

Can it distinguish coughs from throat clearing?

Imperfectly — similar transient sounds are the main false-positive source, and the confusion matrix in the report shows this openly. The confidence threshold is tunable to trade sensitivity against false alarms.

Is this a medical device?

No. It is an academic prototype for demonstrating TinyML audio classification. It must not be considered a replacement for certified medical equipment, professional diagnosis or clinical decision-making.

Is this project suitable for a final-year project?

Yes — for Electronics, IoT and AI/ML programs. It demonstrates TinyML deployment, quantization, audio feature engineering, BLE systems and honest evaluation of a health-adjacent prototype, all strong viva material. Suitable for B.E./B.Tech final-year projects in Electronics, IoT and AI/ML.

Components & software requirements
  • ESP32-S3 (TinyML-capable, BLE on board) with Arduino/ESP-IDF firmware
  • INMP441 MEMS I2S microphone
  • TensorFlow Lite Micro (quantized CNN, on-device inference)
  • Python training pipeline (feature extraction, augmentation, training, quantization)
  • COUGHVID public corpus + custom-collected samples for training data
  • Phone web dashboard over BLE (count, hourly chart, event log)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Blueprint-style technical illustration of an ESP32 development board at the centre, with sensor nodes, data-flow arrows and a circuit-brain motif representing an AI agent reasoning and sending decisions back.Engineering students building IoT or embedded final-year projects who want to add local AI agent behaviour with ESP32, MQTT and a small language model.

AI Agents on ESP32: Agentic IoT Final-Year Projects

An agentic IoT system observes, reasons, acts, remembers and explains. On ESP32 that means a split architecture: the chip senses and acts while a small local model (Ollama on your laptop) reasons over MQTT — a full LLM needs gigabytes of RAM the chip doesn't have. This guide covers three working patterns (host-reasoned agent, on-device tinyML on ESP32-S3, and a hybrid of both), plus Wi-Fi CSI presence sensing, parts and budget for India, code shapes, and honest limits to state in your report.

Read guide
Technical illustration of three electronic control units linked by a twisted-pair CAN bus cable carrying signal pulses between them.Electronics, E&TC, IoT and robotics students who keep hearing “CAN bus” in EV, automotive and industrial project ideas and want to understand it properly before wiring anything

CAN Bus Basics for Students: How ECUs Communicate

CAN bus is the shared network that lets dozens of controllers in a car, EV or robot communicate over two wires. This guide explains message IDs, arbitration, the physical layer, frame structure, error handling and CAN FD, then walks through building a working two-node bench network with an ESP32 and a transceiver.

Read guide
Illustration of a quadcopter drone build showing labeled parts including frame, motors, propellers, ESCs, flight controller, and battery.B.E./B.Tech Electronics, Mechanical, and Computer Science students planning to build a quadcopter drone who need to select compatible parts without wasting money on mismatched

Drone Build: Parts Selection Guide

Picking drone parts that actually work together is a sizing problem, not a shopping problem. This guide walks the compatibility chain — frame to props to motors to ESCs to battery — with the thrust math, firmware choices, LiPo safety, and the bench-test order that prevents disasters.

Read guide
Get a quotation