I'm looking to simply read the generic sound level from an Electret Microphone. I've seen a number of schematics with NPN transistors, that will provide an inverted output (~5V when quiet, ~0V when loud, linear operation in between).
Here's an example:
However, I would like non-inverted output (linear operation, super quiet input gives ~0V, super loud input gives ~5V). I realize I could easily correct for this in software, but it just seems backward to me in a way and I cannot find any examples of a non-inverting output with a PNP transistor.
Is there a reason for this beyond being uncommon? If it's possible, could anyone provide a schematic of an electret microphone and PNP transistor that will give ~0V when quiet and ~5V when loud?
Further, is there some reason why this is so uncommon, or undesirable? NPNs seem to be used much more often than PNPs, why is this?
Edit
It seems I was rather confused in what I would get as output from the NPN preamp, which would be 0V for silence, and +/- Vin / 2. Here's what I want instead:
0V when silent, ~2.5V in medium sound levels, ~5V in maximum sound levels. This could be read by the ADC easily into 'sound level' without much work at all. However, I cannot feed voltages < 0V or > 5V to the analog comparator. It looks like I want the above with an envelope detector, however that would only get me from 0V to 2.5V. How do I make it vary the full 0V to 5V, 0V being 'quiet' and 5V being 'loud', with everything in between linear?