Dual-Screen Electronic BattleShip Game With ESP32-C3

by matixvision in Workshop > 3D Printing

76 Views, 1 Favorites, 0 Comments

Dual-Screen Electronic BattleShip Game With ESP32-C3

Battleship.jpg
Battleship_01.jpg
Battleship_02.jpg
Battleship_03.jpg
Battleship v1.0

Build a modern take on the classic Naval Combat board game using two ST7735 TFT displays, an ESP32-C3 microcontroller, and custom PCF8575 button controllers. This portable electronic version features stunning pixel-art ship sprites, sound effects via I2S audio, and three game modes: Player vs CPU, Player vs Player, and Statistics tracking with EEPROM-saved high scores.

Dual 128×160 TFT displays - Each player sees only their own screen during ship placement

Realistic naval sprites - 11×11 pixel-art ships (Carrier, Battleship, Submarine, Destroyer, Patrol Boat)

I2S audio engine - Dynamic sound effects: missile launches, explosions, victory fanfares

Smart AI opponent - CPU with hunting mode and target prioritization

Persistent statistics - EEPROM stores win rates, accuracy records, fastest completion times

Smooth controls - Auto-repeat joystick navigation with debouncing

Professional UI - Animated radar, color-coded status bars, visual feedback

Supplies

Battleship_04.jpg


  1. 1 × ESP32-C3 Super Mini
  2. 2 × 1.8" ST7735 TFT LCD Displays (128×160 resolution)
  3. 1 × PCF8575 I²C I/O Expander (Address: 0x20)
  4. 2 × Thumb Joystick Switch 4+1-directions - 10x10x10mm
  5. 1 × MAX98357A Audio Amplifier Module
  6. 1 × Speaker 8 Ohms 2 Watts 2W 28mm
  7. 1 × 3D Printer (to print the STL enclosure model)
  8. 8 x Insert Nut M3_L3.0_D5.0

Print Frame 3D

Battleship_05.png

Battleship Console – 3D Printing Description

The image shows a futuristic battleship control console with several electronic modules and mechanical elements mounted on a base panel. The design appears suitable for 3D printing as separate components, which can be printed either single-color or multi-color depending on the printer capabilities.

Gather Components

esp32c3-supermini.png
ST7735 .png
PCF8575.png
MAX98357A.png
JoyPinMulti direction.png
speaker 3 mm 8 ohm 2 watt.png

Hardware Assembly

Battleship_06.png
Battleship_sc.png

The project uses as main components an ESP32-C3, two ST7735 1.8" 128x160 displays, a MAX98357A audio module, two mini joysticks with integrated buttons, and a mini speaker.

The two displays are managed via SPI interface, the MAX98357A module and the mini speaker are used for audio output, while the joysticks allow system control via directional axes and button press.

Hardware assembly:

  1. Secure the displays in their respective front slots.
  2. Install the two joysticks in the designated housings.
  3. Place the ESP32-C3, MAX98357A, and mini speaker inside the case.
  4. Arrange the cables neatly to avoid tension or interference.
  5. For all electrical connections, follow the wiring diagram provided in the project to correctly match pins, power, and signals between the modules.


Upload Firmware

For programming the ESP32-C3, use this link with a Chromium-based browser such as Opera or Chrome.

flash_firmware

Note License

License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).

You are free to share and adapt the project for non-commercial purposes, as long as you:

  1. Give appropriate credit
  2. Provide a link to the license
  3. Indicate if changes were made
  4. Distribute any derivative works under the same license

Commercial use is not permitted without separate permission.