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.
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.
Feel the pieces
Reed switches under the squares, and moves from lifts and places.
| Lesson | Time | What students do |
|---|---|---|
| Reed square matrixRead 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 |
|
| Move detectionTurn 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 |
|
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".
Know the rules
Every legal move, and lights that show them.
| Lesson | Time | What students do |
|---|---|---|
| Legal movesTeach 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 |
|
| LED hintsLight 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 |
|
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".
Play the board
A small engine with alpha-beta, then the finished board.
| Lesson | Time | What students do |
|---|---|---|
| A chess engineGive 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 |
|
| Project: play the boardThe 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 |
|
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".
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.