MicroPython
Welcome! This is a complete, self-paced programming course that teaches Python fundamentals through hands-on hardware projects using the ESP32-S3 microcontroller and MicroPython.
Every lesson involves real hardware — LEDs that light up, sensors that detect objects, motors that spin. The hardware makes abstract programming concepts concrete and keeps things interesting.
Who is this course for? Students who are new to programming and want to learn Python through building real things. No prior programming experience needed — just curiosity and enthusiasm.
What is MicroPython?
Python is a programming language that normally runs on computers — laptops, desktops, servers. When you run a Python script on your laptop, the laptop’s operating system (Windows, macOS, Linux) handles loading the program, managing memory, and talking to the hardware.
A microcontroller like the ESP32-S3 is a different kind of computer. It has no operating system, no keyboard, no screen, and a tiny amount of memory (kilobytes, not gigabytes). It’s designed to run one program repeatedly and efficiently — perfect for controlling hardware.
MicroPython is a stripped-down version of Python that fits on a microcontroller. It speaks almost exactly the same language as regular Python, but with some differences:
- No
tkinteror other desktop GUI libraries - No access to your computer’s filesystem — instead, it uses a small filesystem in the chip’s flash memory
- Some modules are different (e.g.,
machineinstead of system-level hardware access) input()works when connected to Thonny, but not when the board is running standalone
What You Will Learn
| Unit | Lessons | Programming Concept | New Hardware |
|---|---|---|---|
| Unit 1: Getting Started | 1–4 | print, variables, data types, strings, expressions | ESP32-S3 built-in NeoPixel |
| Unit 2: Making Decisions | 5–7 | if/elif/else, comparison operators, logical operators | Push buttons |
| Unit 3: Loops & Repetition | 8–10 | while loops, for loops, range(), break, continue | IR sensor |
| Unit 4: Collections of Data | 11–13 | 1D lists, list operations, iterating lists | HC-SR04 ultrasonic sensor |
| Unit 5: Functions & Modularity | 14–16 | def, parameters, return values, scope | 9G servo motor |
| Unit 6: Working with Files | 17–18 | File I/O, CSV, data logging | Relay + DC motor |
| Unit 7: The Grid | 19–21 | 2D lists, nested loops, grid rendering | WS2812B 8×8 NeoPixel grid |
| Unit 8: Capstone Project | 22–24 | All concepts integrated | All hardware |
What You Need
Hardware
- ESP32-S3 development board — the main microcontroller. It has a built-in NeoPixel RGB LED on GPIO 48 that you’ll use from the very first lesson.
- Breadboard and jumper wires — for connecting external components
- Push buttons — momentary switches for physical input
- IR proximity sensor — detects nearby objects using infrared light
- HC-SR04 ultrasonic distance sensor — measures distance using sound pulses
- 9G micro servo motor — a motor that holds a precise angle
- 3.3V relay module — an electrically-controlled switch for the motor
- 5V geared DC motor — switched on/off by the relay
- WS2812B 8×8 NeoPixel grid — 64 individually addressable RGB LEDs
Introduce hardware gradually. Units 1–2 use only the built-in NeoPixel — no extra wiring needed. New components are added one at a time.
Software
- Thonny IDE — a beginner-friendly Python editor with built-in MicroPython support. Free download from thonny.org.
- MicroPython firmware for ESP32-S3 — installed via Thonny (see the Setup Guide).
How to Use This Course
This course is designed to be worked through independently at your own pace. A reasonable pace is 2–3 lessons per week, giving you about 10–12 weeks to complete the full course.
Each lesson includes:
- Clear concept explanations with code examples
- A step-by-step guided project you build yourself
- Challenges (⭐ Core / ⭐⭐ Extension / ⭐⭐⭐ Stretch) to test yourself
- Common mistakes and debugging tips
- Key vocabulary definitions
Tips for success:
- Type the code yourself rather than copy-pasting. It sounds tedious but typing helps you notice every detail and builds muscle memory.
- Make mistakes on purpose. Change a value, remove a bracket, misspell something — see what error appears. This is how experienced programmers learn to debug.
- Read the error messages. Python’s error messages are actually quite helpful once you know how to read them.
- If you get stuck, check the Common Mistakes section, reread the concept explanation, then check the challenge solutions.