iy3xk ftc9ky lscsucks

My digital VU Meter



March 2026 (c) RLamb

Ive always thought analog VU meters were cool in the same vain as record album covers. Something to look at while listening to your favorite tunes. Ive found nice meters on the 'Net and built pure analog stuff like this. But I havent quite got the fast "mechanical" needle response that I recall as a kid with a VTVM (vacuum tube volt meter). So here is my lame attempt to simulate the mechanical meters using $12 CYDs (esp32 cheap yellow displays). Design here (ADC GPIO=35):


The pertinent lines in the source code are here:
...
   vudcavg = (1-0.00001)*vudcavg + (0.00001*fsamp); // dc component
   vuabsavg = (1-0.001)*vuabsavg + (0.001*fabsf(fsamp - vudcavg));
...
  float x6=(1.1*vuvreffix*vuabsavg)/4095.0;
  sprintf(out,"%.3f",x6);
  lv_label_set_text(voltlabel,out);
...
fsamp is the 12-bit esp32 ADC output (0-4095) and x6 is what is displayed in the lower left of the meter. vuvreffix is nominally 1.000 but I have noticed some variation from esp32 to esp32, say, from 0.98 to 1.05. This is settable via the serial console interface I put in the firmware (ttyUSBx/115200) by doing,e.g., "test vuvref 1.005". This will be a persistent.
[ref code] Obviously uses various pieces from my own libraries and other projects. Sorry for the mess.
What would Claude say?
Here is the meat main.c. Full build environments for esp32. Thats it. Maybe a Popular Electronics color organ next..oh wait..I see a RGB LED on the CYD..:-)
Other stuff clock
'I no longer wish to be limited to the clouds.' - Star Trek 1969 'The Cloud Minders'
"I no longer wish to be limited to the clouds." - Star Trek 1969 "The Cloud Minders"
Copyright © 2025-2026 Department C Inc