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
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:
- ESP32-S3 development board (16MB Flash and 8MB PSRAM version).
- ILI9341 2.8" touch display with an integrated SD card port.
- TP4056 charger board.
- Li-po battery.
- 8x tactile buttons (6mm x 6mm).
- 2 pieces of prototype board.
- Female pin headers.
- MAX98357A I2S amplifier and tiny speaker.
- 3D printed case models.
- Screws: 10x M2 4mm, 6x M2 8mm.
- Jumper cables, breadboard, and wiring
Breadboard Prototyping
Before permanently soldering components, verify that everything works correctly by building a breadboard version.
- Use jumper cables to connect the components.
- Because the display relies on SPI communication, the wiring must be completely stable to avoid getting a blank or white screen.
- Follow the provided wiring schematic to ensure all connections are routed correctly.
Software Setup
Prepare your programming environment to flash the ESP32-S3.
- Download the project source files as a ZIP archive from GitHub.
- Download and install Arduino IDE version 2.3.8.
- Install the ESP32 tools via the Arduino IDE, specifically using version 3.3.7.
- Add the downloaded project ZIP file to the IDE by navigating to Sketch > Include Library > Add .ZIP Library.
- 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
The tft_eSPI library must be configured for the specific display you are using. The emulator supports displays with at least a 240x256 resolution.
- Navigate to your local library installation folder: Documents > Arduino > libraries > tft_eSPI.
- Open the User_Setup_Select.h file and ensure the appropriate line for your display setup is uncommented, then save and close.
- Next, open the User_Setup.h file and redefine the lines to match the supported TFT driver.
- Save and close the file once the redefinition is complete.
Code Customization & Uploading
Load the emulator software onto your board.
- In the Arduino IDE, go to File > Examples > DSN Nes Emulator Universal > Universal Example to open the project.
- The project contains three main files: the main .ino file, a controller file, and a hardware config file.
- The hardware config file displays where all pins connect on the ESP32 board and allows you to redefine them if necessary.
- If your display output is rotated incorrectly, modify the orientation line (values 0 to 3) in the main .ino file.
- Configure your upload tools by selecting "ESP32S3" and the correct COM port.
- In the Tools menu, adjust the flash size and partition scheme.
- Crucial Step: Ensure that "OPI PSRAM" is selected in the tools configuration; the emulator will not work without PSRAM enabled.
- Click upload. If successful, the display will show the DSN Logo followed by the Game select menu.
3D Printing & Hardware Assembly
With the electronics working, move on to building the physical console.
- Print the custom case designed in Fusion 360. For example, an Ender 3 printer works well for these parts.
- 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.
- Follow the handheld version schematic for final assembly.
- Use the provided stencil to open holes on the protoboard.
- 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
Your retro handheld is now ready to play Nintendo games loaded onto the display's SD card.
- This version features fully working audio during gameplay.
- 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