Skip to content
All prices US$ - All orders receive free delivery, worldwide - Click here to learn more
All prices US$ - All orders receive free delivery, worldwide - Touch here to learn more
Connect Fore: A Putting Connect Four Game with an AI Opponent

Connect Fore: A Putting Connect Four Game with an AI Opponent

from hackster.io

The board game Connect Four has been around for decades now, and there have been countless variations of it. But none are as entertaining as this project by the maker known as Bithead. Its rules are fairly basic: line up four of your tokens in the same row, column, or diagonal to win. Except this has a twist, as the player must putt the golf ball into their desired column.



The play area is a rectangle that has an artificial green grass area rug as its surface, with a wooden frame surrounding it.

At the front is where the player stands to putt the ball across the surface, along with several dispensers to dole out golf balls. The middle contains the matrix that balls fall into, and it can be seen from the top through its transparent shield. Finally, a series of seven holes sit at the end to catch the golf balls and route them to their correct destinations.



Underneath this surface is where most of the electronics sit. The main computer is an Intel NUC that runs the game and controls some of the other hardware. There's a large ATX power supply that provides sufficient current to both the boards and the motors. At each hole sits a PVC pipe that transfers the golf ball into the connect matrix, as well as an eject mechanism at the end to release the balls after the game is over.



It would be quite tedious if the player were forced to go somewhere else to get their golf ball and then place it manually, which is why Bithead wanted to add a mechanism for dispensing them automatically. He began with a basic mini golf training toy by mounting it to the top of some platforms. He then added a pair of solenoids that are able to quickly retract and then return to their original positions to let a single ball out. In order to make it all look a bit more exciting, he also added a string of WS2812B LEDs around the edges of each tower.



The most intriguing part of this project is the autonomous opponent that physically competes against the human player. Depending on the AI's level, it will make intelligent choices of which column to aim for. There's a powerful dispenser located at the front of the playing field that contains a laser and a dispenser similar to the ones described above. However, this one also houses a pair of brushed DC motors that spin up and launch the ball towards the desired target. It even has a green laser that shows exactly where it's aiming.



The game needs to know which colored ball is where at any given time, so Bithead wired together a total of 42 (seven columns x six rows) TCS34725 color sensors with one TCA9548A multiplexer for each column to avoid running out of unique I2C addresses. This lets a single Arduino Uno read from all of the sensors and send that data back to the NUC for further processing.



The game itself is programmed in C#, and it's displayed on a large 22" touchscreen at eye-level for the player to interact with. From there the player can select which difficulty they wish to play against, as well as various game and lighting settings.



While playing the game, the board will speak to the player using a text-to-speech program with a Scottish accent for an authentic golf feel. As seen in the demonstration video below, it's a lot of fun to play, and after 18 months of hard work, it's safe to say that this game was worth it.

Finally - to keep up to date with interesting news, offers and new products - interact with us on facebook, instagram, and twitter.

Previous article The Sparkpad Is a Reconfigurable Control Surface for Streamers

Leave a comment

Comments must be approved before appearing

* Required fields