Sound level indicator based on MAX4466 - Page 1
Forum section: electronics / beginners

author: PaszaVonPomiot
author_rank: Newbie
timestamp: May 16, 2025, 01:12:41 pm
content: Hello!I would like to build a sound level indicator based on MAX4466 Electret Microphone Amplifier. When I'm connecting MAX4466 analog output to ADC in Raspberry Pi Pico I can read the values from 0-65536. However I realised that it's measuring actuall sound wave not the overal loudness level.In stable loud environment i get following readings from ADC:407611794055052086943233576I was able to get loudness level by programming Pico to take multiple samples and calculate RMS (Root Mean Square). But that operation is heavy on Pico and I would like to do the same using electronics.I imagine that between MAX4466 and Pico there should be some element that will transform raw microphone signal into stable loudness output. A hardware RMS module of some sort or magnitude meter maybe. Can you recommend a solution?The output doesn't have to be very precise or callibrated to dB.Thanks!

author: David Hess
author_rank: Super Contributor
timestamp: May 16, 2025, 01:45:21 pm
content: The RMS calculation should not be that taxing. Analog Devices makes several RMS converters:https://www.analog.com/en/parametricsearch/11023#/sort=s3,ascThe RMS calculation is not strictly necessary. Averaging the absolute value of the signal works also, but in both cases, a conversion to dB by taking the logarithm is typical.

author: tooki
author_rank: Super Contributor
timestamp: May 16, 2025, 02:01:52 pm
content: Small Signal Audio Design, 3rd Ed., by Douglas Self, has an entire chapter (23) on level meter circuits. If you know how to look, you might find a PDF of that book online…ESP has a big discussion of them, too:https://sound-au.com/project55.htmBear in mind that real SPL meters use very specific frequency weighting, so without that, you aren’t making a very precise device, which you’ve said is OK.

author: PaszaVonPomiot
author_rank: Newbie
timestamp: May 16, 2025, 08:01:03 pm
content: Thanks all for your response.The book didn't render any help.Searching fo analog LED/meter VU audio level circuits didn't show any useful results I could understand.@David RMS-to-DC Converter like AD737 seems to be the thing I was looking for although it's a bit pricey. You mentioned something about averaging the signal - is there an electrical component that can do that?

author: David Hess
author_rank: Super Contributor
timestamp: May 17, 2025, 03:22:12 am
content: Quote from: PaszaVonPomiot on May 16, 2025, 08:01:03 pmI did not see any examples from "Small Signal Audio Design (2015) - 2nd Edition - Douglas Self" which I would care to recommend.QuoteAveraging means running the signal through a precision half or full wave rectifier, like you would find in a multimeter in AC mode, and then averaging the output with an RC filter. Do a search for "precision rectifier" and there will be plenty of examples.

author: TimFox
author_rank: Super Contributor
timestamp: May 17, 2025, 03:32:10 am
content: Even simpler is running the AC signal through a two-diode half-wave voltage doubler (look up the circuit), to extract the peak-to-peak value of the AC waveform, then averaging the output with an R-C filter before digitizing.Use Schottky diodes. The relevant circuit starts with a capacitor, so any DC voltage at the output of the mike amplifier is removed.

author: radiolistener
author_rank: Super Contributor
timestamp: May 17, 2025, 03:34:45 am
content: Calculating RMS on a MCU is not very resource-intensive, but it does require a sufficiently large buffer to capture low-frequency components, which can be challenging on limited hardware. Since you don’t need an exact RMS value, you can simplify the process by using the instantaneous absolute maximum sample value combined with a simple low-pass IIR filter to extract the peak envelope. In many cases, the peak level provides a good approximation of perceived loudness.Alternatively, if you prefer an analog solution, you can use an RMS-to-DC converter IC as suggested above, or just implement a basic peak envelope detector circuit with a simple rectifier diode followed by an RC low-pass filter before feeding the signal into the ADC.

author: eugene
author_rank: Frequent Contributor
timestamp: May 17, 2025, 01:30:48 pm
content: I agree that RMS calculations should not be too much for an MCU. Are you taking advantage of both cores on the Pico?

author: PaszaVonPomiot
author_rank: Newbie
timestamp: May 17, 2025, 09:53:17 pm
content: @eugene for single peripherial connected to Pico that would be fine but I'm planning to connect about 10 of them.@radiolistener thanks for the tip about rectifier + filter, so I gave it a try, simulated it and results are folowing:I tested it live and and the result is generally weird but fine - yellow voltage increases when blue sine wave from mic is louder. However the circuit output doesn't catch the quiet part from microphone and starts reacting when it's already loud. Also there are some artifacts at max loudness and I'm not sure where they're comming from. I used 1N4148 diode, C=1uF and R=10K. How do I find correct component values?

author: PaszaVonPomiot
author_rank: Newbie
timestamp: May 17, 2025, 10:45:19 pm
content: @TimFox the voltage doubler looks promising although the output is not exceeding 1 V. Also using Schottky diodes didn't work at all in the simulation.

author: PaszaVonPomiot
author_rank: Newbie
timestamp: May 17, 2025, 11:07:26 pm
content: @David Hess it appears that precision rectifier needs an AC signal without DC bias which for MAX4466 is about half of Vcc.I get a flat green line here.

author: PaszaVonPomiot
author_rank: Newbie
timestamp: May 19, 2025, 08:11:17 am
content: Okay, I've settled with simple envelope detector which seems to be doing exactly what I need. Thanks all for your help