Complete for freeIntermediate

Course 18

Hardware Lab: TinyML and Edge AI

TinyML is machine learning on chips with kilobytes of memory, like the ones inside fitness bands, smart speakers, and wildlife sensors. This course teaches it the way an engineer meets it: as a set of trade-offs you can measure. You start by deciding when a model should run on the device and when it should run in the cloud, using latency, bandwidth, privacy, power, cost, and connectivity numbers you calculate yourself. Then you work in Google Colab with NumPy, scikit-learn, and PyTorch to turn a raw accelerometer stream into labeled windows, compute features such as RMS and FFT peaks, train small classifiers, and check them without data leakage. You build spectrograms and MFCCs from audio, train a keyword spotter, and quantize its weights from float32 to int8 with your own scale and zero-point code, measuring the size and accuracy before and after. Later modules budget RAM, flash, and response time, plan a deployment and test it against real-world accuracy, and trade battery life against privacy with duty cycles and on-device decisions. Edge Impulse Studio, on its free Developer plan, shows the same pipeline in a production tool, with your phone working as a free sensor. Every Python example on these pages runs for real when the lesson is built, so the charts and numbers you see are real outputs. Each core module has a Notes lesson, a Build-along, and a Practice set with hints and worked solutions, and the course ends with a capstone device plan.

Free completion promise: Every lesson can be completed for $0. Google Colab's free tier runs all the Python, and Edge Impulse's Developer plan costs nothing. Your phone works as a free sensor for real data, and the course builds synthetic sensor and audio data in code, so you never need a board. If you can't use an Edge Impulse account, each Edge Impulse step has a Colab version that teaches the same idea.

What's inside

  • 24hand-written lessons
  • 15videos
  • 5step-through animations
  • 53diagrams, charts & live previews
  • 46quiz questions
  • 152code examples

Before you begin

Requirements & setup for Hardware Lab: TinyML and Edge AI

Start with the complete free pathway below. Hardware, subscriptions, paid APIs, and cloud credits are never required.

Start here ยท free path

Your complete $0 setup

Every lesson can be completed for $0. Google Colab's free tier runs all the Python, and Edge Impulse's Developer plan costs nothing. Your phone works as a free sensor for real data, and the course builds synthetic sensor and audio data in code, so you never need a board. If you can't use an Edge Impulse account, each Edge Impulse step has a Colab version that teaches the same idea.

$0 required

Setup checklist

0 of 13 complete

This checklist is a temporary setup aid and resets when the page reloads. Saved course progress begins in the setup lessons below.

  1. Everything required for this course is free. Paid software, APIs, cloud credits, GPUs, and physical equipment are optional.

    About 2 min
  2. Go to colab.research.google.com, sign in with a Google account, and create a new notebook.

  3. Run a first cell that imports numpy, sklearn, matplotlib, scipy, and torch and prints their versions.

    About 5 min
  4. Create an Edge Impulse account at studio.edgeimpulse.com (Edge Impulse requires account holders to be 18 or older, so younger learners use an account owned by a parent, guardian, or teacher).

    About 5 min
  5. Create a private project, open Devices, choose Connect a new device, then Mobile phone, and scan the QR code with your phone.

    About 5 min
  6. Record a 10-second accelerometer sample from Data acquisition and check that three lines appear in the graph.

    About 5 min
  7. Every lesson works in Google Colab, with Edge Impulse Studio, so Arduino Nano 33 BLE Sense (Rev2) is never required.

  8. If you have Arduino Nano 33 BLE Sense (Rev2), use it where a lesson mentions it and compare your result with the lesson's.

    About 5 min
  9. If it doesn't match, finish that step in Google Colab, with Edge Impulse Studio and keep going.

    About 5 min
  10. Every lesson works in Google Colab, with Edge Impulse Studio, so BBC micro:bit V2 is never required.

  11. If you have BBC micro:bit V2, use it where a lesson mentions it and compare your result with the lesson's.

    About 5 min
  12. If it doesn't match, finish that step in Google Colab, with Edge Impulse Studio and keep going.

    About 5 min
  13. Google Colab, with Edge Impulse Studio: Colab prints a version number for every library, and Edge Impulse shows your phone with a green dot under Devices plus a 10-second sample with x, y, and z lines under Data acquisition. Arduino Nano 33 BLE Sense (Rev2): Colab prints a version number for every library, and Edge Impulse shows your phone with a green dot under Devices plus a 10-second sample with x, y, and z lines under Data acquisition. BBC micro:bit V2: Colab prints a version number for every library, and Edge Impulse shows your phone with a green dot under Devices plus a 10-second sample with x, y, and z lines under Data acquisition.

    About 5 min

Software

1 item

Google Colab, with Edge Impulse Studio

Google Colab is a free Jupyter notebook that runs in your browser on a Google computer, with NumPy, scikit-learn, matplotlib, SciPy, and PyTorch already installed. Every Python lesson runs there, so nothing needs installing on your own machine. Edge Impulse Studio is a free web tool (Developer plan) for collecting real sensor data, designing a processing pipeline, training a model, and building it for a phone or a microcontroller. Your phone's browser can act as an Edge Impulse sensor, so you can record real motion data without buying anything.

Course need
Google Colab, with Edge Impulse Studio
Free

Google Colab is a free Jupyter notebook that runs in your browser on a Google computer, with NumPy, scikit-learn, matplotlib, SciPy, and PyTorch already installed. Every Python lesson runs there, so nothing needs installing on your own machine. Edge Impulse Studio is a free web tool (Developer plan) for collecting real sensor data, designing a processing pipeline, training a model, and building it for a phone or a microcontroller. Your phone's browser can act as an Edge Impulse sensor, so you can record real motion data without buying anything. Every lesson is readable text with copyable code, keyboard-friendly quizzes and step-throughs, and videos with YouTube captions.

  1. Go to colab.research.google.com, sign in with a Google account, and create a new notebook.
  2. Run a first cell that imports numpy, sklearn, matplotlib, scipy, and torch and prints their versions.
  3. Create an Edge Impulse account at studio.edgeimpulse.com (Edge Impulse requires account holders to be 18 or older, so younger learners use an account owned by a parent, guardian, or teacher).
  4. Create a private project, open Devices, choose Connect a new device, then Mobile phone, and scan the QR code with your phone.
  5. Record a 10-second accelerometer sample from Data acquisition and check that three lines appear in the graph.

Hardware

2 items

Arduino Nano 33 BLE Sense (Rev2)

Optional. A microcontroller board with an accelerometer, microphone, 1 MB of flash, and 256 KB of RAM that Edge Impulse fully supports, so you can deploy your models to real hardware. The original Nano 33 BLE Sense works too. Every lesson can be finished without it.

Optional
Google Colab, with Edge Impulse Studio
Free

Optional. Every lesson can be completed with Google Colab, with Edge Impulse Studio; Arduino Nano 33 BLE Sense (Rev2) is an extra for learners who have it. Optional equipment: every assessed outcome can be completed without it.

  1. Every lesson works in Google Colab, with Edge Impulse Studio, so Arduino Nano 33 BLE Sense (Rev2) is never required.
  2. If you have Arduino Nano 33 BLE Sense (Rev2), use it where a lesson mentions it and compare your result with the lesson's.
  3. If it doesn't match, finish that step in Google Colab, with Edge Impulse Studio and keep going.

BBC micro:bit V2

Optional. A cheaper board with an accelerometer that runs motion models trained in the free micro:bit CreateAI tool. It shows the train-then-deploy loop on real hardware without an Edge Impulse account.

Optional
Google Colab, with Edge Impulse Studio
Free

Optional. Every lesson can be completed with Google Colab, with Edge Impulse Studio; BBC micro:bit V2 is an extra for learners who have it. Optional equipment: every assessed outcome can be completed without it.

  1. Every lesson works in Google Colab, with Edge Impulse Studio, so BBC micro:bit V2 is never required.
  2. If you have BBC micro:bit V2, use it where a lesson mentions it and compare your result with the lesson's.
  3. If it doesn't match, finish that step in Google Colab, with Edge Impulse Studio and keep going.

Accounts

Nothing required

No external account is needed for this course.

What you will be able to do

Learning outcomes

  • Choose between on-device and cloud inference for a product by calculating latency, data volume, energy, cost, and privacy exposure.
  • Turn a continuous sensor stream into labeled windows with a chosen sampling rate, window size, and stride, and extract time and frequency features from them.
  • Pick the right task type (classification, anomaly detection, or regression) and evaluate it without leakage between overlapping windows.
  • Build spectrogram and MFCC features from audio with NumPy and train a small keyword-spotting model.
  • Quantize a model from float32 to int8 with scale and zero-point, and measure what it costs in accuracy and saves in memory.
  • Write a deployment plan for a constrained device that covers memory, latency, accuracy on real hardware, power, and local data handling.

Build real work

Assignments & capstone

Free tools accepted

Tiny classifier, quantized to int8

In Colab, cut sensor or audio recordings into windows, extract features, split by recording so nothing leaks, and train a small classifier, then quantize it to int8 with your own scale and zero-point code and compare accuracy and size.

Every lesson can be completed for $0. Google Colab's free tier runs all the Python, and Edge Impulse's Developer plan costs nothing. Your phone works as a free sensor for real data, and the course builds synthetic sensor and audio data in code, so you never need a board. If you can't use an Edge Impulse account, each Edge Impulse step has a Colab version that teaches the same idea. Submit your project file, or screenshots with descriptions, or a short demo.

Device budget and field-test report

Profile two candidate models for a named microcontroller, fit the winner into a flash, RAM, and latency budget, then score a set of field-test logs with a confusion matrix, per-class recall, per-person accuracy, and a confidence interval.

Every lesson can be completed for $0. Google Colab's free tier runs all the Python, and Edge Impulse's Developer plan costs nothing. Your phone works as a free sensor for real data, and the course builds synthetic sensor and audio data in code, so you never need a board. If you can't use an Edge Impulse account, each Edge Impulse step has a Colab version that teaches the same idea. Submit your project file, or screenshots with descriptions, or a short demo.

Final assessment

Constrained edge-AI device plan

Plan an edge-AI device, such as a gesture remote or keyword spotter, with measurable targets, two candidate models trained in Colab or Edge Impulse, a flash, RAM, and latency budget, test results, a power estimate, and a privacy data-flow table. Deliverables: Design doc with every number labeled measured or estimated, Colab notebook that reruns every budget and test number, Edge Impulse project or training code, plus any field logs, and Five-minute presentation.

Prerequisites & pacing

Skills assumed

  • Python: functions, lists, loops, and reading a traceback
  • NumPy arrays at a basic level (creating them, slicing, and calling np.mean)
  • Machine learning basics: features, labels, a train/test split, and accuracy
  • No electronics experience needed; a development board is optional

Recommended prior courses

These are advisory, not locks. If you already have the skills listed above, enroll directly.

Choose your pace

  • self paced: 10 weeks at 5 hours per week
  • weekly: 10 weeks at 5 hours per week

Part of this learning path

  • ๐Ÿค– Hardware and Robotics ยท step 4 of 4

    Go from first LED to a connected, sensing, machine-learning device โ€” every step has a browser simulator.

Course created by Zafir Shamsi.