Inspiration
As avid computer scientists and connect fourists, we thought that there would be no better idea than to mix our interests with our skills and create this robot!
What it does
The robot uses a webcam to detect the current state of the board, which is used to determine the best move the robot can play. The robot moves and drops the piece.
How we built it
We used OpenCV to detect the board and the pieces. We used an Arduino to control the motors which drive the wheels and the servos which deploy pieces. Finally, we used python as well as our knowledge of data structures and algorithms to find the next optimal cell to drop a piece in.
Challenges we ran into
We first tried to use a Raspberry Pi to control the robot, but we ran into issues with the Pi's GPIO pins. We then switched to an Arduino, which we had more experience with.
Another challenge that we had was with image detection. Since none of us had experience with image processing, we had to consult many outside resources to accomplish this. One that we found particularly helpful was this repository link. Another repository we found helpful was this one link.
Accomplishments that we're proud of
We are proud to have a working robot that can traverse columns and drop pieces at will. We are also proud of our algorithm implementation, which allows the robot to play at a reasonable level.
What we learned
We learned many new tools and techniques, including OpenCV, game solving algorithms such as Monte Carlo and minimax, and how to design a robotics project from the ground up.
What's next for Connect 4 Companion
We would like to improve the robot's ability to detect the board and pieces, since our algorithm is not perfect despite performing well. We would also like to improve the robot's ability to play the game, perhaps training a neural network on many played games.
Log in or sign up for Devpost to join the conversation.