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
Blink: the first program
Two wires from an Uno to an LED, then setup(), loop(), pinMode, digitalWrite and delay.
Learning objectives: students will be able to
- Name what setup() and loop() are for
- Set a pin as an output and drive it high and low
- Change a delay and predict the blink rate
Lesson plan
- Warm up (5 min): run First blink. Read the sketch aloud, line by line.
- Lesson (15 min): Make it blink with an Uno. Students wire it themselves.
- Lesson (20 min): Blink: the first program. Change the timing and fix a compile error on purpose.
- Close (5 min): write the blink pattern for SOS in plain English.
Ask the class
- What happens if you leave out pinMode(13, OUTPUT)?
- How many times a second does the pin change if the LED blinks five times a second?
Graded work
- Make it blink with an Uno: a lesson whose 4 steps tick against the running circuit. Assign it from your class page under A lesson.
- Blink: the first program: a lesson whose 5 steps tick against the running circuit. Assign it from your class page under A lesson.
- Rebuild First blink on your own breadboard, wired from pin 13, and hand it in. Assign First blink as a template and add these checks. Our own build passes every one:
- Check: Pin 13 blinks once a second (pin 13 on uno1 toggles every 1 s, within 50 ms, watched for 4 s).
- Check: The LED lights (the LED led1 is lit at 250 ms).
Projects to open: First blink
Vocabulary
- Sketch
- An Arduino program.
- setup()
- Runs once when the board starts.
- loop()
- Runs over and over, forever, after setup().
- Output pin
- A pin the program drives high (5 V) or low (0 V).
Standards: 2-AP-12, 2-CS-02
Week 2
More outputs, in order
Two lamps taking turns, then a traffic light sequence.
Learning objectives: students will be able to
- Drive several outputs from one program
- Write a sequence as steps with timing
- Read a sequence from serial output to debug it
Lesson plan
- Warm up (5 min): what order do traffic lights go in? Write it as a list.
- Lesson (20 min): Two outputs, taking turns.
- Lesson (20 min): Five outputs and a sequence, the pelican crossing.
- Close (5 min): flowchart the crossing on paper.
Ask the class
- Why does the WAIT lamp light instantly, even while the sketch is inside a long delay?
- With three pins and shift registers, how could you drive many more lamps?
Graded work
- Two outputs, taking turns: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Five outputs and a sequence: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: Traffic light
Vocabulary
- Sequence
- Steps that happen in a set order.
- Flowchart
- A drawing of a program’s steps and decisions.
- delay()
- Stops the program for a number of milliseconds.
- Millisecond
- One thousandth of a second.
Standards: 2-AP-10, 2-AP-12
Week 3
Inputs: buttons and pull-ups
Reading a pin, why pressed reads low, and turning a press into a toggle.
Learning objectives: students will be able to
- Read a button with digitalRead and INPUT_PULLUP
- Explain why an input must never float
- Tell a level from an edge, and debounce a press
Lesson plan
- Warm up (5 min): open Button and LED. Hold the button. Why does it read LOW?
- Lesson (20 min): Reading a pin, and the pull-up.
- Lesson (20 min): Press once for on, once for off.
- Close (5 min): explain bounce in one sentence.
Ask the class
- Why does the button read LOW when it is pressed?
- Why can one press of a real button be counted several times?
Graded work
- Reading a pin, and the pull-up: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Press once for on, once for off: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Rebuild Button and LED: a button on pin 2 to ground, an LED on pin 13. Hand it in. Assign Button and LED as a template and add these checks. Our own build passes every one:
- Check: The LED is off before anyone presses (pin 13 on uno1 reads LOW at 400 ms).
- Check: The LED goes out again when the button is let go (after pb1 is pressed at 500 ms for 300 ms: pin 13 on uno1 reads LOW at 1100 ms, by 1100 ms).
Projects to open: Button and LED
Vocabulary
- Input pin
- A pin the program reads as high or low.
- Pull-up resistor
- A resistor that holds an input high when nothing pulls it low.
- Floating
- An input connected to nothing, which reads at random.
- Debounce
- Ignoring the extra edges a mechanical switch makes.
Standards: 2-CS-02, 2-AP-12
Week 4
Variables, decisions and loops
The C++ underneath: types and sizes, if and else, and a loop over a list.
Learning objectives: students will be able to
- Create variables with suitable types and clear names
- Write an if and else that decides from a value
- Loop over a list with for
Lesson plan
- Warm up (5 min): what is the biggest number a byte can hold?
- Lesson (15 min): Variables have a size.
- Lesson (15 min): One branch runs.
- Lesson (15 min): A loop over a list.
Ask the class
- What happens when a byte variable holding 255 has 1 added to it?
- Why does only one branch of an if and else ever run?
Graded work
- Variables have a size: a lesson whose 7 steps tick against the running circuit. Assign it from your class page under A lesson.
- One branch runs: a lesson whose 7 steps tick against the running circuit. Assign it from your class page under A lesson.
- A loop over a list: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Vocabulary
- Variable
- A named place that holds a value.
- Type
- What kind of value a variable holds, and how big it can be.
- Condition
- A test that is true or false.
- for loop
- Repeats a block a counted number of times.
Standards: 2-AP-11, 2-AP-12
Week 5
Timing without delay
Ask the time instead of waiting for it: two rates at once, and a board that still listens.
Learning objectives: students will be able to
- Use millis() to run two things at different rates
- Explain why delay() makes a program unresponsive
- Keep a timestamp for each thing that repeats
Lesson plan
- Warm up (5 min): try to blink two LEDs at different rates with delay alone.
- Lesson (20 min): Two rates at once, without delay.
- Lesson (20 min): Blinking and listening at the same time.
- Close (5 min): name one real device that must never block.
Ask the class
- Why can delay() not blink two LEDs at two different rates?
- Why does millis() keep counting while a delay() is running?
Graded work
Vocabulary
- millis()
- Milliseconds since the board started.
- Blocking
- Code that stops everything else while it waits.
- Timestamp
- A saved time, to compare against later.
- Responsive
- Reacting to input quickly.
Standards: 2-AP-12, 2-AP-17
Week 6
Analog input
A voltage becomes a number from 0 to 1023, and a program decides from it.
Learning objectives: students will be able to
- Read a voltage with analogRead and convert it to millivolts
- Use a threshold to make a decision from a reading
- Explain hysteresis with an everyday example
Lesson plan
- Warm up (5 min): open Read a knob. Turn it and watch the numbers.
- Lesson (20 min): Reading a voltage.
- Lesson (20 min): Deciding from a reading, the night light.
- Close (5 min): what is one count worth, in millivolts?
Ask the class
- On a 5 V Uno, about how many millivolts is one count of analogRead?
- Why does a thermostat not switch on and off at exactly the same temperature?
Graded work
- Reading a voltage: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Deciding from a reading: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Rebuild Read a knob: a potentiometer across 5 V and ground with its wiper on A0. Hand it in. Assign Read a knob as a template and add these checks. Our own build passes every one:
- Check: The monitor prints the A0 reading (the serial monitor prints a line matching /A0 = \d+/ within 1500 ms).
Projects to open: Read a knob · Night light
Vocabulary
- Analog
- A value that can be anything in a range, not just on or off.
- ADC
- Analog-to-digital converter: turns a voltage into a number.
- Threshold
- The value where a decision changes.
- Hysteresis
- Two thresholds, one going up and one going down, to stop flickering.
Standards: 2-CS-02, 2-DA-08
Week 7
PWM, light and sound
Brightness from a digital pin, a breathing LED and a melody on a piezo.
Learning objectives: students will be able to
- Define duty cycle and relate it to brightness
- Use analogWrite on a PWM pin
- Play notes with tone() and noTone() from a list
Lesson plan
- Warm up (5 min): run Fade an LED. How does a digital pin make in-between brightness?
- Lesson (20 min): Brightness from a digital pin.
- Build (20 min): open Piezo melody and rewrite the tune.
- Close (5 min): what does a 25 percent duty cycle average to on 5 V?
Ask the class
- What average voltage does a 25 percent duty cycle give on a 5 V pin?
- In Piezo melody, why is there a short gap after every note?
Graded work
- Brightness from a digital pin: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Rebuild Fade an LED: an LED and 220 ohm resistor on pin 9, breathing with analogWrite. Hand it in. Assign Fade an LED as a template and add these checks. Our own build passes every one:
- Check: Pin 9 switches at the Uno’s PWM rate (pin 9 on uno1 carries PWM at 490 Hz, within 20 Hz).
Projects to open: Fade an LED · Piezo melody · RGB color mixer
Vocabulary
- PWM
- Pulse width modulation: switching fast so the average sets the level.
- Duty cycle
- The percentage of time a pin is high.
- Frequency
- How many times a second something repeats, in hertz.
- Piezo
- A small speaker that clicks with each voltage change.
Standards: 2-AP-12, 2-AP-16
Week 8
Serial and functions
Printing to the monitor, taking commands, and writing a function once.
Learning objectives: students will be able to
- Print values to the serial monitor and read characters back
- Act on a typed command
- Write a function with parameters and call it
Lesson plan
- Warm up (5 min): what would you want a board to tell you while it runs?
- Lesson (15 min): Making the board talk.
- Lesson (15 min): Taking commands.
- Lesson (15 min): Write it once, a function.
Ask the class
- Why does printing a long line take real time at a given baud rate?
- What makes a function with parameters easier to reuse than copied code?
Graded work
- Making the board talk: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Taking commands: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Write it once: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: Reaction timer
Vocabulary
- Serial monitor
- A window that shows what the board prints, and sends what you type.
- Baud rate
- How many bits a second a serial line carries.
- Function
- A named block of code you can call.
- Parameter
- A value handed to a function when it is called.
Standards: 2-AP-14, 2-CS-02
Week 9
Final project
Plan a build as inputs, processing and outputs, build it, test it, and present it as a link.
Learning objectives: students will be able to
- Plan a project as inputs, processing and outputs before wiring
- Use one variable to track what state a program is in
- Test a project against its own requirements and refine it
Lesson plan
- Plan (1 period): pick a brief (a reaction game, a metronome, a night light that fades, or their own) and list inputs, processing and outputs.
- Lesson (1 period): One variable that says where you are, the state machine.
- Build and test (2 to 3 periods): build it, write three tests it must pass, and fix what fails.
- Present (1 period): a two-minute demo from the shared link.
Ask the class
- What states does your project have, and what moves it from one to the next?
- Which of your tests failed first, and what did you change?
Graded work
Projects to open: Reaction timer · Metronome · Electronic dice
Vocabulary
- State machine
- A program that is always in one named state, with rules for moving between them.
- Requirement
- Something the finished project must do.
- Test case
- A specific input and the result it should give.
- Iteration
- Improving a design by testing and changing it again.
Standards: 3A-AP-13, 3A-AP-17, 2-AP-17, 2-AP-15