PDA

View Full Version : Audio Level Meter



Peter1960
- 28th February 2006, 12:06
Hi, I'm trying to read the adc in to create an audio vu (level) meter, but the input is unstable.
Any suggestion on how to increase its stabilty, but maintain fast conversions, so the dsiplay doesn't lag the audio level ?
thnks
Peter

penelopepug
- 28th February 2006, 19:31
Hi! I'm not sure what you mean by the input being unstable? Is it too noisy to sample reliably via the analog input of your pic? Perhaps you need a sample and hold circuit or an active full wave recitifier which uses an opamp and an RC filter. Can you post your code and add some more detail to descibe the problem?

PJALM
- 28th February 2006, 19:59
Hi,

Is your audio source line level or speaker level? If it is from a speaker output then the signal levels will be too high for the pic and cause the instability, try adding a resistor (or a pot) between the PIC input and your audio source to bring it down to a level the pic can handle. You may even want to try using a voltage divider circuit.

I hope this helps.

Peter

sougata
- 1st March 2006, 07:28
Hi,

Please post the schematic and code with the PIC details. Otherwise it might be waste of time for both of us.

Regards

Sougata

ritvarsrizikovs
- 1st March 2006, 09:31
ADC for PIC is very stable!
I use 10bit ADC and max error ir one bit.
Need to use 7805 for stable 5V power, inductors and capacitors for smaller pulsation.

If You need simple Audio level meter, then use rectifier, resistor and capacitor. And Use Vref pin on PIC, to set max value. Thats all.

For More advanced level meter use OpAmp and create band filter or band filters and build up to 8 band spectrum analyser. With 16 OpAmps it is very simple to build. And for example 16F877 or 18F452 works fast. You can read all 8 channels and display. By software You can add peak detectation and build log scale.

Excelcier
- 15th November 2006, 04:31
I'm fairly new so be gentle, but could someone provide some sample code as a reference for me to build on? I'd really appreciate it.

mister_e
- 15th November 2006, 05:13
IMHO, PIC are useless for that. LM3914, LM3915 OR LM3916 don't even require any software and are on the market since over 20 years.

http://www.national.com/VCatalog/view.cgi/?command=toggleSort&attr1=Segments%2F%2Fdescending&attr2=0&a2=Segments%2F%2Fv%3A8&s0=PNumber%2F%2F1&a1=SubCategory%2F%2Fv%3A8&a0=Category%2F%2Fv%3A8&m1=SubCategory&t=0&m2=Bpn&m0=Category&as=0&render=1&domains=PNumber&q=200&i=PNumber&c1=e%3A0%2F%2FSubCategory%2F%2F%3Aeq%2F%2FDisplay+ Drivers%3ALED+Drivers&c0=e%3A0%2F%2FCategory%2F%2F%3Aeq%2F%2FDisplay+Cir cuits&tId=25

savnik
- 15th November 2006, 05:15
and build log scale.
How i build log scale.
I use linear scale now.

malc-c
- 15th November 2006, 11:03
You need to use the line in level (normally 1v peak to peak RMS) from a CD / Tape deck. You then need to make a filter fo that the peaks provide a cleaner input (well at least thats what I used form my disco light project).

The attached image shows the filter I used to input the signal into an 877 PIC. I can't post the code as it was written in JAL (before I discovered PBP ;) ) but works on the pinciple of converting the voltage to a value between 0 and 254, and then making pin on the output port go high, so for example, if the input equated to 120 the first four pins RB0 - RB3 would be made high. Its not quite a true VU or Peak level meter, and I'm sure with re-coding you could do something better, but the effect to a decent track with lots of quiet bits between the beat looks cool

Excelcier
- 16th November 2006, 01:19
The reason I'm doing this on a PIC and not a LM3914, LM3915 OR LM3916 is because I wrote software for LED light patterns and I simply want to use the music input to trigger the stages of the patterns I programmed.

savnik
- 16th November 2006, 06:07
The attached image shows the filter I used to input the signal into an 877 PIC. I can't post the code as it was written in JAL
If you want post the code or send to email.
I know JAL.

malc-c
- 16th November 2006, 07:58
I don't know if I still have it... I'll have a look on my archive to see if I can find it

Acetronics2
- 16th November 2006, 08:05
[QUOTE=mister_e]IMHO, PIC are useless for that. LM3914, LM3915 OR LM3916 don't even require any software and are on the market since over 20 years.

And Also Do not forget the U.S. NTE 150x series ... (1507 IS ~ LM 3914 )

Alain