r/esp32 • • 12h ago

I made a thing! I built an ESP32 emulator that can run Doom in the browser

74 Upvotes

Video: Doom shareware on a real ESP32-S3 + ILI9341 on a breadboard, then the exact same firmware running in my emulator in the browser.

Demo (no sign-up): https://flomotion.app/schematic/3214c185-666a-42e0-9c09-ed17b9079799

Chip: ESP32-S3

Picked the S3 for the octal PSRAM (heap and .bss live there) and native USB OTG, which drives a PS5 DualSense as a USB-host gamepad. 16 MB flash, 240 MHz, DevKitC-1.

Libraries

- Based on Espressif's esp32-doom (Sprite_tm's PrBoom port), since it's already built around ESP32 constraints.

- Ported it to ESP-IDF 5.5 / CMake for the S3.

- Display: the port's own SPI LCD driver on the IDF spi_master, not TFT_eSPI or LovyanGFX. ILI9341 at 320x240 on SPI2 with DMA at 26 MHz, with the 8-bit framebuffer converted to RGB565 in DMA chunks.

- usb_host_hid for the gamepad, plus 8 push buttons on GPIO.

Hurdles

- Old PrBoom C code on a modern toolchain: needed -fcommon, and .bss had to move into PSRAM to fit.

- The WAD sits in a raw 4 MB flash partition and is memory-mapped once instead of per lump.

- The timing had to move to esp_timer.

- Moved the display pins so the breadboard jumpers run straight. A slower 10 MHz SPI build for long jumpers was tried and reverted.

The emulator

Written from scratch in Rust, compiled to WASM. It emulates the Xtensa LX7 cores, octal PSRAM, SPI2 DMA and the ILI9341, enough to boot unmodified ESP-IDF 5.5 firmware. Getting Doom playable needed a JIT that compiles Xtensa code to WASM: compiled blocks chained inside WASM, compiled interrupt/window-exception paths, and shared code compiled once (22 MB down to 8 MB of WASM per run, half the host CPU).

Full disclosure: Claude Opus 5.5 wrote all of the emulator's Rust code.

No sound yet, the audio calls are stubs.

Doom shareware © id Software


r/esp32 • • 20h ago

Hardware help needed My ESP32 project works on breadboard but fails on prototype PCB. The ESP32 runs fine when removed from the PCB but does not work when it is installed in the rest of the circuit. Post has full details along with GitHub repo link containing code and schematic.

Thumbnail
gallery
50 Upvotes

Github repo, including code and full schematic: https://github.com/rabbiabe/enchantress-quadrature-chorus/

I am working on a guitar effect pedal design that uses one of the generic aliexpress ESP32C3 super-mini boards to control and generate a low-frequency oscillator, but the actual audio processing is happening in discrete analog circuitry (no DSP on the ESP32). 

The ESP32 and DAC (MCP4728) worked when I set them up on a breadboard and read the LFO outputs with an oscilloscope, but on the fully-populated prototype PCB the ESP32 doesn’t work – it turns on (red LED) but nothing happens. 

When I remove the ESP32 from the PCB and plug it into my computer, I get the startup messages in serial monitor up to the point where it tries to initialize the DAC, at which point it obviously fails because the DAC isn’t there.

If I try to connect the ESP32 to serial monitor while it is installed in the PCB, nothing happens – the computer does not see a serial port for the ESP32. This holds true whether I am powering the ESP32 via usb or if I first power it via the main PCB power (PCB takes +9V and uses LM7805 to give +5V to ESP32).

Can anyone suggest what might be causing this problem? I checked the data sheet and as far as I can tell the pins I am using don’t have any “hidden” function that would interfere with USB serial. The PCB has test points for power and it seems like the ESP32 is getting the power it needs – the onboard LED comes on but that doesn’t tell me a whole lot. 


r/esp32 • • 8h ago

I made a thing! I built an ESP32-powered planter that can sense, remember, and interact

43 Upvotes

I've been working on a project called Rooted Intelligence, exploring what a quieter form of physical AI could look like.

What if AI didn't have to look or behave like a human or a pet, but could be something more stationary and connected to its environment, like a plant?

Here's what I've built so far:

Hardware & features:

  • ESP32-S3-CAM as the main controller
  • Soil moisture and BH1750 light sensors for environmental sensing
  • A tiny OLED display with pixel animations that respond to sensor readings
  • A camera that periodically captures moments from its surroundings
  • A web app for monitoring sensor data, browsing photos, and reading AI-generated diaries
  • Conversational AI with voice and text interaction through the web app
  • A custom 3D-printed enclosure

Why ESP32-S3-CAM:

I mainly chose it for its camera support and Wi-Fi connectivity. I didn't put too much thought into the board selection at the beginning, but for the next iteration, I'm considering a custom PCB to reduce the hardware footprint and improve component integration.

Libraries:

I'm using Wire, ESP_I2S, esp_camera, WiFi, WebServer, DNSServer, Preferences, HTTPClient, WiFiClientSecure, and ESPmDNS, along with a custom OLED runtime module.

Hardware challenges:

The biggest challenge was fitting all the components inside the custom enclosure. I had to carefully position the sensors and other electronic components, make sure they didn't interfere with each other, and keep everything securely in place. Moving from a breadboard prototype to a soldered setup was also part of the challenge.

Coming from a design background, this is my first attempt at bringing hardware, software, industrial design, and AI together into a physical product.

Any constructive feedback or technical suggestions would be greatly appreciated. Happy to answer any questions about the build!


r/esp32 • • 9h ago

I made a thing! I built a big-dog feeder with controller on ESP32 and parts breadboard-compatible, off a 5V USB charger do drive a worm gear motor and a set of 3D printed auger and chute geometry

31 Upvotes

My Golden Retriever Maya eats large kibble, and the commercial feeders I tried kept jamming on it. So I built my own. It took a lot of real-life iterations, and I learned a few things along the way that might help someone doing something similar.

The chute: getting the weight off the auger
A full box holds about 11 kg of kibble. If all that weight sits on the auger, kibble gets crushed, bridges, or wedges and stalls the motor. So the fix wasn't more torque, it was geometry.

The opening above the tunnel is more than 8 kibbles wide, with an angled floor inside it. Kibble slides down the wall first, then drifts into the tunnel, where the auger pushes it out. The auger fits the tunnel closely with no extra space, and I worked hard to leave no dead corner or ledge anywhere a kibble could get stuck, wedge against the auger, or start a bridge.

Power: everything on 5V USB
Because the auger only moves what's in front of it, it doesn't need to be driven hard. A nominal 12V worm gear motor driving a 3D-printed auger has enough torque at 5V, drawing less than 1 A and usually under 0.5 A. I ramp the PWM on start and on reverse to avoid current spikes, so a standard USB phone charger runs the whole thing.

Jam handling with an INA219
The INA219 reads motor current. A few thresholds tell me what kind of stall it is and which recovery to try. The auger then runs a back-and-forth clearing routine, counts the attempts, and uses the current reading to confirm it's free again.

Logging (screenshot attached)
Every feed and every reversal goes into a circular log on LittleFS (about 30 days), with each delivery graded by its current profile against a 0.50 A threshold:

  • Good: less than 10% of the meal time over the threshold, no reversal
  • Saved: a jam the reversal routine cleared
  • Partial / Jammed: attempts exhausted, or more than 50% over the threshold

So far it's 532 meals: 529 good, 3 saved by the reversal routine, and 0 partial or jammed. The last 30 days were 60 out of 60 good. The page also shows motor current per meal (min, avg, max), Wi-Fi outages and the last reboot. This was the most useful part for tuning. Instead of guessing whether a chute change helped, I could see it in the current data.

Schedule without Wi-Fi
Time syncs over NTP. If Wi-Fi drops, the internal clock keeps the schedule running, and it resyncs when the connection comes back.

Web app on the ESP32
The web app is served from the ESP32 itself. It works either as its own access point or on your home network (mDNS), and setup, manual feeding and stats are all done from a phone.

Platform

  • ESP32 DevKit V1 on Arduino. Cheap, easy to find, breadboard-friendly, Wi-Fi built in.
  • Every component is breadboard-compatible.
  • Libraries: WiFi, LittleFS, ArduinoJson, NTP time, mDNS.

Enclosure
A wooden farmhouse-style box with a food-safe kibble path. The chute sits inside the woodwork, so it doesn't look like a gadget in the kitchen.

I'm curious how others handle motor stall detection. Has anyone used something other than current sensing, like an encoder or a hall sensor on the auger? Happy to answer questions about any part of it.


r/esp32 • • 17h ago

I made a thing! I made a maze game with an esp32 and an mpu6050

17 Upvotes

I started learning electronics on my own outside work and school. For this project the sensor I tried was the MPU6050 IMU, and I used it to build a ball maze on a 1.3" OLED. You tilt the board to roll the ball to the exit, and each level is a new random maze.
The board is a standard ESP32 DevKit because that is the only board that I have currently. For the display I used Adafruit GFX with the Adafruit SH110X driver. For the MPU6050 I skipped a sensor library and read the registers directly with Wire. I only needed the X and Y accelerometer values, which a few lines of code covered. The display and the sensor share one I2C bus.
The first problem showed up on the very first upload, when the screen filled with static. The 1.3" module uses an SH1106 controller, and the SSD1306 library most tutorials use was writing to the wrong memory layout. Switching to SH110X fixed it. The next problem came from the physics. When the ball moved fast, it could jump straight through a 1-pixel wall in a single frame, so now it moves in small sub-steps and checks for a wall at each one. The raw tilt readings were also jittery. Calibrating at startup and adding a small deadzone made the ball sit still on a level table, and friction plus a little bounce off the walls made it feel like a real ball.


r/esp32 • • 21h ago

I made a thing! Battery alarm clock on the ESP32-S3-RLCD-4.2: deep sleep between minutes, and a reflective panel that kept freezing

Post image
16 Upvotes

I wanted a bedside clock with no glowing screen and no cable across the nightstand, so I've been building one on the Waveshare ESP32-S3-RLCD-4.2. It's at the point where it's my actual alarm clock now, so here's how it went.

Why this board and the S3

I mostly picked the board and the S3 came with it. For about $27 it has a 4.2" 400x300 reflective LCD, a PCF85063 RTC, an SHTC3 temperature sensor, an ES8311 codec with a speaker, and an 18650 holder with charging. That's nearly the whole clock on one PCB. Still, the S3 fit for its own reasons:

  • 8 MB PSRAM, so the framebuffer, TLS buffers and later MP3 wake sounds can all sit in memory at once.
  • Native USB, so people can flash it from the browser without installing a toolchain.
  • Touch-capable pins free on the header, for snooze pads through the case later.
  • Deep sleep with ext1 wake on several pins, so the RTC interrupt and both buttons can wake it.

I also thought about a Pi Zero 2 W (slow boot, SD card wear, too much idle draw) and an e-paper board like the M5Stack PaperS3. I went reflective LCD over e-paper because it updates instantly with no full-refresh flash or ghosting, which matters when the minutes change every 60 s in a dark bedroom.

How it runs

The S3 deep-sleeps almost all the time. The RTC's minute interrupt (GPIO15) wakes it. It copies the RTC time into the system clock, reads the temperature and battery, redraws only the digits that changed using a partial window, and goes back to sleep. A wake takes about 23 ms, 25 with a redraw. The panel keeps its image through deep sleep as long as it's in low-power mode with DC/CS/RST held. Wi-Fi only comes on once a day for NTP, and alarms don't need it at all.

Libraries, and what I wrote myself (with AI help)

  • PlatformIO + Arduino-ESP32 3.x (pioarduino, pinned, on IDF 5.5). Arduino gives me Wire, Preferences (NVS) and WiFi, and IDF calls like esp_http_server and the sleep/wake APIs are still right there. I passed on ESPHome because a custom alarm state machine and menu would fight it, and on bare IDF because Arduino is easier for contributors.
  • No LVGL, no GFX library. The display is my own small ST7305 driver plus a 15 KB framebuffer in the panel's native byte layout, with 1-bit fonts generated from Lato. That keeps wakes short, lets me send only the changed area, and it all builds and renders on a PC. LVGL may come back for widgets later.
  • Own small drivers for the PCF85063, SHTC3 and ES8311. I needed things the common libraries don't cover well: the RTC's minute interrupt and offset register, the SHTC3 CRC, and only a handful of codec registers for a beep (values taken from Waveshare's esp_codec_dev demo).
  • Own SNTP client and POSIX TZ parser instead of configTime. I wanted the measured offset and round trip, to write the RTC exactly on a second edge and measure the crystal drift between syncs. The TZ code converts any time, not only "now", which the alarm scheduler needs around DST jumps.
  • Nayuki's qrcodegen for the Wi-Fi setup QR code, and Unity for host tests. Everything hardware-free lives in lib/ and runs on a PC under pio test -e native.

What fought back

  • The panel freezing on battery. Now and then the screen kept the old image after a wake until reset. Once, after more than a day, it faded to blank and only a power cycle brought it back. The ST7305 datasheet showed I was breaking its timing: switching low-power to high-power mode needs 300 ms before writes, the way back needs 100 ms, and reset needs up to 120 ms. I skipped all of that on every minute wake. Now frames are written in low-power mode without switching modes at all. A long battery run is still going to confirm it.
  • No way to read the panel back. RDDPM reads 0xFF and the TE pin never pulses. On this module the controller's data-out doesn't seem to be wired, so the firmware can't even tell the panel is stuck.
  • Mirrored addresses. In landscape, the panel's column addresses run backwards. My first partial-refresh test box showed up bottom-left instead of top-left.
  • The RTC loses its time on power-off. The board has a J7 connector for a backup cell (ML1220, rechargeable, not CR1220), but I run it without one. So the firmware never guesses a time: it shows "Time not set" until you set it with the buttons or NTP. After power-up the RTC crystal also needs up to ~2 s before a time write sticks.
  • Crystal drift was about 3.5 s/day (~40 ppm). The NTP sync now measures it and trims the PCF85063 offset register automatically.
  • DST around alarms: alarms are scheduled in UTC, an alarm in the skipped hour rings at the jump, and in the repeated hour it rings only once.
  • RTC_DATA_ATTR gotcha. A struct with default member values got startup code that reset it on every deep-sleep wake. RTC-memory variables now have to be constant-initialized.

What it does today

Up to 16 alarms with weekdays, labels, per-alarm volume and a rising or steady beep. Snooze, stop and skip-next on the two buttons. A two-button menu for date/time, timezone, alarms and Wi-Fi. Optional Wi-Fi setup by QR code and captive page. Room temperature and a low-battery mark on the face.

Battery life should be weeks, but I haven't measured the sleep current yet. That's the next thing I need to check.

Next: a 3D-printed case

Right now it's a bare board on the nightstand. The case is a parametric OpenSCAD design meant for PETG on a home printer, with:

  • a sealed chamber behind a grille so the little speaker sounds less tinny
  • copper-tape touch pads under the top and sides for snooze and stop through the plastic
  • a vented pocket that keeps the temperature sensor away from the board's heat
  • a diffuser for a warm-white sunrise LED
  • easy access to the 18650 and the USB-C port

I'll publish the STLs and a print guide once the first prints actually fit the board. If you've done capacitive touch through 2-3 mm of PETG, I'd love tips.

Code is GPL-3.0, and you can flash it from the browser (steps in the README): https://github.com/braveadmin/inkwake

Happy to answer questions, especially from anyone else with this board.


r/esp32 • • 6h ago

AI Content Started prototyping a wearable push-to-talk voice input device on an ESP32-S3-Touch-AMOLED-1.8 (mic + IMU + touch + Wi-Fi/BLE).The basic audio-to-local-server loop (sending audio to my PC running transcribe.cpp + llama.cpp and getting cleaned text back in ~2s) was surprisingly smooth.Where it ge

Post image
9 Upvotes

Where it gets tricky is trying to make the ESP32 emulate a BLE HID keyboard/mouse so it can type or trigger shortcuts directly on macOS, Windows, Linux, and mobile without installing a client app on every machine:

  • Pairing/reconnection stability when switching hosts quickly
  • Different OS handling for non-ASCII / fast keystroke bursts
  • Power draw balancing Wi-Fi audio streaming + BLE HID on a tiny battery

For folks who've built multi-host BLE HID gadgets on ESP32-S3: did you stick with pure BLE HID, or end up using a tiny USB dongle / companion daemon instead?


r/esp32 • • 3h ago

I made a thing! esp32 access control

Post image
7 Upvotes

I've been building Limen, a self-hosted, open-source access control system. Here's the first reader prototype: an ESP32-S3 + PN532 + a relay, built from off-the-shelf parts.

It reads MIFARE and DESFire cards, and phones through a small Android app (APK) that works over both NFC and BLE. The reader decides locally, so doors keep working even if the server is down. The server is a simple web app you can run on a Raspberry Pi.

It's still a prototype, so feedback is very welcome.

Parts, photos, wiring diagram and the APK are on GitHub: https://github.com/isidorzabiku-pixel/Limen-Access-Control


r/esp32 • • 6h ago

I made a thing! I turned an ESP32-S3 Cardputer into a FIDO2 + OpenPGP security key with on-screen approval (open source)

Post image
6 Upvotes

I built this, so I'm biased, but I think the ESP32-S3 parts might be interesting here.

SecTrustKey runs on the M5Stack Cardputer ADV (ESP32-S3, 8 MB flash). One USB composite device: HID for FIDO2/CTAP, CCID for OpenPGP and PIV APDUs, plus HID keyboard and a vendor interface. Every request runs on one command thread on core 1, and the UI on core 0 shows a prompt that you approve with Enter.

A few things I had to solve:

- Keys at rest: optional passphrase, PBKDF2-HMAC-SHA256 calibrated on the chip, AES-256-GCM sealing of the master keys.

- Power-cut safety: two mirrored key pages with generation numbers; the page that isn't current is always written first.

- Coexisting with M5 Launcher: Launcher copies whatever bytes your image has for each data partition, so the storage partition starts with a 4 KB pad that the image carries; the keys live after it and are never in the image.

Honest limit: no Secure Boot or flash encryption (deliberately, no eFuse burning), so without the passphrase someone with the chip can read the keys.

Installs from M5 Launcher, M5Burner or esptool.

GitHub: https://github.com/TakMashhido/SecTrustKey

Docs, with architecture diagrams: https://koustavmondal.com/SecTrustKey/concepts/architecture/


r/esp32 • • 22h ago

Solved Would You Design This ESP32 Circuit Differently?

Thumbnail
gallery
4 Upvotes

Board Review
I designed a custom ESP32 circuit with RGB
LEDs on all four sides to create a candle-like lighting effect.
But I'm curious...
Would you have designed it differently, or do you like this approach?

The full build is now available on my YouTube channel!

Let me know what you think!


r/esp32 • • 4h ago

Hardware help needed Where to buy ESP32-S3 N16R8 Dev Board 16MB Flash 8MB PSRAM WiFi Bluetooth 5 USB-C

3 Upvotes

Any ideas anyone(I’m in the UK) - I’m after a genuine ESP32-S3 N16R8 Dev Board 16MB Flash 8MB PSRAM WiFi Bluetooth 5 USB-C but I have read some concerning issues from my normal source(Amazon). Strangely I couldn’t see one on Pihut which is another favourite supplier.


r/esp32 • • 16h ago

Hardware help needed Wall-to-adapter-to-esp32 connection recommendations for a sensor cluster for constant air monitoring

3 Upvotes

Hi, l'm new to electronics and wanted a sanity check on my idea of using an

adapter or a buck converter board(?) to power an

esp32 (or any microcontroller) from the mains. I

was intially thinking of buying an IRM-10-5 module

from mouser and connecting it somehow to a cut

mains cable from some old device. This sounds a

bit risky to me if I want a very reliable connection,

Also scary. Is there a safer option?

I have been only using my laptop as power source so far for smaller projects. So I wanted to doublecheck before trying T-T

[My project is to make a sensor module using a

microcontroller (so the esp32) and gas sensors

which would continuously store the data on an sd

card and also send it via wifi to a computer]


r/esp32 • • 8h ago

Hardware help needed Xiao Esp32c3 strange behavior

2 Upvotes

Hello,

I ordered a bunch of xiao Esp32c3 boards for iot projects.

I note issues with this board with usb native port. The first time I program it's OK. After reset, I can't see anything on serial debug port on arduino console. Must press boot / reset / release reset / boot for usb to be ok.

I used this board before without any problem.

Are there some users of this xiao board? Same issues?

Thx for your help.


r/esp32 • • 13h ago

I made a thing! Central de Monitoramento — Sítio 4 Irmãos - ESP32 S3

Post image
2 Upvotes

I built a desk monitor for my family's farm water tanks with an ESP32-S3: LED matrix, voice assistant and Telegram alerts

I made a small desk unit that shows the water level of the tanks on our farm, plus weather and battery data. It runs on an ESP32-S3 with a 4x MAX7219 LED matrix.

What it does:

  • Clock, local temperature and humidity (DHT22)
  • Every 10 minutes it cycles through the farm data: tank levels, temperature, humidity, pressure and rain
  • Voice assistant: press a button and ask things like "what's the level of tank 1?". It transcribes with Groq (Whisper) and answers with synthesized speech
  • Alerts from the farm come through Telegram with a "Seen" button, and a blinking 8x8 icon stays on the matrix until I tap it
  • Data comes from a second ESP32 at the farm via Firebase Realtime Database
  • 3D-printed case (OpenSCAD files included)

Code, wiring table, parts list and case files are all in the repo (Portuguese README, comments in Portuguese): https://github.com/ricardoluizzuliani00/central-de-monitoramento-esp32

Happy to answer questions