Courses

Course · BSc SEIoT year 3 · 6 chapters · 5 workshops · 5 ESP32 labs

TinyML: Embedded AI on Microcontrollers

From the concept of AI to a model running on ESP32: design approaches, memory and energy constraints, TensorFlow Lite, int8 quantisation and TensorFlow Lite for Micro — 6 chapters, 5 workshops and 5 labs.

  • Faculté des Sciences de Bizerte
  • 2026–2027

SEIoT 3 · Internet of Things Engineering module — lectures, in-class workshops and labs on ESP32 / NodeMCU, 2026 edition. Six steps, from the concept of AI to a model running on a microcontroller.

Objectives

By the end of the module, you will be able to:

  • Explain what TinyML is and why AI is moved as close as possible to the sensor.
  • Choose between hard-wired, programmed and learning-based logic according to constraints.
  • Size a model: Flash memory, RAM, latency and energy.
  • Optimise a model with int8 quantisation and pruning while measuring the accuracy loss.
  • Deploy a TensorFlow Lite for Micro model on ESP32 / NodeMCU and integrate it into an IoT chain.

Course outline (6 chapters)

  1. Reflections on AI — history, vocabulary (AI, ML, DL), limits, costs and environmental impact
  2. Embedded systems: which design approach? — hard-wired, programmed, co-design or learning-based logic, depending on constraints
  3. The TinyML project — definition, microcontroller constraints, real applications, software and hardware
  4. TensorFlow Lite (LiteRT) — train, convert, optimise (quantisation, pruning) and run
  5. TensorFlow Lite for Micro — the model becomes a C array running with no OS and no malloc on a microcontroller
  6. Synthesis and practice — the full chain from sensor to decision, 2026 trends, final quiz and transition to labs

In-class workshops

  1. Deterministic or probabilistic? And how much energy?
  2. Choosing the right approach for six products
  3. Does my model fit on the board? (Flash, RAM, tensor arena)
  4. Measuring the effect of quantisation (Colab)
  5. TFLM “Hello World” on ESP32 (sine model and LED)

Labs (ESP32 / NodeMCU)

  • Lab 1 — Data acquisition: ESP32, MPU6050, DHT22, serial port, Python
  • Lab 2 — Gesture dataset: 4 classes, CSV, Edge Impulse
  • Lab 3 — int8 classifier: deployment and latency measurement on ESP32
  • Lab 4 — Anomaly detection: autoencoder on fan vibrations
  • Lab 5 — Connected device: local inference + MQTT + Node-RED

Each lab builds on the previous deliverable; wiring, code, questions and grading are in the lab booklet.

Hardware and tools

  • Boards: ESP32 DevKit (2 × Xtensa LX6, 240 MHz, 520 KB SRAM, 4 MB Flash, Wi-Fi + BLE) and NodeMCU ESP8266.
  • Sensors: MPU6050 (accelerometer/gyroscope, I²C), DHT22, push button, LED.
  • Software: Python, Google Colab, TensorFlow / Keras, LiteRT, LiteRT for Microcontrollers (TFLM), Edge Impulse, Arduino IDE / PlatformIO, MQTT and Node-RED.

Assessment and practice

  • An MCQ quiz at the end of each chapter plus a final quiz, with commented answers (40 questions in total).
  • 15 worked exercises: cost of AI, real-time budget, radio data volume, battery life, model memory footprint…
  • 5 in-class workshops and 5 labs on ESP32.

Main references

  • P. Warden, D. Situnayake — TinyML: Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers, O'Reilly.
  • R. Banerjee — Hands-on TinyML, BPB Online.
  • G. M. Iodice — TinyML Cookbook, 2nd ed., Packt.
  • A. Gupta, S. Nandyala — Deep Learning on Microcontrollers, BPB Online.
  • S. Chaudhari et al. — TinyML for Edge Intelligence in IoT and LPWAN Networks, Academic Press.
#TinyML#IA embarquée#ESP32#NodeMCU#TensorFlow Lite#LiteRT#TFLM#Quantification int8#Edge Impulse

Downloadable resources

Members-only content

Sign in or create a free account to download these files.

  • PDF
    Cours TinyML_SEIoT3_v2026_QCM.pdf · 1.8 Mo
  • PDF
    TPsFascicule_de_TP_TinyML_sur_ESP32_NodeMCU.pdf · 538.5 Ko

Courses