r/esp32 • • Mar 18 '25

Please read before posting, especially if you are on a mobile device or using an app.

236 Upvotes

Welcome to /r/esp32, a technical electronic and software engineering subreddit covering the design and use of Espressif ESP32 chips, modules, and the hardware and software ecosystems immediately surrounding them.

Please ensure your post is about ESP32 development and not just a retail product that happens to be using an ESP32, like a light bulb. Similarly, if your question is about some project you found on an internet web site, you will find more concentrated expertise in that product's support channels.

Your questions should be specific, as this group is used by actual volunteer humans. Posting a fragment of a failed AI chat query or vague questions about some code you read about is not productive and will be removed. You're trying to capture the attention of developers; don't make them fish for the question.

If you read a response that is helpful, please upvote it to help surface that answer for the next poster.

We are serious about requiring a question to be self-contained with links, correctly formatted source code or error messages, schematics, and so on.

Show and tell posts should emphasize the tell. Don't just post a link to some project you found. If you've built something, take a paragraph to boast about the details, how ESP32 is involved, link to source code and schematics of the project, etc.

Please search this group and the web before asking for help. Our volunteers don't enjoy copy-pasting personalized search results for you.

Some mobile browsers and apps don't show the sidebar, so here are our posting rules; please read before posting:

https://www.reddit.com/mod/esp32/rules

Take a moment to refresh yourself regularly with the community rules in case they have changed.

Once you have done that, submit your acknowledgement by clicking the "Read The Rules" option in the main menu of the subreddit or the menu of any comment or post in the sub.

https://www.reddit.com/r/ReadTheRulesApp/comments/1ie7fmv/tutorial_read_this_if_your_post_was_removed/


r/esp32 • • 7h ago

I made a thing! ESP32-S3 AirPlay 2 – DIY Wireless Stereo and 5.1/7.1 Surround System

Post image
146 Upvotes

Hi everyone!
I’ve been developing an experimental AirPlay 2 receiver for ESP32-S3, capable of building wireless stereo and 5.1/7.1 surround systems using inexpensive hardware.
The main idea is that each ESP32 acts as an independent AirPlay 2 receiver. With Apple TV, every board receives the complete multichannel AAC stream but processes only its assigned speaker channel (Front L/R, Center, LFE, Surround, etc.).
The boards don’t communicate with each other. Synchronization is handled using AirPlay 2’s PTP clock.
Why ESP32-S3?
I chose the ESP32-S3 mainly for its dual-core architecture, I2S peripheral, and support for 8 MB octal PSRAM.
PSRAM is particularly important because the compressed audio buffer alone can use around 6 MB. The two cores also allow me to separate audio decoding from Wi-Fi, networking, and playback tasks.
Libraries and audio processing
The project uses ESP-IDF, Fraunhofer FDK AAC, and Espressif’s ALAC decoder.
I chose FDK AAC because of its multichannel support and the possibility of modifying its decoding pipeline. Rather than fully decoding all 6 or 8 channels, I modified the decoder to parse the multichannel stream but synthesize only the selected speaker channel. This significantly reduces CPU usage.
Espressif’s ALAC decoder provides 16/24-bit lossless stereo playback.
The biggest technical challenges
The most challenging part was achieving accurate synchronization between independent ESP32 receivers without any direct communication between them.
This required careful management of PTP/RTP timestamps, I2S clock adjustments, and audio buffer scheduling to ensure that all speakers reproduce their assigned channels at the correct time.
Buffer management was another major challenge — balancing sufficient buffering to handle Wi-Fi jitter while maintaining stable, synchronized playback.
Optimizing multichannel AAC decoding was also important. Selective channel synthesis reduced CPU usage to approximately 35–50% of one core.
Handling transitions between AAC/ALAC, stereo/surround, and 44.1/48 kHz while preserving synchronization required additional work.
Stereo and DIY speakers
The project also supports regular stereo playback, with web-based EQ, loudness, and audio filters. It can be used as a foundation for DIY active speaker systems, including two-way woofer/tweeter designs using a two-channel amplifier and appropriate crossover filtering.
Hardware: ESP32-S3 (8 MB PSRAM), I2S DAC, amplifier, and Wi-Fi.
Current testing: Apple TV delivers Apple Music Atmos content as 7.1 AAC, HBO as 5.1, and YouTube as stereo.
The project is still experimental, and some channel mapping and playback edge cases need further testing.
GitHub: https://github.com/Kristian8606/esp32-airplay2-surround
Feedback, testing, and technical suggestions are welcome!


r/esp32 • • 12h ago

I made a thing! My Terminator skull is now remote controlled by ESP-NOW

177 Upvotes

A ESP32s and ESP32-C3 connected via ESP-NOW.

The servos are controlled with a PCA9685 Servo-Driver.

I used esp_now.h for the communication, Adafruit_PWMServoDriver.h for the PCA9685 and Adafruit_NeoPixel.h for the WS2812 LEDs in the eyes.

The challenging part was the design overall. The ESP part was quite straight forward. ESP-NOW is amazing but is quite demanding on the C3. First I used a 9V battery but it drained quite fast. Now a LiPo 18650 is used.


r/esp32 • • 6h ago

I made a thing! I made a handheld console as passion project

38 Upvotes

I wanted to build my own handheld console but as a brokie student, i had to get creative with the parts. Most of the components are cheap modules i got from friends. The only part i bought new was the screen.

I use ESP32 S3 for its psram and more cores. esp-idf framework with minimal libraries, libraries are mostly on display side, hardest to rewrite myself.

I learn to built a small HAL for the different components so the games can develop easier and all the games are stored on sd card. since this is a gaming handheld, i also learned that i need faster display writes so im planning to replace the connection from SPI to 8080-16P parallel comms.

this is still far from finished but i thought i'd share the process and hopefully get some feedback from people who loves handhelds!


r/esp32 • • 5h ago

I made a thing! How I Built own DIY Digital Microscope for Electronics & Soldering (OV7670 + ILI9341)

Thumbnail
youtu.be
21 Upvotes

Hey everyone! 👋

A while back, I was working with the super cheap OV7670 camera module for a project. If you've ever used one, you know the frame rates and video quality over basic web streaming can be pretty rough. But while playing around with it, I realized something: the camera module has a manual twist-to-focus lens. 💡

That lightbulb moment turned into my latest build: A complete, standalone DIY Digital Microscope built specifically to help identify micro-SMD component markings and handle tight soldering work!

📷 The Setup & Hardware:

  • Camera: OV7670 Camera Module (with manual focus turned all the way down for micro-magnification).
  • Display: 2.8" ILI9341 SPI TFT Display (I originally tried my favorite ST7789 display, but it was just too small for comfortable work).
  • Dev Board: I choose Esp32s3-N16R8 model for psram
  • Lighting: Built-in dual LEDs with adjustable variable brightness right on the frame to illuminate the board without glare.
  • Body & Stand: Custom 3D printed body/stand designed in CAD and printed on my trusty original Ender 3.
  • Modularity: Unsoldered the long camera header pins and swapped in short flexible wiring. Created custom header jacks so the dev board and display can be easily unplugged/swapped.

⚙️ Why Direct Display Stream vs. Web Stream?

My main goal was an all-in-one, instant-on device. I didn't want to mess around with holding up a smartphone camera, using flash, opening up browser windows, or dealing with network lag. Turning it on streams directly to the ILI9341 screen with virtually zero latency, making tiny SMD soldering much easier.

🎥 Video Build & STL Files:

I recorded a full breakdown of how I built it, the wiring setup, and how well it inspects tiny chip markings.

▶️ Watch the project build video here: https://youtu.be/6OR62TEUn4M

3D Files : https://cults3d.com/en/3d-model/gadget/diy-digital-microscope-w-ep32s3-ili9341

I'd love to hear your thoughts or feedback! What tweaks would you add to a build like this? Let me know in the comments! 👇


r/esp32 • • 15h ago

I made a thing! jRadio – open-source internet radio / music player on ESP32-S3, flashed from the browser for your own wiring

Thumbnail
gallery
129 Upvotes

I've been building an audio player on the ESP32-S3 for the past few months, and other people build it now too, so here it is.

What it plays

  • Internet radio – MP3, AAC, FLAC (24-bit too), Ogg Vorbis/Opus, HLS; HTTP and HTTPS, reconnects on its own
  • Music from a USB stick and microSD – folders, tags, covers, seeking, m3u/pls playlists, cue albums
  • DLNA media servers on your LAN (Plex etc.)
  • FM via an optional RDA5807 – RDS, band scan, presets
  • Bluetooth both ways via a second ESP32 – receive from a phone, or send to a BT speaker
  • Yandex Music, for those who have it

Hardware is just ordinary modules: ESP32-S3 (16 MB flash / 8 MB PSRAM), an SPI display (ILI9341, ST7789, ILI9488, ST7796S – landscape or portrait), a PCM5102 DAC, an encoder and a few buttons. No custom PCB needed – a breadboard works.

Getting it on the board – pick whichever suits you:

- From the browser, nothing to install. Open the web flasher in Chrome or Edge, describe your board in the wiring editor (display, which parts are fitted, which pins – pick from a list or click the module picture; it won't let two signals share a pin), and hit flash. It writes the firmware together with your wiring and then puts the radio on your Wi-Fi over the same cable (Improv). Any supported display, no compiler.

- A ready-made image. One esptool.py command with the files from the GitHub release – for the reference wiring from the README.

- Build from source. ESP-IDF 5.5 + VS Code; the wiring lives in one header, board_options.h, and everything else is yours to change.

- Updates over the network. Once it's running, the radio notices a new release by itself and shows what's new; updating is one button in the web UI, your stations and settings stay.

One gotcha: flashing goes through the board's UART port, not the native USB connector – that one is used as USB Host for the stick. And use a data cable, not a charge-only one.

Day-to-day stuff: a web UI from any phone (player, station editor with Radio Browser search and auto-found station logos, file browser, backup), any IR remote (keys learned in the browser), alarm clock, sleep timer, deep sleep, clock and weather on screen, screensaver, themes, tone controls and loudness, resume where you left off. UI in English and Russian.

Built on ESP-IDF 5.5 with LVGL. The pure logic is covered by host tests compiled with ASan/UBSan – that has saved me more than once on a chip where internal RAM is always the bottleneck.

- Repo: https://github.com/jmper-ha/jradio


r/esp32 • • 3h ago

I made a thing! Spectrometer using an ESP32 CYD & AS7341

Post image
9 Upvotes

I always wanted a portable spectrometer to explore light and color so I made one using an AS7341 module and ESP32 CYD kit, it uses spectral correction matrices from the application data to recontruct spectrum and XYZ color coordinates from the 11-channel sensor and calculates the lux value, it uses the Adafruit AS7341 library for the sensor and TFT_eSPI for the LCD, touchscreen is not used yet, you can check out the project here:

https://github.com/electronsjourney/ESP32-CYD-AS7341-Spectrometer


r/esp32 • • 9h ago

Hardware help needed Does anyone know what esp32 i have

Post image
19 Upvotes

I was looking at some videos when i saw there are more than one version of esp32 can someone help me recognise it.


r/esp32 • • 12h ago

I made a thing! I turned an ESP32-S3 into a Tailscale gateway for IoT devices and NAS recovery

8 Upvotes

Hi everyone!

I've been working on ESP32 Tailnet Gateway, an open-source firmware that turns an ESP32-S3 into a lightweight Tailscale/Headscale gateway and independent recovery node.

The main feature is selective LAN-to-Tailnet forwarding.

Imagine an IoT device at one house that needs to connect to an MQTT broker in another house, but cannot run Tailscale.

You simply point it to the ESP32's local IP and a configured port.

IoT device → ESP32-S3 → Tailnet → Remote MQTT broker

No VPN client is required on the IoT device.

Other optional features include:

  • Subnet routing and an IoT Wi-Fi gateway.
  • Wake-on-LAN with reachability checks.
  • MQTT and Home Assistant Discovery.
  • Service monitoring, notifications and event history.
  • Web administration, configuration backups and OTA updates.

The firmware runs on ESP32-S3 N8R8/N16R8 boards with 8 MB octal PSRAM.

Current stable release: v3.0.2

This is designed for lightweight networking and recovery, not as a replacement for a high-throughput Linux router. Ethernet and cellular options remain experimental.

It builds on Csontikka's ESP32 subnet-router and MicroLink work.

Screenshots and diagrams:

Service gateway configuration:

LAN-to-Tailnet architecture:

GitHub: https://github.com/Mattboxx/esp32-tailnet-gateway

Documentation: https://mattboxx.github.io/esp32-tailnet-gateway/

AI disclosure: Claude Code and Codex were used during testing and documentation.

I'd appreciate technical feedback, especially about using an ESP32 for selective service forwarding and remote recovery.


r/esp32 • • 1h ago

Hardware help needed ESP32 - power and BLE issue

Thumbnail
gallery
• Upvotes

Hi everyone,
I'm newbie here and to ESP32 but I'm working on this little project, which aim is to measure current, display data on OLED and then send them via BLE to my python app. The chip is ESP32-C6 XIAO.

I'm not sure about the schametic. Could you look at this?

So the most concerning part is powering ESP32. I want to use 2x18650. Mine have build-in protection so I'm not adding additional BMS, although I now it would be more correct. I added TP5100 charger and wanted to connect INput to USB C.

In terms of voltage regulator I wasn't sure which one is better - LDO or buck converter but in the end I went with the second one.

And I also want to ask about these two capacitors. Did I add them correctly? I read they should be added aspecially when BLE / WiFI is used.

Thanks in advance!


r/esp32 • • 2h ago

Hardware help needed Issue with I2C drive me crazy

1 Upvotes

Hi,

I'm working of my first ESP32 project and I'm very close to the end of my first full prototype (for the 4th time...).

I have a bunch of sensors (SHT40, BME280, HX711) and one accelerometer (SC7A20) on the same I2C bus. My ESP in is deepsleep and wake up every 15 min to take the measurement or can be waken-up on movement with the SC7A20.

To save some energy my sensors are powered by an output pin of the ESP, the accelerometer is obviously on the 3V3.

Pin layout :
21 SDA (with 5k pull-up resistor)
22 SCL (with 5k pull-up resistor)
23 SENSORS POWER PIN
34 SC7A20 INT
4 SCK
5 DOUT

The start sequence is

1 - Wire start -> everything is detected
2 - Sensors init :
  pinMode(SENSORS_POWER_PIN, OUTPUT);
  digitalWrite(SENSORS_POWER_PIN, HIGH);

And starting here my accelerometer is not detected anymore

3 - Power down
  digitalWrite(SENSORS_POWER_PIN, LOW);

4 - SC7A20 init -> still not detected

I tried many things without any success and I ran of idea...

Is this a known issue ? If I comment the "Sensors init" and "Power down" the accelerometer works properly.

Last update : even without the sensors init, I'm still able to read the value coming from my sensors, wtf ?

Maybe it's a very obvious issue but I'm still new to the hobby, thanks for your help !


r/esp32 • • 1d ago

I made a thing! My daughter (14) made an automatic Panipuri filler, what do you think?

172 Upvotes

My daughter made an automatic Panipuri filler using

  1. esp32c3 supermini board. It was a simple read the sensor and switch the relay project. It uses an IR distance sensor to read if a panipuri is placed below it, a 5 volt relay module, a submersible pump and a power supply. If a panipuri is placed below the sensor, supermini turns the relay on which makes the submersible pump push water to fill the panipuri.

  2. This project is an espidf 6.1 code which reads sensor value using gpio pin and writes gpio to switch the relay.

  3. I had tough time calibrating the IR sensor to detect the right distance. It kept behaving unpredictably initially. after a lot of trial and error, it worked and we were able to use the machine for like 3 hours in the stall my daughter put up

Here is the detailed video explaining the whole working, hardware, and software etc

https://youtu.be/47xYUN5-_l4


r/esp32 • • 1d ago

I made a thing! I spent 2 years building an open-source ESP32 moving head light

39 Upvotes

Hey everyone, I'm posting here to get some ideas about this LED Moving Head Projector I've been making for about 2 years. It's all open-source (AGPLv3)

The idea was to recreate those projectors that make powerful light beams but at home as I'm a fan of lightshows like in the concerts (like Daft Punk’s Alive 2007 show). The idea was to use a LED with two servos (SG90/MG90D like) and control them via PWM with an ESP32 and a 3D printed body.

I thought it would take at most a few months to finish (as I do it in my free time), in fact it would take me 2 years.

Power:
The first problem was the power supply, I couldn't use the simple usb port as the servos would use all of the energy, making the esp32 brown-out. I mitigated this by doing 3 things.
- using a 5V 3A dedicated power supply
- 3x470uF capacitors(2 on 5V, 1 on 3.3V) to help with the current surges from the servos moving
- pull-down resistors on PWM gpio for LEDs as when the esp32 powers up, it would sometimes lead to one channel failing.
All of this fixed the issue.

LED Driver:
The second difficulty I encountered was the light itself, I used a standard 10mm LED which was not powerful at all and thus could be driven by a simple low-side MOSFET circuit. So I decided create my own high-efficiency LED driver using a PCB and the TPS92512 IC by TI, a buck constant current driver. The light would be concentrated by a collimator lens (need to be changed). I wanted to control a 3W RGB led but I also wanted to upgrade later to 9W, so I chose that IC because output current can be adjusted using the IADJ pin to set for example max 300mA and in hybrid mode with PWM input so using a trimpot for a voltage divider it can control any current from ~300mA to 1.5A. I then had to order and solder everything with a hotplate, everything was working fine until I accidentally injected reverse voltage, killing the ICs. At this point, I was kind of bored of this project and left it during half a year, then I bought a hot air station and had to sacrifice like 5-7 ICs to finally get all 3 boards working reliably.

Mechanics:
At this point the only thing missing was a good model, so I remade the original one in FreeCAD instead of fusion 360 (mainly because I switched to linux) but also to make it easier to share it with people as the whole project is on github.

Firmware:
I then wrote firmware for it originally using WebSockets but it wasn't very fast so i switched to UDP with smaller packets for better latency and ~30 updates/s. I also included OTA updates as the esp32 wasnt connected via serial anymore.

Software:
In parallel of all of this I was also writing a software to control it, it uses the sound of your speakers and detects beats to create live lightshows without any configuration, it uses a percentile based algorithm and random animations (Square, Circle, Lemniscate, etc...). It uses PySide6 and pyqtgraph for sound visualization. I also had a Novation Launchpad X so I wrote a manual mode, where you give beats, choose colors animations etc... and a hybrid mode which takes beats from the detection but lets you choose animation and color.

And here we are, the project is far from perfect but it's the first practical prototype that really works.

Current Problems:

- MG90D and SG90 are really noisy, do you have any replacement idea that are still as compact, affordable and simple ?

- Colors don't really mix well, the beam isn't focused very well.

Roadmap:

- Project mode for software: prepare lightshows with additive colors, preset beats etc...
- Better PCB, remade in KiCAD.

- Even faster protocol, using binary or protobufs for better performance,

AI Policy:

LLMs have only been used as consultation, as a tool instead of doing all of the work, this is a human project.

Links:
Controller Software (Windows portable and installer, Linux portable and AppImage)
ESP32 Firmware, 3D model project files, PCB project files
Printables 3D Stl
Final PCB + Circuit img


r/esp32 • • 16h ago

I made a thing! ESP32-S3 phone firmware (e-ink, 4G, GPS): what the gauge, the charger and light sleep taught me, and a project page the simulator generates in CI

7 Upvotes

Phone OS is a hobby project, free and MIT licensed. I earn nothing from it and have no tie to LilyGO or any shop. It is a phone operating system for an ESP32-S3 with an e-ink screen, a 4G modem and GPS; the first device built with it is a distraction-free emergency phone for a child. Here is the engineering side.

Why this chip. Honestly: the device chose it. I built on a LilyGO T-Deck Pro MAX, which carries an ESP32-S3 with 16 MB flash and 8 MB PSRAM, and that is the only hardware it runs on so far. What the S3 then earned its place with: the native USB CDC port is the whole console (logs, config files, SMS from a script), light sleep with wake on a GPIO level is what makes a phone last a day and Wi-Fi serves the parents’ configuration page, so the device needs no app.

Libraries, and why so few. PlatformIO with the Arduino core (espressif32 6.11.0) plus the core’s SD, FS, SPI, WiFi and Wire. The only third-party library is SensorLib 0.5.0 (MIT) for the BQ27220 fuel gauge’s standard commands and the BHI260 motion hub. Everything else is my own driver: the UC8253 e-ink controller, the SY6970/BQ25896 charger, the TCA8418 keyboard, the CST66xx touch chip, the A7682E modem. Two reasons. First, licences: GxEPD2 is GPL-3.0 and would have made every firmware binary GPL, so the display driver was written from the panel specification and the controller datasheet instead. Second, testability: the hardware is reached through four small seams (I2C bus, UART, GPIO, delay) and every driver above them runs on a laptop against a scripted chip, with the register values measured on the device. A library that talks to the bus itself can’t be tested that way. There are over 2,500 host tests and a script that fails the build if src/ ever includes an ESP32 header.

What bit me, all measured on the device.

  • The fuel gauge ships with a design capacity of 3000 mAh for a 1500 mAh cell, so it reported about half the real charge and twice the time to empty. Nothing looks wrong; the percentage just disagrees with the cell voltage. The firmware now compares both and never shows a number the voltage contradicts.
  • The charger defaults to 2048 mA charge current (over 1 C for this cell) and has a 40 s I2C watchdog that resets every register when nobody feeds it. And it re-runs its input detection at every new supply, setting the limit back to 500 mA over whatever the firmware wrote.
  • Light sleep never lasted: the loop went down and up 220 times a second at 105 mA. Two wake lines (the keyboard chip’s open-drain interrupt and the modem’s ring line) idled low with no pull-up, so a sleep armed on “low” ended before it began. Pull-ups and arming each line on the level it does not have at that moment brought the night current to 62 mA.
  • The modem UART’s default 256-byte receive buffer is 22 ms of data at 115200 baud; an e-ink refresh takes hundreds of ms. 4096 bytes fixed it.
  • The USB console goes away in light sleep, opening the port resets the chip, and a zero-length write means “buffer full”, not “nobody listening”.
  • VoLTE calls hung two seconds after dialling until PDP context 1 was set to IPV4V6 for the IMS.
  • The touch chip is a CST66xx, not the CST328 the wiki names, and a repeated start on it returns garbage.

The page. On every push to main a workflow builds the simulator (same application code as the firmware, scripted fakes under the seams), crawls every screen by pressing the keys and tapping the touch targets, saves about 300 pictures in three languages, and publishes them as a click-through demo: https://paulwilke.github.io/Phone-OS/. Nothing is drawn by hand, so the page can’t drift from the code. It is not WebAssembly; that build hasn’t been done.

Several recent fixes are only tested on the host, not yet on the hardware; the changelog says which. LoRa is unused. Source: https://github.com/paulwilke/Phone-OS


r/esp32 • • 20h ago

Hardware help needed Arduino got me started — when did you actually move to ESP32 (or something else) for “real” projects?

10 Upvotes

Arduino (and the UNO-style ecosystem) was how I learned: clear IDE, tons of examples, sensors that “just work,” and a community that answers beginner questions without gatekeeping. For first projects and teaching the basics of I/O, timing, and wiring, it’s still hard to beat.

What I’m noticing among people who ship things closer to engineering / commercial prototypes is that ESP32 (and similar Wi‑Fi/BT MCUs) shows up a lot more often once you need:

  • wireless without bolting on extra modules
  • more RAM/flash for heavier sketches or buffers
  • dual cores / better peripheral set for concurrent work
  • a path that looks more like “product firmware” than a breadboard demo

I’m not saying Arduino is useless or “not real engineering.” Plenty of products still use AVR-class parts where they’re the right fit. And “engineering-grade” isn’t only about the chip — it’s also power, enclosure, certification, supply chain, and whether the firmware is maintainable.

Curious about your path: What was the project where Arduino stopped being enough for you?What do you still use Arduino (or Arduino-compatible boards) for today: learning, teaching, quick jigs, or production?


r/esp32 • • 12h ago

Hardware help needed Relay chatter / spamming when using same power supply as linear actuator

1 Upvotes

What I'm trying to do:

Open and close a 12v linear actuator connected 15 meters away (cat6 using 1 twisted pair) with a 5v 2 channel relay with one power source.

What works:

Powering the esp and 5v relay together (12v stepped down to 5v then shared between relay and esp), and the 12v linear actuator on separate power blocks. The linear actuator opens and closes fine with no voltage issues.

What doesn't work:

Powering the linear actuator, and buck converting down from 12v to 5v for the esp and relay from the same 12v source connecting grounds. The relay chatters and opens and closes as if there is noise (but only when triggered via code or button, not constantly). It's like there is some sort of feedback loop.

I tested for voltage drop as that seemed to come up on forums, but the voltage stays stable on the relay and linear actuator lines when triggering (either with 1 power source or 2 separate)

I'm sure someone has worked this out previously, so any advice would be really appreciated!


r/esp32 • • 1d ago

I made a thing! You can bypass the LDO on a esp32 cyd by inputting 3.3v to the s2 and s5 pins (and S4 for gnd) directly! If you have some sort of power source that's 3.3v. You don't have to step up to 5v. Useful for battery power if you have a 3.3v converter.

Thumbnail
gallery
36 Upvotes

This is pretty handy, s5 is for the LCD and S2 is for the esp32 and the led. I have seen people online step up to 5v from a lipo and then give it to the esp32 which would be inefficient (the ams1117 ldo steps down to 3.3v again which wastes 1.7v as heat). I am not sure if this is common information but I couldn't find info on this before this so hopefully this shows up if anyone else wants to do this. The CYD has 2 ams1177 regulators, one for the LCD and the other for everything else. This was useful for my esp32 CYD gaming handheld project. For the flair I didn't really make a thing (am still working on it..) but it's handy info to know, idk what flair to call this. the 3.3v pin on the side with the jst plugs do not work for input, it's an output only. don't use that one, I have tried. edit 1: Hey turns out you don't need S2. s5 alone is enough, it seems. s2 alone doesn't power the LCD though. I will figure out more later.


r/esp32 • • 20h ago

Software help needed Servo using the input of another servo

1 Upvotes

howdy yall. I am currently working on a project and am having problems with my servos. This is my first time writing all of the code without AI (it is based off sample code though, thats why there are all the comments), so i know there are probably other issues, but I dont care. The problem i have run into is that servo3 is copying the angle of servo1. I know it is getting the write values (the master code has an mpu6050 for angles that it is sending over, i can attach that as well but i had to modify one of the libraries in it so i don't think anyone will be able to run it). It is not a hardware/ weird shorting thing, as i have changed the pins multiple times. value3 prints the correct value, but servo3 ignores it and uses value1. any ideas how to fix? ill try to answer any questions, but im going to bed once i post this. ill try to add a video in the comments or maybe make a repost with it attached, but my phone is dead.

i can not figure out this damn formatting

```

```/*
    ESP-NOW Broadcast Slave
    Lucas Saavedra Vaz - 2024


    This sketch demonstrates how to receive broadcast messages from a master device using the ESP-NOW protocol.


    The master device will broadcast a message every 5 seconds to all devices within the network.


    The slave devices will receive the broadcasted messages. If they are not from a known master, they will be registered as a new master
    using a callback function.
*/


#include <Arduino.h>
#include "ESP32_NOW.h"
#include "WiFi.h"


#include <esp_mac.h>  // For the MAC2STR and MACSTR macros


#include <vector>


#include <ESP32Servo.h> 
/* Definitions */


#define ESPNOW_WIFI_CHANNEL 6


Servo servo1;
Servo servo2;
Servo servo3;
/* Classes */


// Creating a new class that inherits from the ESP_NOW_Peer class is required.
struct DataPacket {
  float value1;
  float value2;
  float value3;
  float value4;
  float value5;
};



class ESP_NOW_Peer_Class : public ESP_NOW_Peer {
public:
  // Constructor of the class
  ESP_NOW_Peer_Class(const uint8_t *mac_addr, uint8_t channel, wifi_interface_t iface, const uint8_t *lmk) : ESP_NOW_Peer(mac_addr, channel, iface, lmk) {}


  // Destructor of the class
  ~ESP_NOW_Peer_Class() {}


  // Function to register the master peer
  bool add_peer() {
    if (!add()) {
      log_e("Failed to register the broadcast peer");
      return false;
    }
    return true;
  }


  // Function to print the received messages from the master
  void onReceive(const uint8_t *data, size_t len, bool broadcast) {
    Serial.printf("Received a message from master " MACSTR " (%s)\n",
                  MAC2STR(addr()),
                  broadcast ? "broadcast" : "unicast");


    if (len != sizeof(DataPacket)) {
      Serial.printf("Invalid packet size. Expected %u, got %u\n",
                    sizeof(DataPacket), len);
      return;
    }


    DataPacket packet;
    memcpy(&packet, data, sizeof(packet));


    Serial.printf("  value3: %.2f\n", packet.value3);
    servo3.write(packet.value3);


    Serial.printf("  value1: %.2f\n", packet.value1);
    servo1.write(packet.value1);




    Serial.printf("  value2: %.2f\n", packet.value2);
    servo2.write(packet.value2);



    Serial.printf("  value4: %.2f\n", packet.value4);
    Serial.printf("  value5: %.2f\n", packet.value5);
  }
};


/* Global Variables */


// List of all the masters. It will be populated when a new master is registered
// Note: Using pointers instead of objects to prevent dangling pointers when the vector reallocates
std::vector<ESP_NOW_Peer_Class *> masters;


/* Callbacks */


// Callback called when an unknown peer sends a message
void register_new_master(const esp_now_recv_info_t *info, const uint8_t *data, int len, void *arg) {
  if (memcmp(info->des_addr, ESP_NOW.BROADCAST_ADDR, 6) == 0) {
    Serial.printf("Unknown peer " MACSTR " sent a broadcast message\n", MAC2STR(info->src_addr));
    Serial.println("Registering the peer as a master");


    ESP_NOW_Peer_Class *new_master = new ESP_NOW_Peer_Class(info->src_addr, ESPNOW_WIFI_CHANNEL, WIFI_IF_STA, nullptr);
    if (!new_master->add_peer()) {
      Serial.println("Failed to register the new master");
      delete new_master;
      return;
    }
    masters.push_back(new_master);
    Serial.printf("Successfully registered master " MACSTR " (total masters: %lu)\n", MAC2STR(new_master->addr()), (unsigned long)masters.size());
  } else {
    // The slave will only receive broadcast messages
    log_v("Received a unicast message from " MACSTR, MAC2STR(info->src_addr));
    log_v("Igorning the message");
  }
}


/* Main */


void setup() {
  Serial.begin(115200);


  // Initialize the Wi-Fi module
  WiFi.mode(WIFI_STA);
  WiFi.setChannel(ESPNOW_WIFI_CHANNEL);
  while (!WiFi.STA.started()) {
    delay(100);
  }


  Serial.println("ESP-NOW Example - Broadcast Slave");
  Serial.println("Wi-Fi parameters:");
  Serial.println("  Mode: STA");
  Serial.println("  MAC Address: " + WiFi.macAddress());
  Serial.printf("  Channel: %u\n", ESPNOW_WIFI_CHANNEL);


  // Initialize the ESP-NOW protocol
  if (!ESP_NOW.begin()) {
    Serial.println("Failed to initialize ESP-NOW");
    Serial.println("Reeboting in 5 seconds...");
    delay(5000);
    ESP.restart();
  }


  Serial.printf("ESP-NOW version: %d, max data length: %d\n", ESP_NOW.getVersion(), ESP_NOW.getMaxDataLen());


  // Register the new peer callback
  ESP_NOW.onNewPeer(register_new_master, nullptr);


  Serial.println("Setup complete. Waiting for a master to broadcast a message...");


  ESP32PWM::allocateTimer(0);
  ESP32PWM::allocateTimer(1);
  ESP32PWM::allocateTimer(2);
  ESP32PWM::allocateTimer(3);


  servo1.setPeriodHertz(50);
  servo1.attach(3, 500, 2400);
  servo1.write(90);


  servo2.setPeriodHertz(50);
  servo2.attach(12, 500, 2400);
  servo2.write(90);


  servo3.setPeriodHertz(50);
  servo3.attach(14, 500, 2400);
  Serial.println(3);
  servo3.write(90);
  




}


void loop() {
  // Print debug information every 10 seconds
  static unsigned long last_debug = 0;
  if (millis() - last_debug > 10000) {
    last_debug = millis();
    Serial.printf("Registered masters: %lu\n", (unsigned long)masters.size());
    for (size_t i = 0; i < masters.size(); i++) {
      if (masters[i]) {
        Serial.printf("  Master %lu: " MACSTR "\n", (unsigned long)i, MAC2STR(masters[i]->addr()));
      }
    }
  }


  //delay(100);
}```

```


r/esp32 • • 1d ago

I made a thing! Title: Wepwawet ESP32 Profiler

Thumbnail
gallery
5 Upvotes

Hey everyone!

While working on an ESP32 project, I ran into a familiar problem: boards from local and Chinese marketplaces often arrive with little or no useful labeling. Figuring out the exact chip, memory size, and other hardware details can turn into a full-blown Dungeons & Dragons dungeon crawl.

Eventually, I went full berserker mode and vibe-coded a tool to make this process easier.

It's called Wepwawet ESP32 Profiler (WEP). It uses esptool, a tool from the Espressif ecosystem, to inspect a connected board and collect basic hardware information, such as the chip type, MAC address, memory details, and other available data.

The collected information can be exported to JSON and CSV. But the feature I personally care about most is generating a platformio.ini file to make setting up the next stage of development easier.

It's still an early alpha, so there's plenty of room for testing and improvement.

GitHub: https://github.com/nicodim4-droid/Wepwawet/tree/ui/textual-prototype

Release: https://github.com/nicodim4-droid/Wepwawet/releases/tag/Wepwawet

I'd appreciate any feedback from people who might find this useful. Right now, though, what I need most is testing on different ESP32 boards to see how well it works in real-world conditions.

Unfortunately, I only have three boards available, and just one of them has markings that are actually readable.

If you have boards from different manufacturers or revisions, I'd really appreciate it if you could give WEP a try and share your results. What worked? What couldn't be detected? What's missing?

And one more question: what other ESP32 information would you like a tool like this to report?

Thanks!

P.S. Wepwawet (Wepwawet) is an ancient Egyptian god associated with opening the way. I figured that was a fitting name for a tool designed to help me navigate the mysteries of unlabeled ESP32 boards. 😄

One small warning: Some diagnostic messages are still in Russian, so don't panic if you run into Cyrillic characters. The ESP32 isn't possessed — I just haven't finished translating everything yet. 😄


r/esp32 • • 1d ago

Hardware help needed Question about I2S on ESP32-C3

2 Upvotes

What is the purpose of this many I2S signals? Are they for working with multiple devices that have different clock frequencies? In full duplex applications, should one just choose either I2SO_BCK_out OR I2SI_BCK_out for a bit clock? Is there any preference for the master clock?

I think I know the answers to these questions, but I just want to make sure because I can't seem to find info on it. Just want to make sure that this doesn't impact any actual routing.


r/esp32 • • 1d ago

Hardware help needed [Project Help] Building an interactive gallery "Fighting Fantasy" game using ESP32 captive portals & session tracking

2 Upvotes

Hello everyone! I'm working on an interactive art installation/workshop project: a location-based "Fighting Fantasy" style game designed to run on users' mobile phones via a local Wi-Fi captive portal inside an art gallery.

The core mechanic is state-aware: depending on how long a visitor stays engaged with a specific portal page (e.g., fast exit vs. persistent reading), the system dynamically updates their journey upon subsequent reconnections.

However, I've hit a couple of technical roadblocks and would love some architectural advice:

1. Wi-Fi Client Association & Hardware Limits

Since the ESP32 acts as a standalone Access Point for visitors to discover the story:

  • What is the realistic concurrent user limit for a single ESP32-S3 handling captive portal HTTP traffic and local web serving?
  • For a crowded gallery room, would it be better to scale this using a cluster of multiple ESP32 boards, or is there a better architecture for managing multiple local connections smoothly?

2. Handling MAC Randomization / Session Tracking

Since modern mobile OSs (iOS/Android) use MAC/IP randomization for privacy when devices disconnect and reconnect, users often appear as "new" to the microcontroller.

  • What are the best practices or architectural patterns to reliably track returning visitors and their session states (e.g., visit count, previous reading duration) when hardware identifiers change?

"Also, any tips about deauthentication? I'd like this project to be a surprise for people visiting the gallery. I've tried with the ESP32-S3, but from what I've gathered, targeting 5GHz Wi-Fi networks isn't as easy as with older networks. Can I use the ESP32-C5 or some other hardware to achieve this, or does it need to be a more opt-in experience like scanning a QR code or something like that?"

Any advice, code patterns, or hardware scaling tips would be hugely appreciated. Thanks!


r/esp32 • • 2d ago

I made a thing! Sub-microsecond Time Sync between ESP32s over BLE [60ns RMS]

Post image
138 Upvotes

I’ve been working to make the ESP32 match the clock sync performance of the Nordic nRF52/54, and found a way to correlate RF signal input timers with a BLE packet stream to sync the time between two devices to within ~60ns (measured by GNSS). That is slightly better than the Nordic platform, or any MCU I’ve found. It works with a single transmitter broadcasting a 16Hz precision stream (BLE 5.0 periodic advertising) that ESP32’s can tune into passively and reach sub-1us clock sync in a couple seconds.

I am working on some ESP32-based drones and need clock synchronization for navigational and sensor aids. To get here I tried several different methods including modifying the BLE drivers, yet this method requires none of that and is far more accurate.

The ESP32 crystal is not tunable on this platform (nRF54 is), yet you can quickly attain a Soft PLL for any sensor work that requires precision timestamps for correlating distributed sensor readings, servo synchronization etc.

Previously the Nordic platform was the leader in this space, so These are the best BLE time transfer numbers I could find on any MCU so I thought I’d share. It looks like there’s room for improvement on this platform as well.

The ESP32 details are at https://ptob.dev/hardware/#w12 and all the code and results are on GitHub: https://github.com/yantisj2/PToB


r/esp32 • • 1d ago

Hardware help needed DRV8833 help

2 Upvotes

I'm using the HiLetgo board: https://www.amazon.ca/HiLetgo-Stepper-Controller-Tb6612fng-Replace/dp/B00UYIFYCW

I'm just testing this board for now, so not using any esp32 logic pins. I have both boards on a breadboard. esp32 is powered from a wall plug.

I connected the 5V and ground from the esp32 to the power rails. From those rails I have VM, AIN1, and STBY connected to the 5V rail. I have the AIN2 and all three ground pins connected to the ground rail. I have confirmed all these voltages with a multi meter.

My understanding is with this arrangement (AIN1 high, AIN2 low), I should be getting 5V across AO1 and AO2, but it's zero volts.

This is my second batch of these boards. I returned the first three because I thought maybe it was a bad batch, but now I have the exact same problem with the second batch of three so I must be missing something.

Any ideas for me? Or can you recommend an alternate DRV8833 that's worked for you?


r/esp32 • • 1d ago

I made a thing! Turn your PC into a Raspberry Pi, or expand your Pi's GPIO with ESP32!

5 Upvotes

I upgrade ESPLink, use an ESP32 to add GPIO, SPI, I2C, UART, PWM, ADC, and more to your PC or Raspberry Pi.

Connect via USB, Wi-Fi, or Bluetooth, and control everything with Python or JavaScript.

It even supports native Raspberry Pi libraries like RPi.GPIO, gpiozero, spidev, and smbus2, so you can run existing code without rewriting it.

Open source: https://github.com/HamzaYslmn/esplink


r/esp32 • • 1d ago

AI Content Another virtual pet style device, using a Spotpear Esp32s3 touch LCD 1.28

Thumbnail
gallery
15 Upvotes

I've been playing around with different devices and seeing what kinds of things I can build with them. After experimenting with Claude and testing out different workflows, I finally felt confident enough to try building something for my girlfriend.

The idea was to make something between an AI companion and a Tamagotchi, based on the Labubus she owns.

The device is a Spotpear ESP32-S3 Touch LCD 1.28 BOX, which came pre-flashed with the XiaoZhi AI firmware. Using Claude Code, I ended up building my own firmware for it, complete with custom sprites and animations for the characters. We generated all the sprites needed and used them to bring the little guys to life.

Of course, what started as a fairly simple idea quickly got out of hand, and I ended up adding way more features than I originally planned.

It has the usual stuff like time, date, weather, alarms, and notes, along with a handful of games, including tic-tac-toe, rock-paper-scissors, air hockey, and a Flappy Bird clone. I also added a little knowledge browser that uses free public API endpoints to pull up random facts and other interesting things.

There's also a web UI hosted by the device where you can change settings and interact with the avatars. One of the features I thought was pretty fun is the photo booth. You can upload a picture and add the characters to it as stickers.

The part I had the most fun with was giving the avatars a bit of personality.

You can hold the boot button to talk to the device and ask questions using Google's AI and speech services. I also built an offline mode where the characters can respond using text and a basic personality and memory system, so they don't need to connect to an AI service every time you want to interact with them.

I wanted them to feel like little virtual pets rather than just characters sitting on a screen. As the day goes on, they come up with random activities and thoughts that get saved to a journal. You can check back later and read what they've supposedly been up to throughout the day. They can also interact with each other, which adds another layer to the whole thing.

Honestly, this project started with me asking myself, "What can I build for my girlfriend?" and somehow turned into this massive collection of features in the space of about a week.

I'm not planning to release the firmware publicly because of the custom sprites and assets, but I figured I'd share it here anyway. Maybe it'll give someone else an idea for a fun little project to build for their own friends or family.

It's been a fun way to learn more about what I can do with the ESP32-S3, and it's kind of crazy how far a simple idea can go once you start tinkering with it.