958Views12Replies

Author Options:

measuring loudness Answered

I want to experiment measuring sound volume using a A2D converter and a microcontroller, but it is not as simple as i thought because i can't just measure once and use that spike should measure for a period of time and add up all of the amplitudes? or average it all out and use the difference from the average to 0?

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
VIRON
VIRON

13 years ago

Measuring the loudness of what? It would be simple to make a VU dB meter work with a microphone and an amplifier and a diode, It would also be simple to connect a digital AC meter to a speaker, but it will look like random numbers.

0
frank26080115
frank26080115

Reply 13 years ago

i just want a led bar graph move to the sound, since the A2D converter can take several readings very very fast, I can't just measure at one point, a voltmeter actually averages readings over a period of time how about this, i use a diode or a diode bridge and use the signal to charge a capacitor, and measure the voltage? has anybody seen that robot keepon? the little yellow thingy that can dance to beats? i just want a led bargraph to do the same thing, or a 8x8 matrix

0
VIRON
VIRON

Reply 13 years ago

You can use an LM3916. I prefer the LM3915 because it has more dynamic range than the LM3914 or LM3916 and always looks good with an amplified microphone. I have circuits for (any of) these chips, although you can search for the datasheet pdf (National Semiconductor made the chips). Typically they drive 10 LEDs from one signal, and can display as one dot or as a bar (more LEDs light up when it gets louder). I will try to find my schematic for the small version for parties. It does use capacitors and diodes to convert the audio to DC and to average it out, the best average is when you can see the single dot move when the dot/bargraph switch is set. The averaging time is set by a "time constant" network - just a resistor and a capacitor. The chips I mention can be connected together to make really long LED sound meters, which I've also done. It's simpler to make it look good as a bar than a dot, just try different capacitors on the input (and a high adjustable resistor) until it's not too fast and not too slow. I don't have a really cool equalizer circuit (many frequency bars) yet but one can be found in an old equalizer I guess. ALWAYS SAVE METERS FROM JUNK STEREOS! Otherwise I think a microcontroller programmed to do an FFT and drive part of a LED sign is needed. If anyone else knows other ways, say so. FFT is the most complex microcontroller DSP function I know of. You can fake the LM3916 with a microcontroller, just remember to put a capacitor between the audio and the ADC input, and put a volume control between the capacitor and the ADC input. Then make a lookup table of ADC volt measurements such as this in hex or binary 0 -> 00h 00000000b 1 -> 01h 00000001b 2 -> 03h 00000011b 3 -> 07h 00000111b 4 -> 0Fh 00001111b ...1F 3F 7F FF up to 8 (or how many bits) and then output to ports, see how higher numbers make more bits turn on more lights. BTW check out "Ruben's Tube"s on Youtube but don't try it at home!

0
VIRON
VIRON

Reply 13 years ago

Attempting to put up a schematic...

audio2DCfilter.png
0
VIRON
VIRON

Reply 13 years ago

This functions as a voltage doubler and a time constant filter and a volume control. The bottom is ground, the left is audio-in, the output goes to LM3915 or the PIC ADC. Capacitor on the left is 1uF to 10uF, diode below it points to it, diode to the right points away, to the other capacitor which may be between 0.1 and 1 uF I guess, it depends on what volume control you use which can probably be any, perhaps between 5K and 1Meg (?). This is untested but similar to my typical method. Most important it converts audio to DC voltage per loudness, meaning zero volts when it's quiet, easy to measure. Cheaper than an op amp that may be otherwise used for this purpose. Not shown is whatever amplifier the audio is coming from.

0
gmoon
gmoon

Reply 13 years ago

You could use a microcontroller with an on-board ADC. (AVR ATmega48 or even an ATtiny26 have ADCs, and enough pins to drive an LED bargraph.) Just take an average of the incoming readings (say, 8, 16, 24, etc. readings), then set your bargraph accordingly. For a passive source like a mic, you might need an opamp or something to boost the audio signal. Don't average values if you're looking for peak readings.

0
frank26080115
frank26080115

Reply 13 years ago

you know those spy ear thingys that is just an amplified mic? think those will work?