Main Content

Challenge yourself by trying to beat the computer in this rendition of the 1970’s classic game of Connect 4 by Milton Bradley / Hasbro.

It was a simple game played by two players. Each player takes turns to put their colored tile into one of the seven columns. The object of the game is to be the first player to have four of your colored tiles in a row either vertically, horizontally or diagonally.

Design
The game is designed around a 8x8 WS2812B LED Matrix panel. Since the Connect Four “game board” is made up of 7 columns by 6 rows, one of the extra rows is used to highlight the column you want to “drop” your tile into. A 3D printed bezel hides the unused LEDs.

Column selection is made using a rotary encoder. Pressing the rotary encoder will “drop” your colored tile in the selected column.

The software uses the Monte Carlo Tree Search algorithm to determine its move. This provides a good challenge for the player.

The “brains” is a ATtiny3224 microprocessor. The rotary encoder contacts are hardware debounced using a simple RC network and Schmitt trigger.

Power is feed through a DC-DC Buck Step Down Module 3A Adjustable Voltage Regulator Power set to 5.0V.

Building the case
3D printing was done using a 0.2mm layer height. Supports touching the build plate should be used on “Four - Holder.stl”.

The case incorporates the rotary switch holder and knob designed by smily77 for their Alarm Clock - Simplicity project.

Building the electronics
All the electronics are mounted on a PCB. As the ATtiny3224 only comes in a SMD package, SMD devices have been used for the resistors and small capacitors. The Eagle files have been included should you wish to get the board commercially made or you can make it yourself. I used the Toner method to make mine.”

Link to article