Hardware
Bill of materials, current pinout, and electrical notes.
Bill of materials
| Component | Qty | Notes |
|---|---|---|
| ESP32-WROOM-32 | 1 | Standard dev board. 4 MB flash minimum. No PSRAM required. |
| VGA monitor | 1 | Any monitor with a DE-15 (15-pin D-sub) input. |
| VGA cable or breakout | 1 | Male DE-15 connector on the ESP32 side. |
| 330 Ω resistor | 3 | One each for R, G, B signal lines. Do not skip these. |
| OKY0272 4x4 keypad module | 1 | Current recommended input module. Uses four row lines and four column lines. |
| USB-to-serial adapter | 1 | CP2102 or CH340, 3.3 V logic. Many ESP32 dev boards include one. |
| Breadboard + jumper wires | Or solder directly for a permanent build. | |
| Passive buzzer | 1 | Optional audio output on GPIO14. |
VGA wiring
The VGA signal is generated by the ESP32's I2S peripheral driving the GPIO lines directly. The pixel clock comes from the APLL (audio PLL). 3-bit color: one bit per channel, 8 possible colors.
dac_output_disable(DAC_CHANNEL_1) and rtc_gpio_deinit(GPIO_NUM_25) in setup() before vga_init(). If you modify the setup code, keep these calls. Why 330 Ω resistors
VGA expects a 0–0.7 V signal on the color lines, loaded by 75 Ω to ground inside the monitor. The ESP32 GPIO outputs 3.3 V. A 330 Ω series resistor forms a voltage divider with the 75 Ω load: 3.3 V × 75 / (330 + 75) ≈ 0.61 V within the VGA specification. Without resistors, you would overdrive the monitor input and likely damage it.
OKY0272 4x4 keypad
The current recommended input module is an OKY0272 4x4 matrix keypad. It uses four row GPIOs and four column GPIOs, scanned by firmware as digital inputs/outputs.
Keep keypad leads short and share ground with the ESP32. The exact button mapping is handled in firmware, so verify the OSD controls after flashing.
Audio (optional)
Audio output uses GPIO14 for a passive buzzer. Keep the buzzer wiring separate from the VGA color lines where possible to reduce visible noise.
Full pin table
| GPIO | Function | Direction | Notes |
|---|---|---|---|
| GPIO25 | VGA Red | Output | Through 330 Ω resistor. |
| GPIO26 | VGA Green | Output | Through 330 Ω resistor. |
| GPIO27 | VGA Blue | Output | Through 330 Ω resistor. |
| GPIO23 | VGA HSYNC | Output | Direct sync line. |
| GPIO22 | VGA VSYNC | Output | Direct sync line. |
| GPIO14 | Passive buzzer | Output | Audio output. |
| GPIO4 | Keypad row 1 | Digital I/O | OKY0272 matrix keypad. |
| GPIO5 | Keypad row 2 | Digital I/O | OKY0272 matrix keypad. |
| GPIO18 | Keypad row 3 | Digital I/O | OKY0272 matrix keypad. |
| GPIO19 | Keypad row 4 | Digital I/O | OKY0272 matrix keypad. |
| GPIO13 | Keypad column 1 | Digital I/O | OKY0272 matrix keypad. |
| GPIO15 | Keypad column 2 | Digital I/O | OKY0272 matrix keypad. |
| GPIO21 | Keypad column 3 | Digital I/O | OKY0272 matrix keypad. |
| GPIO17 | Keypad column 4 | Digital I/O | OKY0272 matrix keypad. |
Legacy KY-023 note
Older NESpresso32 material referenced a KY-023 analog joystick. That was a historical input path, not the current recommended hardware. New builds should use the OKY0272 4x4 keypad wiring above.
Electrical notes
Use 3.3 V logic
Keep all ESP32 GPIO connections at 3.3 V logic levels. Do not feed 5 V signals directly into ESP32 GPIO pins.
Keep VGA wires short
The I2S-generated VGA signal is not particularly clean. Long wires pick up noise and degrade the image. For prototyping, keep the ESP32 close to the VGA connector. Twisted-pair or shielded wire helps if your setup needs longer runs.
GND connections matter
Connect GND between the ESP32 and the VGA connector. The VGA standard uses several ground pins (5, 6, 7, 8, 10) you only need one solid ground connection, but make sure it is there. A floating ground causes all sorts of image problems that look like signal issues.
Check your wiring before powering
Verify the resistors are in the correct positions before connecting the VGA cable. The monitor's 75 Ω termination resistors will conduct current regardless of whether the image is correct. A short or reversed connection on the color lines is not catastrophic for the ESP32 at 3.3 V, but it will produce a wrong image and could cause issues in edge cases.
Frequently asked questions
Hardware questions
- Which ESP32 board does NESpresso32 target?
- NESpresso32 targets the standard ESP32-WROOM-32 development board with at least 4 MB of SPI flash. No PSRAM is required. Most common low-cost ESP32 dev boards based on this module work.
- Which GPIO pins are used for VGA?
- GPIO25 drives the Red channel, GPIO26 drives Green, and GPIO27 drives Blue, each through a 330 ohm resistor. GPIO23 carries HSYNC and GPIO22 carries VSYNC. These connect directly to a standard DE-15 VGA connector.
- Do I need external video hardware?
- No dedicated video chip is needed. The ESP32 I2S peripheral generates the VGA timing directly. The only external components are three 330 ohm resistors on the RGB lines and a standard VGA cable or breakout.
- Can I build this on a cheap ESP32-WROOM-32 board?
- Yes. NESpresso32 targets low-cost ESP32-WROOM-32 boards. A standard dev board, three 330 ohm resistors, a VGA connector, and an OKY0272 4x4 keypad are enough to get started.
For the full build walkthrough, see the documentation. For mapper and game notes, see compatibility.