Bill of materials

ComponentQtyNotes
ESP32-WROOM-321Standard dev board. 4 MB flash minimum. No PSRAM required.
VGA monitor1Any monitor with a DE-15 (15-pin D-sub) input.
VGA cable or breakout1Male DE-15 connector on the ESP32 side.
330 Ω resistor3One each for R, G, B signal lines. Do not skip these.
OKY0272 4x4 keypad module1Current recommended input module. Uses four row lines and four column lines.
USB-to-serial adapter1CP2102 or CH340, 3.3 V logic. Many ESP32 dev boards include one.
Breadboard + jumper wiresOr solder directly for a permanent build.
Passive buzzer1Optional 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.

ESP32 → VGA DE-15 connector
GPIO25──[330Ω]──VGA pin 1 · RedDAC must be disabled
GPIO26──[330Ω]──VGA pin 2 · Green
GPIO27──[330Ω]──VGA pin 3 · Blue
GPIO23──────────VGA pin 13 · HSYNCno resistor
GPIO22──────────VGA pin 14 · VSYNCno resistor
GND──────────VGA pins 5, 6, 7, 8, 10all grounds
Important: GPIO25 has a built-in DAC. If the DAC is active when the I2S peripheral starts, the DAC output fights the I2S signal and the red channel is noisy or wrong. The firmware calls 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.

OKY0272 keypad → ESP32
R1GPIO4keypad row
R2GPIO5keypad row
R3GPIO18keypad row
R4GPIO19keypad row
C1GPIO13keypad column
C2GPIO15keypad column
C3GPIO21keypad column
C4GPIO17keypad column

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.

Passive buzzer → ESP32
GPIO14──────────Buzzer + terminalaudio output
GND──────────Buzzer − terminal

Full pin table

GPIOFunctionDirectionNotes
GPIO25VGA RedOutputThrough 330 Ω resistor.
GPIO26VGA GreenOutputThrough 330 Ω resistor.
GPIO27VGA BlueOutputThrough 330 Ω resistor.
GPIO23VGA HSYNCOutputDirect sync line.
GPIO22VGA VSYNCOutputDirect sync line.
GPIO14Passive buzzerOutputAudio output.
GPIO4Keypad row 1Digital I/OOKY0272 matrix keypad.
GPIO5Keypad row 2Digital I/OOKY0272 matrix keypad.
GPIO18Keypad row 3Digital I/OOKY0272 matrix keypad.
GPIO19Keypad row 4Digital I/OOKY0272 matrix keypad.
GPIO13Keypad column 1Digital I/OOKY0272 matrix keypad.
GPIO15Keypad column 2Digital I/OOKY0272 matrix keypad.
GPIO21Keypad column 3Digital I/OOKY0272 matrix keypad.
GPIO17Keypad column 4Digital I/OOKY0272 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.