Lesson plan

Interactive devices on the Uno lesson plan

Read people and sensors without blocking, control an output, then finish with two playable builds.

4 chapters, 9 lessons, about 8 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

The unit

Objectives and materials

By the end, students can

  • Wire a button correctly and turn a changing level into one deliberate action.
  • Measure elapsed time so one job never makes the board deaf to another.
  • Turn a changing voltage into a stable decision and a proportional output.
  • Use inputs, timing and feedback together in two projects you can play.

Materials for the whole unit

  • Arduino Uno R3
  • Buzzer
  • Full-size breadboard
  • LED x 2
  • Piezo speaker
  • Pushbutton x 2
  • Resistor x 4
  • Slide switch

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 50 min

Read intent

Wire a button correctly and turn a changing level into one deliberate action.

LessonTimeWhat students do
Reading a pin, and the pull-upA button with no resistor of its own, an input that must never float, and why pressed reads low. The single most common wiring in embedded work.55 min
  1. Why pressed means low
  2. Watch the pin go low
  3. And the lamp follows
  4. Check the pin rather than the lamp
  5. Turn it upside down
  6. The three wirings, and when to use each
Press once for on, once for offThe difference between a level and an edge, a variable that remembers, and the debounce window that makes a mechanical switch usable.55 min
  1. A level is not an event
  2. Run it
  3. One press, one change
  4. And the lamp agrees
  5. And off again
  6. What the debounce window costs

Materials

  • Arduino Uno R3
  • Full-size breadboard
  • LED
  • Pushbutton
  • Resistor

Check for understanding

Each student finishes "Press once for on, once for off" 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: "What the debounce window costs".

Chapter 2. About 1 h 50 min

Stay responsive

Measure elapsed time so one job never makes the board deaf to another.

LessonTimeWhat students do
Two rates at once, without delayThe pattern that unlocks everything else: keep when each thing last happened, and ask the time instead of waiting for it.55 min
  1. Why delay cannot do this
  2. Run it and count the red one
  3. And the green one
  4. Both lamps, both wired
  5. Change one rate
  6. Two details that are not optional
Blinking and listening at the same timeThe payoff for non-blocking code: a board that keeps a rhythm and still answers a button in microseconds. Feel the difference by breaking it.55 min
  1. One loop, two jobs
  2. The blink keeps its rhythm
  3. And the button still gets through
  4. The second lamp follows your finger
  5. Count five
  6. Break it on purpose

Materials

  • Arduino Uno R3
  • Full-size breadboard
  • LED x 2
  • Pushbutton
  • Resistor x 2

Check for understanding

Each student finishes "Blinking and listening at the same time" 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: "Break it on purpose".

Chapter 3. About 2 h 45 min

Sense and act

Turn a changing voltage into a stable decision and a proportional output.

LessonTimeWhat students do
Reading a voltageThe ADC turns a voltage into a number from 0 to 1023. Build a divider, read two taps of it, and work out what a count is worth.55 min
  1. What an ADC does
  2. Read the top tap
  3. And what it is in volts
  4. Move the tap
  5. Change the chain and predict the answer
  6. What you would actually put there
Deciding from a readingA lamp that fades up when the sensor says dark, and an indicator that does not. What a threshold is, why a ramp looks better than a jump, and where hysteresis comes in.55 min
  1. The sensor, and what stands in for it
  2. Run it, and make it dark
  3. And the lamp comes up
  4. Read the log
  5. Let it go
  6. The problem a threshold has
Brightness from a digital pinEight duty cycles on pin 9 next to a pin that can only be on or off. What PWM is, which pins have it, and what it is not good for.55 min
  1. A pin has two states, so how is there a middle
  2. Watch the steps
  3. Full brightness
  4. The pin with no timer
  5. Make the sweep fast
  6. What PWM is not for

Materials

  • Arduino Uno R3
  • Full-size breadboard
  • LED x 2
  • Pushbutton
  • Resistor x 4
  • Slide switch

Check for understanding

Each student finishes "Brightness from a digital pin" 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: "What PWM is not for".

Chapter 4. About 1 h 50 min

Finished builds

Use inputs, timing and feedback together in two projects you can play.

LessonTimeWhat students do
Project: a reaction timerA lamp at a random moment, a button, and the milliseconds in between. Randomness, measuring time, and catching a cheat.55 min
  1. The plan before the wiring
  2. Run it and read the rules
  3. Cheat, and get caught
  4. Wait for the lamp
  5. Take your time
  6. Make it yours
Project: a metronomeA click on a piezo, a lamp on the beat, and two buttons that change the tempo without missing one. Making a note out of a pin.55 min
  1. A note is a pin toggling
  2. Run it and listen
  3. A lamp on every beat
  4. Speed it up
  5. And slow it down
  6. What the click costs, and what to add

Materials

  • Arduino Uno R3
  • Buzzer
  • Full-size breadboard
  • LED
  • Piezo speaker
  • Pushbutton x 2
  • Resistor

Check for understanding

Each student finishes "Project: a metronome" 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: "What the click costs, and what to add".

Your class

Teach this unit as a class

Start a class from this course and its 9 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.