BATTLESHIP ACROSS THE SEA



Our project, Battleship across the sea presents an upgrade to the regular game of Battleship. Our goal is to create a version of the classic board game that is more interactive, including adding both visual and audio feedback to enhance the gameplay experience. Players will place ships on a Hall Effect sensor array and make moves on a capacitive touch grid instead of placing pegs into the board and the system will automatically check for hits and misses and give the proper feedback.

Team Members



...

Matthew Getman

...

Zachary Zhao

...

Maulshree Srivastava

...

Jared Kelleher

Problem Statement

Our project, Battleship Across the Sea is an updated version of the classic Battleship board game. Currently, the game exists in two forms, the classic physical board game and an online version of it. Our goal was to upgrade it in such a way that people can still play with each other without being in the same room.

Battleship Across the Sea will read your moves through a board and communicate these moves to your opponent on a computer. It will feature sounds and lights for an interactive gaming experience. It will also include all the additional moves offered by the online version and offer them on the physical board as well. More importantly, we want the game to be easier than the original and just as fun to play.

Specifications

1. Auxiliary Move Responses

The system will respond with specific light and sound effects for hits and misses every time a move is made.

2. Input for moves

The moves will be made through finger touch on a Capacitive Touch Array. These moves will be confirmed with a button.

3. Placing the ships

The magnetic ships will be placed on a Hall Effect Sensor Array. The ship placements can be confirmed with a button.

4. Basic Laptop Interface

The player on computer will be able to play using the Serial Monitor Display.

Documentation





GAMEPLAY:
The game will be played as follows, Player 1 will be playing through a computer where they will input their moves and place their ships. Player 2 will be playing on the physical board where they can place magnetic ships on the lower half of the board comprising of hall effect sensor arrays which will detect the ship locations and initiate the game. The upper half of the board made up of capacitive touch array will be used to make moves through finger touch. This data is communicated to player 1 using i2c communication. The game board is equipped with lights and sound effects to make the game play more interesting. Whenever a move is made that results in a hit on another player’s ship, the leds will light up red for that coordinate and a "hit" sound effect will be played. Similarly, for all misses, white leds will light up and a “miss” sound effect will be played. These effects are made using a 1 Watt speaker and WS2812B LED Strip which are controlled by ESP32.

HOW IT WORKS:
Two S wired strips of 100 individually addressable LEDs are connected through data pins to the ESP 32 and function to light up red or white for hits or misses, glow to show the positioning of ships on the board, and light up to describe the opponent’s moves against the player. A speaker outputs two different tones, one representing hits, the other misses to give an audible cue in parallel. Capacitive array controller reads capacitance between finger contact to wire contact between a diode and resistor. Reading down 10 lines for each row, the Atmega328P computes the exact column for a row and communicates the corresponding coordinate when touched or sense 100 when not touched. There is a short 2 second period on startup to calibrate. We use push buttons to accept the value or query for the next value. The Hall FX array supplies and queries columns and rows in a square complexity FOR loop to determine magnet locations. The Atmega microcontroller gives a count down to determine location of inidivually placed ship, assigns matrix coordinate with ship number (ship1) and assigns coordinates for next placed ship an incremented ship number (ship 2). With reset pin, all values of matrix return to 0 which is how we reset if ships were placed or read wrong. Only issue is when board is not reset.

Final board

BOARD COMPONENTS:
1. Capacitive Touch Array
The capacitive array uses a grid of 100 resistors and 100 diodes to detect the point at which the user touches. The resistors are connected to wires running vertically along each column, while the diodes are wired horizontally along each row. Using the nonlinear behavior of diodes, the system can turn on and off the detection on any individual row, allowing for rapid and accurate detection of the touched location.

2. Hall Effect Array
An array of 100 Hall Effect sensors are used to detect the magnets on the bottom of the battleships in order to determine their position. This data is read by the Atmega328p on the PCB which feeds this information to the ESP32 that runs the game. Digital pins control MUX giving HIGH to switch on voltage supply through transistors to the 10 columns one at a time. DEMUX connects 10 rows to analog input pin to read if voltage is dropped low by active sensor.