D

DIY Electronics

— Building circuits, programming microcontrollers, and making things blink
49 members Created Jun 2026

STM32 ADC calibration for accurate voltage readings

DIY Audio Compressor with VCA IC

Built an audio dynamics compressor using the THAT2162 VCA IC and an Arduino as the gain control computer. This taught me a lot about control loop design for audio.

The compressor architecture: input audio goes into the VCA (variable gain amplifier), the output goes to a peak detector, the Arduino reads the peak detector via ADC, computes the required gain reduction, and writes to a DAC that controls the VCA gain pin. Attack and release time constants are implemented in firmware with adjustable RC-equivalent digital filters on the gain control signal.

The THAT2162's gain is in dB, linear with control voltage — 30mV per dB. This simplifies the gain calculation: just work in dB throughout. Ratio (2:1, 4:1, ∞:1) is implemented as a slope in the gain reduction curve. A soft knee is implemented by blending the uncompressed and compressed gain in the threshold region.

0

Report thread

Why are you reporting this thread?

Restore the redacted content?

This will make it visible to everyone again. The clear action is logged in the mod log.