I have a microphone whose output needs to be limited to 0V-5V. The microphone itself should be picking up audio from its environment (such as a living room). Later, specific signals will be identified from the audio stream that the microphone is picking up. The output of the microphone will lead into an analog input pin of a microcontroller which will do all of the signal analysis. But for now, all I'm focusing on is the microphone.
I've done some googling and have discovered auto-gain amplifiers that seem to be able to adjust their gain depending on what the output voltage is. If the output is too low, the gain will increase, and if the output is too large the gain will decrease. If I understand this correctly, this should be the type of behavior I'm looking for. I think this process of limiting microphone output voltage is known as compression in the audio world?
Anyways, I've found an example or two of an auto-gain amplifier being used to ensure a minimum output voltage, but I'm struggling to find out how to use one to ensure a maximum output voltage.
The core of my questions are:
1) Is it possible to use an auto-gain amplifier to limit the output voltage of a microphone to a maximum of 5V with an unknown input voltage?
2) If it possible, is an auto-gain amplifier the best choice for this? If it is not possible to do this with an auto-gain amplifier, what are some other methods that may accomplish this?
3) If an auto-gain amplifier is indeed a suitable choice for this task, how would one go about selecting/wiring an auto-gain amplifier?
For reference, a microphone I might want to use is the CMA-4544PF-W. Some other information that might be relevant is that I expect the ambient noise of the environment the microphone is in to be around ~50dB-60dB on average.
I can clarify any additional details I haven't mentioned here if necessary!
EDIT: When I wrote this I wasn't clear, I still do want to amplify the microphone signal before it reaches the input pin of the microcontroller. So although I expect the microphone to output a signal in mV, I'd like to strengthen the signal a bit. I'm just worried that if I use an amplifier with a large gain that the output could possibly exceed 5V. My thought process is that an auto-gain amplifier would be able to both amplify the input signal as well as limit the output amplitude to less than 5V.
Thanks in advance!