An interactive game console built on ESP32 with a 0.96 inch OLED display! Features 4 classic games with sound effects, visual feedback, and smooth gameplay.
So basically this project turns an ESP32 into a handheld gaming device. It includes a startup animation with blinking eyes, a menu system, and four fully playable games - Snake, Pong, Race (Lane Changer), and Dino. The console uses physical buttons for controls, an active buzzer for sound effects, and a Green LED for visual feedback.
I wanted to create a fun, portable gaming device that brings back the nostalgia of classic games while learning about hardware interfacing. (Ive never done smth like this before) This project helped me understand how to work with displays, buttons, and sound in embedded systems. Plus, it's something I can actually use and show off to friends. It's also my first real hardware project and I learned sm liek soldering all the wires using jumper wires It may sound really basic but im really new to hardware and stuff
- ESP32 Development Board
- 0.96 inch OLED Display (128x64, I2C)
- 5 Push Buttons (UP, DOWN, LEFT, RIGHT, SELECT)
- Buzzer (Active or Passive) (I used active)
- Green LED (Or any other LED)
- 220Ω Resistor (for LED)
- Breadboard
- Jumper Wires (Male-to-Male, Male-to-Female)
VCC → 3.3V
GND → GND
SDA → GPIO 21
SCL → GPIO 22
UP → GPIO 32
DOWN → GPIO 33
LEFT → GPIO 25
RIGHT → GPIO 26
SELECT → GPIO 27
(+) → GPIO 18
(-) → GND
(+) → GPIO 19
(-) → 220Ω → GND
(HOPING YOU ALREADY HAVE THE ESP THING SET UP IN THE IDE If not check below)
Install these libraries through the Arduino IDE Library Manager:
- Wire (Built-in with Arduino IDE)
- Adafruit GFX Library by Adafruit
- Adafruit SSD1306 by Adafruit
- Open Arduino IDE
- Go to Sketch → Include Library → Manage Libraries
- Search for "Adafruit GFX" and install it
- Search for "Adafruit SSD1306" and install it
- Restart Arduino IDE
-
Install the ESP32 board support in Arduino IDE:
- Go to File → Preferences
- Add
https://dl.espressif.com/dl/package_esp32_index.jsonto Additional Board Manager URLs - Go to Tools → Board → Boards Manager
- Search for "ESP32" and install "ESP32 by Espressif Systems"
-
Connect your ESP32 to your computer via USB (micro USB most prob)
-
Select the correct board and port:
- Tools → Board → ESP32 Arduino → ESP32 Dev Module
- Tools → Port → (Select your COM port)
-
Open the
Firmware/espgame.inofile -
Click Upload button (→)
-
Wait for the code to compile and upload
Classic snake game ykwim snake eats the fruit avoid walls thats it! uses all the movement 4 buttons
Keep the ball alive by hitting it with your paddle (Single player only uses 2 buttons UP and Down only)
Dodge incoming obstacles by switching lanes. Speed increases as your score goes up. Use LEFT and RIGHT buttons to change lanes.
Classic DINO Game uses UP and Down button only for obstacles
- Startup animation with animated eyes and loading bar (Welcome screen)
- Menu system with visual selection
- Sound effects for all game actions
- LED feedback synchronized with game events
- Increasing difficulty as score goes up
- Game over screen with final score
- Button debouncing for smooth controls
Display not working:
- Check I2C connections (SDA and SCL)
- Verify display address is 0x3C (change in code if different)
- Make sure VCC is connected to 3.3V not 5V
- Make sure Ground is connected properly (it gets dim a bit ig)
Buttons not responding:
- PRESS HARDER YEAH THE 4 LEGGED BUTTONS NEED SOME FORCE
- Ensure buttons are connected between GPIO pins and GND
- Check if INPUT_PULLUP is enabled in code
- Try different buttons to isolate hardware issues
No sound from buzzer:
- Check buzzer polarity
- Try swapping buzzer wires
- Some buzzers need external oscillation circuit
LED not lighting:
- Verify 220Ω resistor is in series with LED (IMP)
- Check LED polarity (longer leg is positive)
- Test LED with external power source
- Solder header pins to the OLED display for better connections (mine came with no pins T_T had to solder everything)
- Use a breadboard to organize all connections (can use male to female cables for the esp if too many connections or small breadboard)
- Keep wires short to reduce noise and interference
- Test each component individually before assembling everything
- Use heat shrink tubing or electrical tape to secure exposed connections (If any)
| Item | Description | Quantity | Unit Price ($) | Total Price ($) |
|---|---|---|---|---|
| ESP32 Dev Board | ESP32 microcontroller development board | 1 | 3.99 | 3.99 |
| 0.96" OLED Display | 128x64 I2C OLED Display | 1 | 1.99 | 1.99 |
| Push Buttons | 4-pin tactile push buttons | 5 | 0.13 | 0.70 |
| Active Buzzer | 5V active buzzer module | 1 | 0.20 | 0.20 |
| Green LED | 5mm LED | 1 | 0.01 | 0.01 |
| 220Ω Resistor | 1/4W resistor | 1 | 0.01 | 0.01 |
| Breadboard | 400 point breadboard | 1 | 0.60 | 0.60 |
| Jumper Wires M-M | Male-to-Male pack | 1 | 0.20 | 0.20 |
| Jumper Wires M-F | Male-to-Female pack | 1 | 0.20 | 0.20 |
| TOTAL | $7.90 |
For detailed sourcing information, see BOM.csv in the repository.
THE INTERNET - followed many tutorials, articles and webpages while building this.
Some other projects I've built:
- Libro Voice - A PDF to Audio Converter
- Snippet Vision - A YouTube Video Summarizer
- Weather App - A Python Weather Forecast App
- Python Screenrecorder - A Python Screen Recorder
- Typing Speed Tester - A Python Typing Speed Tester
- Movie Recommender - A Python Movie Recommender
- Password Generator - A Python Password Generator
- Object Tales - A Python Image to Story Generator
- Finance Manager - A Flask WebApp to Monitor Savings
- Codegram - A Social Media Web App for Coders
- Simple Flask Notes - A Flask Notes App
- Key5 - Python Keylogger
- Codegram2024 - A Modern Version of Codegram (Update)
- Cupid - A Dating Web App for Teenagers
- Gym Vogue - Ecommerce Site for Gym Freaks
- Confessions - Anonymous confession platform
- Syna - A social music web application where users can log in using their Spotify accounts and find their best matches based on shared music preferences
- Apollo - A Minimal Music Player with a Cat Dancing/Bopping to the beats
- Eros - A face symmetry analyzer built using Python and OpenCV
- Notez - A clean and minimal Android notes application built with Flutter
- Lynx - All in one OpenCV image manipulation webapp Built for Hackberry
- DawnDuck - USB HID automation tool that opens your morning routine apps and websites automatically. Built for Picoducky
Built by Saurabh Tiwari
- Email: saurabhtiwari7986@gmail.com
- Twitter: @Saurabhcodes01
- Instagram: @saurabhcodesawfully

