Build a pinball table lesson plan
From two flipper buttons to a full table with a kicker, lights, sound and a saved high score, on a Mega.
Objectives and materials
By the end, students can
- Flippers that answer, and targets that score once per hit.
- Fire a 12 V coil safely, then add lights and a tune that never wait.
- Tie it all together in a state machine with a high score that survives a reset.
Materials for the whole unit
- Addressable RGB LEDs
- Arcade button x 3
- Arduino Mega 2560 R3
- Bench power supply
- Diode
- Four-digit display, TM1637
- Full-size breadboard
- Half breadboard
- MOSFET
- Piezo speaker
- Pinball table
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.
The playfield
Flippers that answer, and targets that score once per hit.
| Lesson | Time | What students do |
|---|---|---|
| Pinball: flippers that answerTwo arcade buttons and the table’s two flipper servos on a Mega. Read a button with the chip’s own pull-up and move a flipper the moment it changes. | 65 min |
|
| Pinball: targets and a scoreThe table’s three standup targets and a four-digit TM1637. Count a hit once, however much the switch bounces, and reward the whole bank. | 65 min |
|
Materials
- Arcade button x 2
- Arduino Mega 2560 R3
- Four-digit display, TM1637
- Full-size breadboard
- Half breadboard
- Pinball table
Check for understanding
Each student finishes "Pinball: targets and a score" 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: "Finish the bank".
Power and show
Fire a 12 V coil safely, then add lights and a tune that never wait.
| Lesson | Time | What students do |
|---|---|---|
| Pinball: a bumper that kicksA pop bumper switch fires the table’s 12 V kicker coil through a logic-level MOSFET, with a diode across the coil. Big current from a small pin, safely. | 50 min |
|
| Pinball: lights and soundSixteen WS2812 lamps and a piezo. Run an attract-mode rainbow and play a tune at the same time, with nothing ever waiting. | 50 min |
|
Materials
- Addressable RGB LEDs
- Arcade button
- Arduino Mega 2560 R3
- Bench power supply
- Diode
- Full-size breadboard
- Half breadboard
- MOSFET
- Piezo speaker
- Pinball table
Check for understanding
Each student finishes "Pinball: lights and sound" 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: "Hear it".
The game
Tie it all together in a state machine with a high score that survives a reset.
| Lesson | Time | What students do |
|---|---|---|
| Pinball: the whole tableEverything together in a state machine: attract, launch, play, drain, game over and high score entry, with the best score kept in EEPROM. | 75 min |
|
Materials
- Addressable RGB LEDs
- Arcade button x 3
- Arduino Mega 2560 R3
- Bench power supply
- Diode
- Four-digit display, TM1637
- Full-size breadboard
- Half breadboard
- MOSFET
- Piezo speaker
- Pinball table
Check for understanding
Each student finishes "Pinball: the whole table" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Set a high score".
Teach this unit as a class
Start a class from this course and its 5 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.