Source: https://mokxi.com/teachers/plans/circuitpython-from-zero
Updated: 2026-11-19

Lesson plan

# CircuitPython on the Pico lesson plan

Python on real hardware, from your first code.py: LEDs and buttons, knobs and PWM, NeoPixels, I2C sensors and an OLED with displayio, all on Adafruit’s official firmware, ending in a mood light you design.

4 chapters, 7 lessons, about 5 hours, on the Raspberry Pi Pico. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- code.py, and pins that are on or off.
- Analog readings, PWM and NeoPixels.
- An I2C sensor and a screen.
- A mood light built from the whole course.

### Materials for the whole unit

- Addressable RGB LEDs
- LED
- OLED display, 128x64
- Potentiometer
- Pressure, humidity and temperature, BME280
- Pushbutton
- Raspberry Pi Pico
- Resistor

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 30 min

## First steps

code.py, and pins that are on or off.

Lesson | Time | What students do

code.py Your first CircuitPython program: print, a variable, a loop, and what happens when code.py ends. How the CIRCUITPY drive and auto-reload make every save a new run. | 45 min

- Run it: hello from Python
- A variable
- A loop
- When code.py ends
- Say your name
- On a real Pico

digitalio Pins that are on or off: an LED as an output, a button as an input with a pull-up, blinking without sleep() so the button is never missed, and counting presses. | 45 min

- Run it: a blink and a button
- An output
- An input with a pull-up
- Count presses, not loops
- Blink faster
- Sleep or monotonic

### Materials

- Addressable RGB LEDs
- LED
- OLED display, 128x64
- Potentiometer
- Pressure, humidity and temperature, BME280
- Pushbutton
- Raspberry Pi Pico
- Resistor

### Check for understanding

Each student finishes "digitalio" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Sleep or monotonic".

Chapter 2. About 1 h 10 min

## Knobs and light

Analog readings, PWM and NeoPixels.

Lesson | Time | What students do

analogio and pwmio Between on and off: read a knob as a number from 0 to 65535 with analogio, turn it into volts, and dim an LED with pwmio by switching it on and off a thousand times a second. | 35 min

- Run it: a knob and a dimmer
- Turn it up
- Dim with PWM
- Turn it round
- Analog in, analog out

NeoPixels Eight color LEDs on one wire: colors as (red, green, blue) tuples, fill and single pixels, show() to send them all, brightness, and a chase in your own color. | 35 min

- Run it: all blue
- One pixel at a time
- A chase
- Your color
- Power

### Materials

- Addressable RGB LEDs
- LED
- OLED display, 128x64
- Potentiometer
- Pressure, humidity and temperature, BME280
- Pushbutton
- Raspberry Pi Pico
- Resistor

### Check for understanding

Each student finishes "NeoPixels" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Power".

Chapter 3. About 1 h 20 min

## Sense and show

An I2C sensor and a screen.

Lesson | Time | What students do

I2C sensors Two wires, many chips: scan the I2C bus for addresses, read temperature, humidity and pressure from a BME280 with Adafruit’s library, and turn Celsius into Fahrenheit. | 45 min

- Run it: who is on the bus?
- Read the BME280
- Warm it up
- Make it humid
- Fahrenheit
- Many chips, two wires

displayio basics Text on a 128 x 64 OLED with displayio: a display, a Group of Labels, the built-in terminal font, scale, and a counter that redraws itself when its text changes. | 35 min

- Run it: a screen
- Groups and labels
- Text that updates itself
- Your title
- One way for every screen

### Materials

- Addressable RGB LEDs
- LED
- OLED display, 128x64
- Potentiometer
- Pressure, humidity and temperature, BME280
- Pushbutton
- Raspberry Pi Pico
- Resistor

### Check for understanding

Each student finishes "displayio basics" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "One way for every screen".

Chapter 4. About 1 h

## Project

A mood light built from the whole course.

Lesson | Time | What students do

Project: a mood light Everything together: a knob picks the color, a button steps through glow, breathe, rainbow and off, the BME280 turns it warm red when the room is hot, and the OLED says what it is doing. | 60 min

- Run it: a mood light
- Glow
- Change the mode
- Rainbow
- Pick a color
- Too hot
- Your own limit
- Build it for real

### Materials

- Addressable RGB LEDs
- LED
- OLED display, 128x64
- Potentiometer
- Pressure, humidity and temperature, BME280
- Pushbutton
- Raspberry Pi Pico
- Resistor

### Check for understanding

Each student finishes "Project: a mood light" on their own, without opening the hints. The simulator checks 8 of its 8 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Build it for real".

Your class

## Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
