Three-Floor Elevator Controller

On an Arduino Nano 33 BLE, control a small three-floor lift: remember floor calls, keep the car's direction and stop at called floors on the way, time the travel and the door, and drive the indicator panel lamps correctly.

Board
Nano 33 BLE · Arduino
Difficulty
Hard
Topic
Timing & Program Flow
Access
Full plan

The task

Three-Floor Elevator Controller

A shop on three floors installs a small goods lift. Staff call it with one button per floor. A naive controller serves calls in the order they were pressed and makes the car shuttle past floors where someone is waiting. This one must work like a real lift: keep going in its direction and stop on the way. Times are shortened for the bench, and this is a programming exercise on an emulated board, not a certified lift controller.

Hardware

  • Arduino Nano 33 BLE (nRF52840, 3.3 V logic). Serial console on Serial1 (D0/D1), 115200 baud. Serial is USB and is not seen by the tests.
  • Call buttons for floors 1, 2, 3 on D2, D3, D5, each to GND. Use the internal pull-ups (LOW = pressed). A press counts once, after 20 ms without a break, however long the button is held.
  • Lift indicator panel (lamps with resistors on board, HIGH = on): floor lamps F1 on D4, F2 on D6, F3 on D8; UP arrow on D9, DOWN arrow on D10; DOOR lamp (door open) on D11.
  • The car takes 500 ms to move one floor. The door stays open for 700 ms.

Write the sketch in sketch/sketch.ino. In setup() open Serial1 at 115200 baud, set up the pins and the start-up lamps, then print READY. Never block with delay(): calls can come at any moment.

This is the opening of the task. Sign in with the full plan to read the rest and solve it.

What you get

  • Your firmware is built and run on an emulated board and checked by hardware-level tests.
  • A written walkthrough of the solution.
  • No development board or local toolchain needed.

New to embedded? Start with the roadmap: How to learn embedded systems