What the course teaches
Build an elevator is six lessons on the Uno, in three chapters:
- Calls and states: latched calls, stops made on the way, the elevator algorithm against first come first served, its direction preference, and a state machine (IDLE, MOVING, DOORS_OPEN) that prints every transition.
- The hoist and the doors: steps per millimeter on a lead screw, a floor table, refusing to move blind, homing to a bottom switch with a backoff, a drift check and a normally closed top limit; doors that dwell, reopen for an infrared eye and nudge after three tries.
- Safety and the project: a door-open inhibit, a normally closed safety chain that stops the car on any step, faults only a person can clear, overtravel, a travel watchdog, and the project, the whole lift homed, in service and run through a rush hour.
Each chapter ends in a short quiz. Open it from /learn.
The circuit
Every lesson runs a sketch written for the course (elevlogic, elevhome,
elevfull) on one circuit, the four-floor elevator:
- a NEMA 17 on an A4988 at full step (STEP 3, DIR 4, EN 8) turning an 8 mm lead screw: 25 steps a millimeter, floors 40 mm apart
- a home switch at the bottom (NO to A0), and a top limit (NC to A1) and a landing door lock (NC to A2) forming the safety chain
- a call button per floor on pins 2, 5, 6 and 7
- the doors on a servo on pin 9, and an FC-51 eye across the doorway on A3
- a TM1637 floor display, CLK 10 and DIO 11
The checks read the display's lit segments, the door servo's angle and what the sketch prints. Mokxi has no car, so you play it on the home switch while it homes.
Troubleshooting
- The car will not move. It is not homed. Type home and click the home switch when it seeks, or type here 1 on the bench.
- It says FAULT. A switch in the safety chain was pressed. Let go of it, type reset, then home again.
- It says inhibit. The doors are held open: type release.
- The doors keep reopening. The eye sees something. Slide its distance back to 80 cm.
Related
Stepper motion planning for ramps and homing in depth, and Motors and motion for stepper basics.