TinyML: AI on tiny chipsMiddleLesson 2746 min read

What TinyML is

TinyML means running machine learning models on microcontrollers: tiny, cheap chips that run on very little power. Learn what they can do, and what they cannot.

Lesson in motion

In 60 seconds

What TinyML is

TinyML means running machine learning models on microcontrollers: tiny, cheap chips that run on very little power. Learn what they can do, and what they cannot.

1/4
In simple words
Think of a watchman at a gate. He does not phone the owner every time a leaf moves. He watches all day, and only calls when a real visitor comes. TinyML puts a very small "watchman" brain inside a tiny chip. It listens or feels all the time, and only wakes up the bigger system when something important happens.
A microcontroller is a small computer on a single chip. It has a processor, a little memory and pins that connect to sensors, lights and motors. Microcontrollers are inside washing machines, remote controls, fitness bands, electric meters and toys. Many are cheap and can run for a long time on a small battery.
TinyML is the practice of running machine learning models on these chips. The model is small: often kilobytes, not gigabytes. It does one narrow job, such as "is this sound a wake word?", "is this machine vibrating in an unusual way?" or "is the person walking or running?".

Where TinyML sits

Where the model runsTypical jobPower and costNeeds internet?
Cloud data centreLarge language models, big image modelsVery high; you pay per useYes
Phone or laptopPhoto effects, voice typing, small language modelsMedium; charged every dayOften not
Single-board computer (for example a Raspberry Pi)Camera projects, small vision modelsA few watts; needs a proper power supplyNo
Microcontroller (TinyML)One narrow task on sensor data, all the timeMilliwatts or less; can run on a battery for a long timeNo

Why run AI on such a small chip?

  • Power. Sending raw sensor data over a radio uses much more energy than checking it on the chip. Deciding locally and sending only the result saves battery.
  • Privacy. A doorbell that detects a person on the chip does not need to upload every frame. Audio that never leaves the device cannot leak from a server.
  • Speed. There is no round trip to a server, so the answer comes in milliseconds.
  • No network needed. A sensor in a field, a pump house or a mine may have no signal at all.
  • Cost. A microcontroller costs much less than a phone. You can put one in many places.

Common TinyML jobs

A good fit for TinyML
  • Wake-word detection ("Hey …") before a bigger system wakes
  • Gestures from a motion sensor in a band or a pen
  • Unusual vibration in a motor or a pump (early fault warning)
  • Counting coughs, bird calls or machine cycles
  • A simple "person present or not" check on a small camera
Not a fit for TinyML
  • Chatting with a large language model
  • High-quality translation or long speech transcription
  • Anything that needs a big model's general knowledge
  • Jobs where a mistake could hurt someone and there is no human check
  • Problems a simple rule already solves well
Real example
A farmer in Maharashtra has a borewell pump far from the house. A small board clipped to the pump pipe feels the vibration. A tiny model learns what "normal running" feels like. When the pattern changes, perhaps because the pump is running dry, the board sends one short alert message instead of streaming sensor data all day.

The tools, in general

The best-known open-source runtime is TensorFlow Lite for Microcontrollers, from Google. Google has renamed TensorFlow Lite to LiteRT, and the microcontroller runtime now sits in that family. Platforms such as Edge Impulse give a web workflow to collect data, train, test and export a model for many boards. Chip makers also offer their own tools. Names, versions and supported boards change often, so check the current docs before you start.
Note
"Small model" here means really small. A model with a few thousand to a few hundred thousand weights is common. Large language models have billions. TinyML does not shrink an LLM onto a chip; it trains a different, tiny model for one job.
Try this. Look around your home. Find three devices that have a microcontroller inside (anything with buttons and a small display is a good guess). For one of them, imagine one small, useful thing it could learn to detect.

Watch and read more

Lab

Three TinyML idea cards, each checked against what a tiny chip can really do.

~20 min

The problem

No coding in this lab. Write three short "idea cards" for TinyML projects you could build around your home, college, farm or neighbourhood. For each card, write:

  1. The job: one narrow question the model answers, such as "is the pressure cooker whistling?".
  2. The sensor: microphone, motion sensor (accelerometer), temperature, light or a small camera.
  3. The output: what happens when it detects something: a light, a buzzer, one short message.
  4. Why on the chip: power, privacy, speed, no network or cost.
  5. What could go wrong: one kind of false alarm and one kind of miss.

Finally, write one idea that sounds exciting but is not a good fit for TinyML, and say why.

You are done when

Hard questions

Try to answer before you reveal. If you can answer these, you understood the lesson.

Q1A friend says: "Let's put ChatGPT on a microcontroller so my fan can chat with me." What would you tell them?Reveal

A large language model needs far more memory and compute than a microcontroller has. A microcontroller could run a tiny wake-word or command model ("fan on", "speed two"), and the fan could send the audio to a bigger computer or the cloud only if a real conversation is needed. TinyML is about narrow jobs, not general chat.

Q2When is a simple rule better than a TinyML model?Reveal

When the pattern is clear and stable, for example "turn on the pump light if the water level switch is closed". A rule is easier to test, explain and fix. Use a model when the pattern is hard to write as rules, like telling a cough from a laugh, or normal vibration from early wear.

Please sign in to continue.

Questions people ask

Is TinyML the same as "edge AI"?

TinyML is the smallest end of edge AI. Edge AI means running models near the data instead of in the cloud: on phones, cameras, gateways and boards. TinyML is the part that runs on microcontrollers, with kilobytes of memory and very low power.

Can a microcontroller learn on its own after I deploy it?

Usually the model is trained on a computer and only runs on the chip. Some projects do small on-device updates, but training needs much more memory and power. For a first project, plan to train on your computer and deploy a fixed model.

Do I need to buy a board to follow this track?

No. The coding labs run in your browser with made-up sensor data. A board helps for the last lesson, and many beginner boards with a motion sensor or microphone work. Check which boards your chosen tool supports today.

Is TinyML only for engineers?

No. Makers, students and hobbyists build TinyML projects too. You need some Python for training, and some patience with a board's setup. The ideas in this track are the same whichever tool you use.

Lesson test

5 questions. Get 3 right (60%) to pass and complete this lesson.

Sign in to take the test and save your progress