Lesson plan

Build a parking assistant lesson plan

A garage stop light from scratch: an ultrasonic sensor that measures with sound, LEDs that turn green, yellow and red, smoothing for messy echoes, sleep when the car is parked, and notes for mounting it for real.

3 chapters, 6 lessons, about 4 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

  • Distance from a chirp and an echo, then a stick of LEDs that shows it as zones.
  • Averaging, a hold for missed echoes, and a light that sleeps when the car is parked.
  • Where to mount it, what the cold does to sound, and the finished garage stop light.

Materials for the whole unit

  • Addressable RGB LEDs
  • Arduino Uno R3
  • Buzzer
  • Full-size breadboard
  • LED
  • Resistor
  • Ultrasonic ranger

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

Measure and show

Distance from a chirp and an echo, then a stick of LEDs that shows it as zones.

LessonTimeWhat students do
Measure distance with soundAn ultrasonic sensor measures distance like a bat: a chirp, an echo, and a stopwatch. Move the wall, read the distance, and move the stop line.45 min
  1. Run it
  2. A chirp and an echo
  3. Faster beeps
  4. The stop line
  5. Move the stop line
Colors for zonesSwap the buzzer for a light you can read through a windshield: a stick of eight LEDs that shows green, yellow and red as the car comes in.45 min
  1. Green: keep coming
  2. Count the LEDs
  3. Yellow: slow down
  4. Red: stop
  5. Fit your garage

Materials

  • Addressable RGB LEDs
  • Arduino Uno R3
  • Buzzer
  • Full-size breadboard
  • LED
  • Resistor
  • Ultrasonic ranger

Check for understanding

Each student finishes "Colors for zones" 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: "Fit your garage".

Chapter 2. About 1 h 10 min

Steady and smart

Averaging, a hold for missed echoes, and a light that sleeps when the car is parked.

LessonTimeWhat students do
SmoothingReal echoes are messy: one bad reading and the light flickers. Average a few readings, ride out a missed echo, and find out what smoothing costs.35 min
  1. A flicker
  2. Average a few
  3. Smoothing costs time
  4. Ride out a missed echo
Sleep when emptyA stop light that glows red all night wastes power and lights up the garage. Turn the LEDs off when the car has stopped, and back on when it moves.35 min
  1. Parked, and still red
  2. What it costs
  3. Go to sleep
  4. Wake up

Materials

  • Addressable RGB LEDs
  • Arduino Uno R3
  • Ultrasonic ranger

Check for understanding

Each student finishes "Sleep when empty" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

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

Chapter 3. About 1 h 10 min

Build it

Where to mount it, what the cold does to sound, and the finished garage stop light.

LessonTimeWhat students do
Mounting notesWhere the sensor goes decides whether it works: bumper height, aimed level, away from shelves. Plus a cold garage, where sound is slower and every reading is off.35 min
  1. Bumper height
  2. A cold garage
  3. Tell it the temperature
  4. Plan your install
Project: a garage stop lightPut it all together: a light that guides the car in, flashes if you go too far, ignores a bad echo, and goes to sleep once you have parked.35 min
  1. Drive in
  2. Too close: flash
  3. Your settings
  4. Morning

Materials

  • Addressable RGB LEDs
  • Arduino Uno R3
  • Ultrasonic ranger

Check for understanding

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

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

Your class

Teach this unit as a class

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