DIY Handheld NES Emulator Using ESP32-S3

by DsnIndustries in Circuits > Arduino

321 Views, 1 Favorites, 0 Comments

DIY Handheld NES Emulator Using ESP32-S3

3.jpg
How I Build HandHeld Retro Game Console

This project guides you through building a handheld game console that functions as an NES emulator. This upgraded version features a larger screen, a custom 3D printed case, and improved ease of use

Supplies

Here are the components and materials required for this build:

  1. ESP32-S3 development board (16MB Flash and 8MB PSRAM version).
  2. ILI9341 2.8" touch display with an integrated SD card port.
  3. TP4056 charger board.
  4. Li-po battery.
  5. 8x tactile buttons (6mm x 6mm).
  6. 2 pieces of prototype board.
  7. Female pin headers.
  8. MAX98357A I2S amplifier and tiny speaker.
  9. 3D printed case models.
  10. Screws: 10x M2 4mm, 6x M2 8mm.
  11. Jumper cables, breadboard, and wiring

Breadboard Prototyping

F1RW2KTMNDMJVNL.jpg

Before permanently soldering components, verify that everything works correctly by building a breadboard version.

  1. Use jumper cables to connect the components.
  2. Because the display relies on SPI communication, the wiring must be completely stable to avoid getting a blank or white screen.
  3. Follow the provided wiring schematic to ensure all connections are routed correctly.


Software Setup

Prepare your programming environment to flash the ESP32-S3.

  1. Download the project source files as a ZIP archive from GitHub.
  2. Download and install Arduino IDE version 2.3.8.
  3. Install the ESP32 tools via the Arduino IDE, specifically using version 3.3.7.
  4. Add the downloaded project ZIP file to the IDE by navigating to Sketch > Include Library > Add .ZIP Library.
  5. Install the tft_eSPI library (version 2.5.43) by searching for it in the libraries section on the left side of the IDE


Configuring the Display Library

GameBoy Wiring Breadboard version.jpg

The tft_eSPI library must be configured for the specific display you are using. The emulator supports displays with at least a 240x256 resolution.


  1. Navigate to your local library installation folder: Documents > Arduino > libraries > tft_eSPI.
  2. Open the User_Setup_Select.h file and ensure the appropriate line for your display setup is uncommented, then save and close.
  3. Next, open the User_Setup.h file and redefine the lines to match the supported TFT driver.
  4. Save and close the file once the redefinition is complete.


Code Customization & Uploading

Load the emulator software onto your board.

  1. In the Arduino IDE, go to File > Examples > DSN Nes Emulator Universal > Universal Example to open the project.
  2. The project contains three main files: the main .ino file, a controller file, and a hardware config file.
  3. The hardware config file displays where all pins connect on the ESP32 board and allows you to redefine them if necessary.
  4. If your display output is rotated incorrectly, modify the orientation line (values 0 to 3) in the main .ino file.
  5. Configure your upload tools by selecting "ESP32S3" and the correct COM port.
  6. In the Tools menu, adjust the flash size and partition scheme.
  7. Crucial Step: Ensure that "OPI PSRAM" is selected in the tools configuration; the emulator will not work without PSRAM enabled.
  8. Click upload. If successful, the display will show the DSN Logo followed by the Game select menu.


3D Printing & Hardware Assembly

battery included.png
GameBoy Wiring Breadboard version.jpg

With the electronics working, move on to building the physical console.

  1. Print the custom case designed in Fusion 360. For example, an Ender 3 printer works well for these parts.
  2. Review your ESP32 board's power regulation. If it uses an LDO voltage regulator, it will smoothly step down the Li-po battery to 3.3V. If the board uses an AMS series regulator, you must add a 5V step-up module.
  3. Follow the handheld version schematic for final assembly.
  4. Use the provided stencil to open holes on the protoboard.
  5. Solder the components, manage wiring, secure parts with hot glue, and screw the case together. Note: A programming hole was left in the case design to allow for easy code updates without disassembling the console


Gameplay & Controls

111.jpg

Your retro handheld is now ready to play Nintendo games loaded onto the display's SD card.

  1. This version features fully working audio during gameplay.
  2. To exit a game and return to the main menu, press the Select and Start buttons simultaneously, then press the B button.

git Repo : https://github.com/derdacavga/DSN-Nes-Emulator-Universal

3D Model : https://cults3d.com/en/3d-model/game/esp32-nes-handheld-game-console-printable-case