## Inspiration

When I was quarantining in Georgia, I played a lot of cornhole with a mixture of people who knew the game's rules and who did not. Therefore, a lot of playing time was lost explaining the rules and clarifying them during gameplay. I also noticed that the scoring rules gave both beginners and experienced players a hard time, slowing the game down further. Points in cornhole are awarded based on a cancellation system, and the game is played until a player has 21 points. Calculating scores can be complicating and time-consuming. For example, no player is awarded a point with a blue and a red bag on the board. However, with two blue bags on the board and one red bag on the board, Player Blue is awarded 1 point because it has one more point than Player Red. However, if there are two blue bags on the board, one red bag on the board, and one red bag inside the board, Player Red gets 2 points. The points are awarded because a bag inside the hole is worth 3 points, while a bag on the board is worth only 1 point. Since memorizing these calculation rules can be daunting, it slows the game down, discourages new players from participating, and deprives people who do not play by the official rules, the full game experience. Thus, as my final project, I want to build an interactive cornhole board that removes the game's calculations. By sensing the number of bags on the board and inside the hole, the board will perform all the necessary calculations to determine which player gets awarded points and how many points are awarded.

## What it does

Computes the total point for a round of cornhole.

## How I built it

12 copper strips (1”) were placed on the board to make columns. I first placed a strip of paper tape on the board and then placed the copper tape. After placing the columns, sheets of velostats (11” x 11” each”) were used to isolate the columns layer from the rows layer. Additionally, the resistance of the velostats decreased with pressure. 16 copper strips were placed on top of the velostats to make rows. This configuration provided enough resolution to detect when a bag lands anywhere on the board. Ribbon cables were soldered onto each strip and then connected to multiplexers with bidirectional pins. By using the multiplexers, I can sequentially apply voltage to each copper column and then sequentially read the voltage on each copper row with a single ADC pin. By summing the ADC values from all 16 x 12 sensors, I can determine the total pressure on the board.

In software, a nested for loop (one for the rows and one for the columns) was used to read the pressure (ADC) of each sensor. To figure out the number of bags on the board, I first noted the total pressure on the board without any bags, then I noted the total pressure associated with 1 bag, and then two bags, and so on, until there are 4 bags on the board. I then implemented an if-else logic that sends the bag count to information to a serial port via UART. In Python, this information was used to generate an “icon” (just a button for users to click) for each bag on the board. The default color of the “icon” is blue, but it can be toggled to red. After the color of each bag is set, the total score of the round is displayed for the users.

## Challenges I ran into

The biggest challenge I ran into was finding the optimal layout for the array such as the spacing between the copper strips and the number of velostats between the bottom and top layers.

## Accomplishments that I'm proud of

I'm proud that I have a working demo and that I was able to build a large pressure sensing array.

## What I learned

I learned how to solder ribbon cables to pin headers, communicate between Arduino and Python, and write code to make a graphical user interface.

## What's next for Just CornHole

Add a calibration and implement the color sensing functionality.