Community project

ESP32 Snake Game

Photo of ESP32 Snake Game

Tucker

Published September 3, 2026

This guide builds a playable Snake game on an ESP32 microcontroller with a color touchscreen display. The game runs locally on the device and includes customizable features like adjustable snake appearance, background colors, and control settings all accessible through an on-screen menu system.

The project uses an ESP32 development board paired with a TFT display, powered via USB. This guide provides the complete wiring diagram, parts list, and firmware code. Setup involves connecting the display, powering the board, entering Wi-Fi credentials on screen, and adjusting display brightness to get started playing.

Wiring diagram

Loading diagram…

Assemble it in 4 steps

1. Keep the screen connections as they are

Use the ESP32-3248S035C board with its built-in screen and touch panel. Do not add wires to GPIO32 or GPIO33 because those pins are already used inside the board for touch.

  • The brightness and Wi-Fi controls use the board’s built-in hardware, so no extra module is needed.
  • Adding wires to GPIO32 or GPIO33 can stop the touch screen from responding.

2. Use USB power

Plug the board into a USB power source or your computer with a USB cable. The screen should turn on; its saved brightness is restored when the app starts.

  • If the display seems dark, open Settings and tap farther to the right on the brightness bar.
  • Do not force a plug into the board; forcing it can damage the connector.

3. Enter Wi-Fi details on the screen

Open the Settings app, tap WI-FI CONNECTION, tap the top box for your network name, then tap the lower box for its password. Use the on-screen keys and tap CONNECT.

  • The password shows as stars so someone looking at the screen cannot read it.
  • If your Wi-Fi name contains lowercase letters, enter capitals because the on-screen keyboard currently uses capital letters.
  • A wrong network name or password prevents the board from joining Wi-Fi, but it does not damage the board.

4. Adjust the screen brightness

Return to Settings and tap the brightness bar: farther right makes the screen brighter and farther left makes it dimmer. The chosen level is remembered after power is turned off.

  • Set a comfortable brightness before playing games for a long time.
  • Setting the bar very far left can make the display hard to see; tap farther right to recover.

Deploy the firmware

Loading src/main.cpp…

Remix this project

Make it yours in one click

Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.

Open in Schematik