Source: https://mokxi.com/teachers/plans/build-a-pinball-table
Updated: 2026-11-11

Lesson plan

# 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.

3 chapters, 5 lessons, about 5 hours, on the Arduino Mega 2560. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## 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.

Chapter 1. About 2 h 10 min

## The playfield

Flippers that answer, and targets that score once per hit.

Lesson | Time | What students do

Pinball: flippers that answer Two 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

- Meet the cabinet
- Raise the left flipper
- And the right one
- Why pressed reads LOW
- Let go

Pinball: targets and a score The 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

- Three targets
- Hit target A
- Put it on the display
- One hit, one score
- Finish the bank

### 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".

Chapter 2. About 1 h 40 min

## 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 kicks A 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

- A pin cannot do this alone
- Kick
- The MOSFET does the lifting
- Every hit, every time

Pinball: lights and sound Sixteen WS2812 lamps and a piezo. Run an attract-mode rainbow and play a tune at the same time, with nothing ever waiting. | 50 min

- Attract mode
- Every lamp lit
- Press START
- Hear it

### 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".

Chapter 3. About 1 h 15 min

## 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 table Everything together in a state machine: attract, launch, play, drain, game over and high score entry, with the best score kept in EEPROM. | 75 min

- The finished table
- Start a game
- Play the bank
- Ball save
- Lose a ball
- Set a high score

### 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".

Your class

## 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.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
