Week by week
Each week has a lesson plan, objectives, the questions to ask, the graded work and the vocabulary. The minutes are a guide.
Week 1
First light on the ESP32-C3
A new board at 3.3 V, a GPIO number instead of a pin label, and a moving dot on six pins.
Learning objectives: students will be able to
- Blink an LED on an ESP32-C3 GPIO
- Explain what changes moving from a 5 V board to a 3.3 V one
- Drive several GPIOs from an array
Lesson plan
- Warm up (5 min): compare the Uno and the ESP32-C3 side by side. What is different?
- Lesson (20 min): First light on the C3.
- Lesson (20 min): Six pins and a moving dot.
- Close (5 min): list two things the ESP32 has that the Uno does not.
Ask the class
- Why might an LED resistor that suits a 5 V Uno be a different value on a 3.3 V board?
- What does storing the six pin numbers in an array let the code do?
Graded work
- First light on the C3: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Six pins and a moving dot: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: Knight Rider
Vocabulary
- ESP32
- A family of microcontrollers with WiFi built in.
- GPIO
- General-purpose input/output: a pin the program controls.
- 3.3 V logic
- A board whose high level is 3.3 volts, not 5.
- Array
- A numbered list of values under one name.
Standards: 2-CS-02, 2-AP-11
Week 2
Inputs and interrupts
A button at 3.3 V, and a handler that runs the instant a pin changes.
Learning objectives: students will be able to
- Read a button on the ESP32 with a pull-up
- Attach an interrupt to a pin edge
- Explain what an interrupt costs and when to use one
Lesson plan
- Warm up (5 min): what happens to a button press while the board is busy?
- Lesson (20 min): Reading a pin at 3.3 V.
- Lesson (20 min): Interrupts, and what they cost.
- Close (5 min): one sentence on volatile.
Ask the class
- Why is a variable shared with an interrupt handler marked volatile?
- Why should an interrupt handler be short?
Graded work
- Reading a pin at 3.3 V: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Interrupts, and what they cost: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: ESP32-C3 button
Vocabulary
- Interrupt
- A signal that makes the processor run a handler right away.
- Handler
- The function an interrupt runs.
- Edge
- The moment a signal changes from low to high, or high to low.
- volatile
- Tells the compiler a variable can change outside normal code.
Standards: 2-CS-02, 3B-CS-02
Week 3
Data out, commands in
The board prints readings and takes typed commands: the start of every connected device.
Learning objectives: students will be able to
- Print structured readings over serial
- Parse a typed command and act on it
- Read two sensors on one I2C bus
Lesson plan
- Warm up (5 min): what would a weather station need to send, and how often?
- Lesson (15 min): The board talks.
- Lesson (15 min): The board listens.
- Explore (15 min): open Two barometers. Two sensors share two wires; how are they told apart?
Ask the class
- How can two sensors share the same two I2C wires?
- Why is it useful to print readings in a fixed, labeled format?
Graded work
- The board talks: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- The board listens: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: Two barometers
Vocabulary
- Sensor
- A part that turns something in the world into a signal.
- I2C
- A two-wire bus that connects several chips by address.
- Address
- The number that picks one chip on a shared bus.
- Parse
- Read text and pull out its meaning.
Standards: 2-DA-08, 2-CS-02
Week 4
Joining a network
The connect loop every ESP32 tutorial opens with, on a network that only exists in the tab.
Learning objectives: students will be able to
- Write the WiFi connect loop and report its status
- Handle a wrong password or a missing network
- Explain what an IP address is for
Lesson plan
- Warm up (5 min): what has to happen before a device can send anything on WiFi?
- Build (25 min): open WiFi: join the network. Change the password and read the status it reports.
- Discuss (10 min): why the simulated network is safer for a class than the school one.
- Close (5 min): list the statuses the sketch can print.
Ask the class
- What does the sketch print when the password is wrong, and why is that useful?
- What is an IP address for?
Graded work
- Rebuild WiFi: join the network on an ESP32-C3 and hand it in once it reports that it is connected. Assign WiFi: join the network as a template and add these checks. Our own build passes every one:
- Check: The board reports it is connected (the serial monitor prints a line matching /connected/ within 9 s).
Projects to open: WiFi: join the network
Vocabulary
- WiFi
- A way for devices to join a network by radio.
- SSID
- The name of a WiFi network.
- IP address
- The number that identifies a device on a network.
- Status
- A value that reports what state the connection is in.
Standards: 2-NI-04, HS-PS4-2
Week 5
A web page that controls a lamp
The ESP32 serves a page with two buttons; press one and the LED on the breadboard follows.
Learning objectives: students will be able to
- Describe a request and a response in HTTP
- Serve a page from the board and act on a request
- Inspect the requests a page makes
Lesson plan
- Warm up (5 min): what happens when you type an address into a browser?
- Build (25 min): open WiFi: a lamp on a web page. Press On in the Web panel and watch the lamp.
- Extend (15 min): add a third button that blinks the lamp.
- Close (5 min): draw the request and the response on paper.
Ask the class
- When you press On, what travels from the browser to the board, and what comes back?
- Why should a device like this not be reachable from the whole internet without protection?
Graded work
- Rebuild WiFi: a lamp on a web page and hand it in with the page serving its On button. Assign WiFi: a lamp on a web page as a template and add these checks. Our own build passes every one:
- Check: The board serves a page with an On button (the page esp1 serves at / contains “On” within 9 s).
Projects to open: WiFi: a lamp on a web page
Vocabulary
- HTTP
- The protocol a browser and a web server talk in.
- Request
- What a browser asks a server for.
- Response
- What the server sends back.
- Web server
- A program that answers HTTP requests.
Standards: 2-NI-04, 2-NI-05, 3A-AP-16
Week 6
Calling an API, and a connected project
Fetch JSON from a simulated service, then design a small connected device of their own.
Learning objectives: students will be able to
- Make an HTTP request and read a value from JSON
- Explain what an API is and why a key must stay secret
- Discuss what data a connected device collects, and who sees it
Lesson plan
- Warm up (5 min): name a device at home that talks to the internet. What does it send?
- Build (20 min): open WiFi: fetch the weather. Turn the dial in the Cloud panel and watch the next fetch.
- Build (20 min): API lab. Edit the JSON response and see what the sketch does with it.
- Project (two periods): a connected device to a brief, with one paragraph on the data it collects.
Ask the class
- What happens when the sketch asks a real internet address, and why?
- What data could a connected device collect that its user might not notice?
Graded work
- Rebuild WiFi: fetch the weather on an ESP32-C3 and hand it in once a fetch succeeds. Assign WiFi: fetch the weather as a template and add these checks. Our own build passes every one:
- Check: A request to the weather service succeeds (the serial monitor prints a line matching /HTTP 200/ within 12 s).
Projects to open: WiFi: fetch the weather · API lab: fetch JSON
Vocabulary
- API
- A set of requests a service answers, for programs to use.
- JSON
- A text format for structured data.
- API key
- A secret that identifies who is calling an API.
- Privacy
- Control over who collects and sees information about you.
Standards: 3B-AP-16, 3A-IC-29, HS-ETS1-2