Chapters
This textbook is organized into 23 chapters covering 485 concepts across Python programming, electronics, sensors, displays, motors, robots, wireless networking, and project design.
Chapter Overview
- Python Basics — Programs, Variables, Data Types, and Operators - The fundamental building blocks of every Python program: variables, data types, operators, syntax, and print statements.
- Collections, Control Flow, Functions, and Error Handling - Lists, dictionaries, loops, conditionals, functions, modules, and how to handle errors gracefully.
- MicroPython Environment and Development Tools - Setting up Thonny, flashing firmware, using the REPL, transferring files, and the MicroPython standard library.
- Microcontrollers and Hardware Platforms - The Raspberry Pi Pico, RP2040, Pico W, ESP32, GPIO pins, power, logic levels, and onboard memory.
- Electronics Fundamentals - Voltage, current, resistance, Ohm's law, LEDs, transistors, diodes, capacitors, breadboards, and wiring.
- Digital Input, Output, and Interrupts - Controlling LEDs, reading buttons, debouncing, active-high/low logic, and interrupt service routines.
- Analog Signals, ADC, and Pulse-Width Modulation - Analog signals, the ADC, potentiometers, light sensors, and PWM for fading LEDs and driving motors.
- Communication Protocols: I2C, SPI, and UART - The I2C, SPI, UART, 1-Wire, and I2S digital buses and MicroPython's machine classes for peripherals.
- Temperature, Humidity, and Distance Sensors - DHT11, DHT22, BME280, DS18B20, HC-SR04 ultrasonic, VL53L0X time-of-flight, and IR distance sensors.
- Motion, Orientation, and Light Sensors - Accelerometers, gyroscopes, compass sensors, photoresistors, and gesture/color sensors using I2C.
- Rotary Encoders, Touch Sensors, and Audio Input - Quadrature rotary encoders, capacitive touch sensors, digital microphones, and FFT concepts for audio.
- Motors, Servos, and Stepper Motor Control - DC motors, H-bridge ICs, motor speed and direction with PWM, servo angle control, and stepper motors.
- Robots and Mobile Systems - Differential-drive robots, line-following, collision avoidance, obstacle detection, and robot calibration.
- NeoPixels and Non-Graphical Displays - WS2812B NeoPixel strips and matrices, RGB/HSV color models, 7-segment displays, LED arrays, and character LCDs.
- OLED Display Setup and Configuration - OLED hardware, SSD1306 and SH1106 controllers, I2C/SPI interfaces, resolution options, and driver modules.
- OLED Drawing Methods, Framebuffer, and Animation - OLED drawing APIs, the framebuf module, and animated projects like OLED Bounce and Pong.
- Color Displays and E-Paper Screens - Full-color TFT LCDs (ILI9341, ST7789V), color depth, custom drawing, and low-power e-paper displays.
- Sound, Music, and Audio Generation - Buzzers, tone generation with PWM, musical note frequencies, melody playback, MIDI, DAC, and I2S audio.
- Wireless Connectivity and Internet of Things - Wi-Fi, HTTP, web servers, REST APIs, JSON, weather data, NTP time sync, and OTA updates.
- Timers, Timing Functions, and Multi-Core Programming - machine.Timer, non-blocking programming with ticks, precise timing, and RP2040 dual-core with _thread.
- File Systems, Audio Files, and Debugging - MicroPython file I/O, SD cards, WAV playback, I2S audio output, and systematic debugging strategies.
- Advanced Hardware Topics and AI-Assisted Coding - PIO state machines, FFT algorithms, DMA, watchdog timers, RTC, sleep modes, and AI prompt engineering.
- Applied Learning and Capstone Projects - Complete kit projects, computational thinking pillars, project design methodology, and a student capstone project.
How to Use This Textbook
Start with Chapter 1 and work forward — each chapter builds on concepts introduced in earlier chapters. Chapters 1–5 give you the Python and electronics foundation you need for all hands-on labs. From Chapter 6 onward, every chapter includes working MicroPython programs you can run on your Raspberry Pi Pico. If you already know Python, you can skim Chapters 1–2 and start with Chapter 3.
Note: Each chapter lists every concept it covers. Complete the prerequisite chapters before moving to later ones — the dependency order is intentional and will make each new idea easier to understand.