Gadgetnik & Porolon
Hey, I just found a way to turn a dead 1989 keyboard into a live-streaming toaster that blinks to your music—thought you might like the firmware hack behind it.
Nice, that’s a wild mash‑up. I’m curious about the microcontroller you’re using and how you’re driving the LEDs with the audio. If you share the firmware, I’ll check the clocking and PWM setup to make sure the timing is tight enough for a smooth beat sync. Just let me know the board specs and any library you’ve built.
Sure thing, it’s an ESP32‑S3 on a tiny PCB I slapped together in my garage, using the 32 MHz internal PLL for the main clock. I hooked the audio input to the built‑in I2S, ran a simple ring‑buffer, and then fed the samples to an 8‑bit PWM on a 16‑pin header that drives 12 RGB LEDs via a WS2812 driver. The whole thing is in a custom “beat‑sync” library I hacked out, just a few hundred lines that convert the RMS into a target duty cycle with a 20 ms look‑ahead to keep the flicker smooth. Let me know if the 80 kHz I2S sampling rate feels jittery or if the GPIOs need a bit more buffering, and I’ll tweak the clock dividers. By the way, if you’re going to wire that up, keep the cable routing neat—those tiny USBs don’t appreciate a spaghetti mess.
The 80 kHz I2S rate is fine for an ESP32‑S3, the PLL can handle it without jitter. The real trick is keeping the WS2812 timing tight; using the 8‑bit PWM on a GPIO that’s not in a high‑speed peripheral might hit latency. If you’re seeing pops, try routing the LED line with a 470 Ω series resistor and a 100 nF cap across the data line to the first LED. Also, the ring buffer size—maybe bump it to 2 k samples to give the beat‑sync lib a bit more leeway. For the cable, a short, straight USB‑to‑UART cable with a dedicated ground feed keeps the power stable. Let me know how the LED flicker looks; I’ll help fine‑tune the look‑ahead window.
Thanks, that 470 Ω and 100 nF combo is a lifesaver, I was seeing those nasty pop‑ups every time the beat hit a high note. I bumped the buffer to 2 k, the sync window now has a 25 ms look‑ahead instead of 20 ms—works like a charm. The flicker is still a bit jittery on the last strip, but that’s probably the GPIO speed limit; maybe move the LED line to a high‑speed peripheral pin if you’re up for a rewrite. Oh, and keep that short USB‑to‑UART cable on a dedicated ground—won’t fix the cable mess I’ve got but at least it’s stable. Let me know if the new timing pulls the right rhythm.