GameCap: ESP32-Powered Wearable Arcade From Reused Parts

by avidgamer in Circuits > Microcontrollers

40 Views, 2 Favorites, 0 Comments

GameCap: ESP32-Powered Wearable Arcade From Reused Parts

Screenshot 2025-05-12 212821.png
Screenshot 2025-05-18 170446.png

Initially, I was thinking about what I would wanted to make. I had a spare ESP32 C3 lying around so I wanted to do something with it. Thinking about sustainability, I wanted to make something that from what I already had. I looked in my closet, and found a cap that I haven't worn in a while. I wanted to make something with it, so as I was playing video games, it clicked for me: a wearable video game cap. The only unused thing was the solderable breadboard, the button, and the ESP32 C3. The rest is from salvaged parts, including a battery I had lying around from - I think a RC Car I made, wires from old projects, and a screen from an old attempt to create a gaming console, and of course the old hat.

Warning: Be aware of your surroundings when using this device!

Notice: Requires Soldering

Notice 2: Make sure your hat is big enough to be ~1 inch from your head.

Notice 3: Be very careful when soldering and handling batteries.

Notice 4: Make sure to cover the solderable breadboard with an insulator to stay safe.

Notice 5: Make sure to disconnect battery when not in use.

Supplies

IMG-20250518-WA0012.jpg

Electronics

  1. ESP32C3 Supermini
  2. 1.8" ST7735 TFT (or any screen)
  3. Male to Male Dupont Wires
  4. Female to Female Dupont Wires
  5. Momentary Push Button

Power

  1. 3000mAh Battery or any LiPo battery (mine was 3000mAh JST 1.25mm 2 Pin)
  2. Male Female Connector Plug with Red Black Wire Cable (mine was JST 1.25mm 2 Pin)

Other Stuff

  1. The cap (any old cap/hat will do, as long as it can support weight of screen)
  2. Hot Glue/Gorilla Glue/Any super glue
  3. Solderable Breadboard (Half size not full)
  4. Soldering Iron
  5. Solder (Use the non leaded kind if possible)

Optional for enhancement

  1. 3D printer
  2. Filament

Glue Screen to Hat

IMG-20250518-WA0010.jpg

Glue the screen to the hat as shown.

Put Code Into ESP32

IMG-20250518-WA0014.jpg

Make sure that you have drivers. I used Arduino IDE. Any 1 button game works, but I used a game similar to Flappy Bird. Make sure you download the needed Libraries: Adafruit_GFX, Adafruit_ST7735. Ensure that you added ESP32 to the IDE and downloaded the library.


#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>

// Screen SPI pins
#define TFT_CS 8
#define TFT_RST 9
#define TFT_DC 10
#define TFT_SCLK 6
#define TFT_MOSI 7

#define BUTTON1 3

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

// Game variables
int birdY, velocity, pipeX, gapY;
const int gravity = 1;
const int flapStrength = -4;
const int gapSize = 30;
bool gameRunning = true;

void setup() {
pinMode(BUTTON1, INPUT_PULLUP);
SPI.begin(TFT_SCLK, -1, TFT_MOSI, TFT_CS);
tft.initR(INITR_BLACKTAB);
tft.setRotation(2); // Portrait upside down
tft.fillScreen(ST77XX_BLACK);
resetGame();
}

void drawBird(int y, uint16_t color) {
tft.fillRect(20, y, 5, 5, color);
}

void drawPipe(int x, int gapY, uint16_t color) {
tft.fillRect(x, 0, 10, gapY, color);
tft.fillRect(x, gapY + gapSize, 10, 160 - (gapY + gapSize), color);
}

void resetGame() {
tft.fillScreen(ST77XX_BLACK);
birdY = 80;
velocity = 0;
pipeX = 0;
gapY = random(20, 100);
gameRunning = true;
}

void showGameOver() {
tft.setCursor(20, 60);
tft.setTextColor(ST77XX_RED);
tft.setTextSize(2);
tft.print("Game Over");
gameRunning = false;
}

void loop() {
if (gameRunning) {
// Clear previous
drawBird(birdY, ST77XX_BLACK);
drawPipe(pipeX, gapY, ST77XX_BLACK);

// Input
if (digitalRead(BUTTON1) == LOW) {
velocity = flapStrength;
}

// Physics
velocity += gravity;
birdY += velocity;

// Pipe movement
pipeX += 2;
if (pipeX > 128) {
pipeX = 0;
gapY = random(20, 100);
}

// Draw updated
drawBird(birdY, ST77XX_YELLOW);
drawPipe(pipeX, gapY, ST77XX_GREEN);

// Collision detection
if (birdY <= 0 || birdY >= 160) showGameOver();
if (pipeX > 15 && pipeX < 25 && (birdY < gapY || birdY > gapY + gapSize)) showGameOver();

delay(50);
} else {
// Wait for button press to restart
if (digitalRead(BUTTON1) == LOW) {
delay(200); // debounce
resetGame();
}
}
}

Initial Wiring + Soldering

IMG-20250518-WA0008.jpg

3.1

Connect the Male to Male Dupont cables to the Female to Female Dupont cables, to make very long (and secure) male to female Dupont Cables. Note: You can use very long Male to Female Dupont cables, but I wanted to use things that can be salvaged to cut down on waste.


3.2

Connect battery to connecter plug.


3.3 Soldering

Connect Dupont Cables to screen.

Wiring goes like this:

ST7735 → ESP32-C3 SuperMini

------------------------------

VCC → 3V3

GND → GND

LED → 3V3 (or via 100Ω to 3V3)

SCK → GPIO6

SDA → GPIO7

DC (A0) → GPIO10

RESET → GPIO9

CS → GPIO8

------------------------------


3.4 Soldering

Connect previously made very long male to female Dupont wires.

Wiring goes like this:

------------------------------

Button1 → GPIO3 and GND

Button2 → GPIO2 and GND

------------------------------


3.5 Soldering

Connect battery (through connecter wires) to solderable breadboard.

Wiring goes like this:

------------------------------

LiPo + → ESP32 5V

LiPo – → GND (along the GND) Line

------------------------------

Put Button on Side of Hat

IMG-20250518-WA0003.jpg
IMG-20250518-WA0004.jpg

Use Hot Glue and Tape as needed to put button on the hat as shown.

Tape Battery to the Board and Put Board Into Top of Hat

IMG-20250518-WA0005.jpg

Now with the hard part out of the way, we can put the board into the top of the hat, glue it, then tape the battery to the board.

Note: Tape the battery, don't glue it, so you can still charge it.

Enjoy Retro Games on the Go!

IMG-20250518-WA0001.jpg
IMG-20250518-WA0002.jpg
IMG-20250518-WA0006.jpg

Press the button to make your bird fly!

Note: The darker section of the poles is where you are to fly through.

Note 2: Works better in less light.

(Bonus)

IMG-20250518-WA0007.jpg

For a better game experience, add a plastic 3D printed cover to the button.