Source: https://mokxi.com/teachers/plans/build-electronic-chessboard
Updated: 2026-11-19

Lesson plan

# Build an electronic chessboard lesson plan

Build a chessboard that knows where every piece is: reed switches and an expander, move detection, the rules, LED hints and a small engine to play.

3 chapters, 6 lessons, about 6 hours, on the Arduino Uno R3. 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

- Reed switches under the squares, and moves from lifts and places.
- Every legal move, and lights that show them.
- A small engine with alpha-beta, then the finished board.

### Materials for the whole unit

- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- I/O expander, MCP23017
- Reed switch x 16

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

## Feel the pieces

Reed switches under the squares, and moves from lifts and places.

Lesson | Time | What students do

Reed square matrix Read the squares of a chessboard: a reed switch under each, a magnet in every piece, and sixteen of them in one I2C read through an MCP23017. | 60 min

- Sixty four switches
- Put a piece on e4
- A light under it
- Lift it
- Two pieces, no ghosts

Move detection Turn reed events into moves: a lift and a place, a piece put back, and a capture made of two lifts, with every square debounced first. | 60 min

- A move is two events
- Set a piece down
- Lift and place
- Changed your mind
- A capture

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- I/O expander, MCP23017
- Reed switch x 16

### Check for understanding

Each student finishes "Move detection" 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 capture".

Chapter 2. About 2 h

## Know the rules

Every legal move, and lights that show them.

Lesson | Time | What students do

Legal moves Teach the board the rules: a 0x88 board, every piece's moves, a king that may never be left in check, and checkmate and stalemate. | 60 min

- Twenty moves
- Play e2e4
- Not like that
- Twenty nine
- The quickest mate

LED hints Light the board: every piece dim, the last move in blue, and when a piece is picked, every square it may legally go to in green. | 60 min

- The position in lights
- Where can it go?
- Count the lights
- A king with nowhere to go
- The last move

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- I/O expander, MCP23017
- Reed switch x 16

### Check for understanding

Each student finishes "LED hints" 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: "The last move".

Chapter 3. About 2 h 10 min

## Play the board

A small engine with alpha-beta, then the finished board.

Lesson | Time | What students do

A chess engine Give the board a mind: an evaluation, negamax with alpha-beta pruning three plies deep, captures first, and an honest look at how weak three plies is. | 60 min

- Play against it
- Its first reply
- Alpha-beta
- A free bishop
- Your move again

Project: play the board The finished board: moves from the reeds or the keyboard, LED hints, the engine's replies, a hint for you, and a fresh game when you want one. | 70 min

- Set up
- Ask for a hint
- Open the game
- Move it by hand
- A new game
- Share your board

### Materials

- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- I/O expander, MCP23017
- Reed switch x 16

### Check for understanding

Each student finishes "Project: play the board" 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: "Share your board".

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.

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.
