MicroPython on Pi Pico and Projects

Adapted from Get Started with MicroPython on Raspberry Pi Pico, 2nd Edition, 2024, by Gareth Halfacree and Ben Everard (Raspberry Pi Ltd.). Licensed under CC BY-NC-SA 3.0 Unported.

Get acquainted with the Raspberry Pi Pico and MicroPython: wiring, flashing firmware, and physical computing fundamentals. Foundational material shared across courses, not specific to any one class.

Get Started with MicroPython on Raspberry Pi Pico, 2nd Edition is a genuinely great book, and because it’s Creative Commons licensed, it’s also a fantastic resource if you want to keep learning MicroPython well past this class, on your own. For some chapters we’ve added our own slides or a Notes page to go with the reading.

Chapters 1 through 4 are the fundamentals: getting to know the board, programming it, and physical computing basics. Chapters 5 through 12 are the book’s own hands-on projects, built on that foundation. Some of these take more than one class or block period to finish, so plan accordingly.

Contents

  1. Introduction: Front matter

    The book's copyright page, welcome note, and author bios

  2. Chapter 1: Get to know your Raspberry Pi Pico Notes page Chapter 1 slides

    Get acquainted with your powerful new microcontroller board and learn how to attach pin headers and install MicroPython to program it

  3. Chapter 2: Programming with MicroPython

    Connect a computer and start writing programs for your Raspberry Pi Pico using the MicroPython language

  4. Chapter 2b: Writing and running code with ViperIDE

    Connect your Pico to ViperIDE and write your first MicroPython programs: no software to install, no admin rights needed.

  5. Chapter 3: Physical computing Notes page Chapter 3 slides

    Learn about your Raspberry Pi Pico’s pins and the electronic components you can connect and control

  6. Chapter 4: Physical computing with Raspberry Pi Pico Notes page Chapter 4 slides

    Start connecting basic electronic components to Raspberry Pi Pico and writing programs to control and sense them

  7. Chapter 5: Traffic light controller

    Create your own mini pedestrian crossing system with multiple LEDs and a push-button

  8. Chapter 6: Reaction game

    Build a simple reaction timing game using an LED and push-buttons, for one or two players

  9. Chapter 7: Burglar alarm

    Use a motion sensor to detect intruders and sound the alarm with a flashing light and siren

  10. Chapter 8: Temperature gauge

    Use your Raspberry Pi Pico’s built-in ADC to convert analogue inputs, and also to read its internal temperature sensor

  11. Chapter 9: Data logger

    Untether Raspberry Pi Pico from the computer to make it a fully portable temperature-logging device

  12. Chapter 10: Digital communication protocols: I2C and SPI

    Explore these two popular communication protocols and use them to display data on an OLED display

  13. Chapter 11: Wi-Fi connectivity with Pico W and Pico 2 W

    Turn Raspberry Pi Pico W into a network-connected node for the Internet of Things as you learn to unleash its Wi-Fi powers

  14. Chapter 12: Bluetooth connectivity with Pico W and Pico 2 W

    Link Raspberry Pi Pico W or Pico 2 W to your smartphone, tablet, computer, or another Pico with Bluetooth Low Energy

  15. Appendix A: Raspberry Pi Pico specifications

    A reference for the curious: what's inside the Pico and Pico 2's microcontroller chips

  16. Appendix B: Pinout guide

    A complete reference to every GPIO pin's functions on the Pico 2

  17. Appendix C: Programmable I/O

    A tour of Programmable I/O, the Pico's trick for implementing custom hardware protocols

Print the whole book

Projects

A sequenced introduction to the Raspberry Pi Pico and physical computing, not part of the book above and not tied to its chapter numbering. It assumes a bit more computer science or Python background, so it moves faster and stays closer to computer science concepts early on. Each project is roughly sized for a class period or two, with its own slides and a worksheet or graphic organizer to go with it, and checkpoints along the way so a teacher can check in on student progress. Under active development, fall 2026.

  1. Project 1: Three LEDs
    1. Project 1.1: Wiring Three LEDs Notes page Project 1.1 slides

      Build a three-LED circuit on your breadboard, by hand

    2. Project 1.2: Flashing MicroPython with Thonny Checklist (covers 1.2 & 1.3) Slides (covers 1.2 & 1.3)

      Get MicroPython running on your Pico for the first time, using Thonny

    3. Project 1.3: Files on Your Pico, and Your First REPL Commands

      See where your code actually lives, save a script to your Pico, and control an LED straight from the REPL

    4. Project 1.4: Blinking Your LEDs Checklist (covers 1.4 & 1.5) Slides (covers 1.4 & 1.5)

      Write your first programs for the circuit you built, then make your three LEDs count, first in unary, then in binary

    5. Project 1.5: Fading an LED with PWM

      Make an LED fade smoothly, not just switch on and off

    6. Project 1.6: Wiring a Switch Bank Slides (covers 1.6, 1.7 & 1.8)

      Add three switches to the same breadboard, ready for code in Project 1.7

    7. Project 1.7: Reading Your Switches

      Read your switches, and only print when one of them changes

    8. Project 1.8: Choosing a Program with Imports

      Import leds.py from a new file, and let your switches pick a program

  2. Project 2: Servo and Potentiometer
    1. Project 2.1: Moving a Servo

      PWM for position instead of brightness, and a reusable servo.py

    2. Project 2.2: Reading a Potentiometer, and What a Voltage Divider Is

      What a knob is actually telling the Pico

    3. Project 2.3: Adding a NeoPixel Bar

      The voltage you can already read gets something fun to control

    4. Project 2.4: Swapping in a Light Sensor

      The same code, a different kind of knob

Standards alignment

Every chapter lists the standards it supports under Standards alignment at the bottom of its own page. Everything aligned so far, across the whole book:

Projects 1.1 through 2.2 are their own content source, not part of the book above, so they’re aligned under a separate carrier: