Lesson plan

Build an elevator lesson plan

A four-floor model lift on a stepper: calls and the elevator algorithm, a state machine, homing a lead screw hoist, doors with an eye, a safety chain, and a rush hour to measure it.

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

  • Latched calls, the elevator algorithm and its direction preference, and a state machine that says what it is doing.
  • Steps per millimeter, homing and a top limit, and doors that reopen and nudge.
  • Inhibits, the safety chain, faults and a watchdog, then the whole lift in a rush hour.

Materials for the whole unit

  • Arduino Uno R3
  • Four-digit display, TM1637
  • Hobby servo
  • Limit switch, lever microswitch x 3
  • Obstacle sensor, FC-51
  • Pushbutton x 4
  • Stepper driver, A4988
  • Stepper motor, NEMA 17

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

Calls and states

Latched calls, the elevator algorithm and its direction preference, and a state machine that says what it is doing.

LessonTimeWhat students do
Floors and callsFour call buttons on a model lift: calls that are remembered until served, stops made on the way, the elevator algorithm against first come first served, and why a car going up finishes going up.55 min
  1. Run it
  2. Call the car
  3. Stop on the way
  4. Two ways to choose
  5. Going up stays up
A state machineIDLE, MOVING and DOORS_OPEN, and the events that move between them: a call, an arrival, a dwell that runs out, a call that comes in while the doors are open, and a call at the floor the car is already on.55 min
  1. IDLE to MOVING
  2. Arrive, open
  3. Back to IDLE
  4. A call while the doors are open
  5. A call where you are

Materials

  • Arduino Uno R3
  • Four-digit display, TM1637
  • Hobby servo
  • Limit switch, lever microswitch x 3
  • Obstacle sensor, FC-51
  • Pushbutton x 4
  • Stepper driver, A4988
  • Stepper motor, NEMA 17

Check for understanding

Each student finishes "A state machine" 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: "A call where you are".

Chapter 2. About 2 h 25 min

The hoist and the doors

Steps per millimeter, homing and a top limit, and doors that reopen and nudge.

LessonTimeWhat students do
Steppers and homingA stepper hoist on an 8 mm lead screw: steps per millimeter and a floor table, refusing to move blind, homing to a bottom switch with a backoff and a slow touch, a drift check, and a normally closed top limit.90 min
  1. Run it
  2. Steps to floors
  3. Refuse to move blind
  4. Home it
  5. Go to a floor
  6. Check for drift
  7. The top limit
  8. A finer screw
DoorsDoors that open on arrival, dwell and close; an infrared eye across the doorway that reopens them; nudging after three tries; and the dwell time set for the people using the lift.55 min
  1. Open on arrival
  2. Dwell and close
  3. Something in the doorway
  4. Nudging
  5. Doors for people

Materials

  • Arduino Uno R3
  • Four-digit display, TM1637
  • Hobby servo
  • Limit switch, lever microswitch x 3
  • Obstacle sensor, FC-51
  • Pushbutton x 4
  • Stepper driver, A4988
  • Stepper motor, NEMA 17

Check for understanding

Each student finishes "Doors" 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: "Doors for people".

Chapter 3. About 1 h 40 min

Safety and the project

Inhibits, the safety chain, faults and a watchdog, then the whole lift in a rush hour.

LessonTimeWhat students do
SafetyThe rules that come before the logic: no motion with the doors open, a normally closed safety chain that stops the car dead, a fault that only a person can clear, overtravel, and a watchdog on every move.55 min
  1. No motion with the doors open
  2. The safety chain
  3. Only a person clears it
  4. Overtravel
  5. The watchdog
Project: a four-floor modelThe whole lift in service: home it, call it from the buttons, run a scripted rush hour that measures floors traveled and waiting times, then switch to first come first served and compare.45 min
  1. Into service
  2. Ride to the top
  3. Rush hour
  4. First come, first served

Materials

  • Arduino Uno R3
  • Four-digit display, TM1637
  • Hobby servo
  • Limit switch, lever microswitch x 3
  • Obstacle sensor, FC-51
  • Pushbutton x 4
  • Stepper driver, A4988
  • Stepper motor, NEMA 17

Check for understanding

Each student finishes "Project: a four-floor model" 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: "First come, first served".

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.