A bluetooth-based amplifier with automatic gain control, written in C and Arduino/AVR C for a specific hardware platform comprised of:
- ATmega328-compatible microcontroller
- Microchip BM62 Bluetooth module
- MSGEQ7 spectrum level detector
- Max9744 I2C-Controllable Class-D Amplifier
This project is a basis for a bluetooth stereo audio amplifier with a spetral-based automatic gain control. It was concieved and started at a point before I had access to an online streaming service such as Spotify, who normalizes track levels across albums and artists. When playing back music without that normalization it often frustrated me when a quiet track would follow a loud track, or vice versa, and the playback volume would thus jump substantially in one direction or the other.
A bluetooth-connected amplifier utilizing a microcontroller continuously analyzing the audio spectrum and adjusting the playback amplifier volume accordingly, solves the issue!
At present, the system will automatically connect to a device via bluetooth, play audio from that device, reestablish a lost connection, control the amplifier volume manually, read and process audio levels from the MSGEQ7, determine relative dB levels for audio data and automatically recalculate those levels when the volume is manually adjusted. It will use that data to build a volume map of audio levels against nearby amplifier volume steps, make automated gain adjustments, and indicate via the front panel when and in what direction an adjustment was made.
move some remaining functions out of main filecompletevolume range updateremovedcircular level tracking bufferdone
the button interrupts are working and accurately debounce and count N switch transitions within period T, now that count needs to be used to:done[single button press] play/pause media playbackdone[double button press] turn automatic gain control on/offdone[press and hold down] disconnect bluetooth and enter pairing modedone[press once, then press again and hold] enable/disable EQ presetdone
connect up the spectrum level detection algorithm to the amplifier volume control such that the first controls the seconddonethe 'adjustment range' needs to be mapped to the available gain steps which exist relative to the present gain setting, since this variesdonethis is also going to need some kind of hysterysisdone
automated gain adjustments should pulse the secondary front panel LED in the direction of the adjustment when they occur (donebright >> baseline >> bright
ordim >> baseline >> dim
)add EEPROM storage functionality for maintaining enabled/disabled state of AGC and EQ between power cycles
Status: This project is maintained but considered complete. Additional features will be incorporated into future designs, but are unlikely to be added to Opossum.
(C) 2017-2021, Winry R. Litwa-Vulcu