Measuring Speaker Voltage and Controlling LEDs with it

Hello,

I’m very new to all this stuff and I’m normally much more on the Software than the Hardware front .
I want to measure the Voltage going to my Speakers and then control some LEDs with it, just like that simple
trick when you connect an LED to a speaker wire, just without the LEDs or the Amp getting blown up :slight_smile:
I want an Arduino inbetween doing all the processing stuff with it acting as LED controller.

Soo… After some researching in the web I came up with the totally scientific drawing that’s attached to this post.

It’s a bit chaotic, but the idea seems simple enough: Read Speaker Voltage via Analog Input, do some processing stuff with it (I’ m not concerned with Software atm) and output the result individually to the Red, Green and Blue LEDs in the strip.
So these are just three MOSFET controls, one for each color.

Now, onto the stuff I can’t figure out. Like the bit for measuring the speaker voltage. I know so far I could measure a Voltage of up to 5V, and if it gets any higher, I’d use a voltage divider circuit.
So, my questions are:

Where do I connect Negative (or “null”, as I understand it is with AC) to the arduino? I get that voltage is measured by the difference between Ground and the input, but the ground wire from the PSU is DC, the Speakers are AC, which brings me onto the next question:

Is it OK to combine AC and DC circuits like this? It just seems wrong to me. Can the Arduino accept an AC input into the Analog pins?

Oh, and last: Is a 10k resistor between every PWM line and the ground really necessary? As is my understanding the gate will just turn on and off randomly if it gets loose but does that do damage other than a wildly flashing LED?`

Thanks in advance for any assistance on this.

Cheers,

you could probably do what you want using the MSGEQ7 Graphic Equalizer chip.

there is plenty of information on the forum and web on how to use one with the arduino.

zx81: you could probably do what you want using the MSGEQ7 Graphic Equalizer chip.

there is plenty of information on the forum and web on how to use one with the arduino.

Thanks for the quick reply. The thing would open up some cool possibilities and seems pretty straightforward to use. I was hoping for something using more "traditional" components since it always takes ages for stuff to ship to Europe, but I'll include one on the next order.

The thing for controlling the LEDs seems fine? I know there's already a ton of stuff on LED control, but I wanna make sure I don't immediately wreck a PSU, an arduino or a strip of LEDs.

I don't know what kind of LED's you plan to use but standard LEDs can run directly from the arduino if you remove the PSU and the transistors the three LEDs can be run from the 3 outputs just a led and a 100 to 150 ohm resistor.

If your wanting to run led strips or something else a NPN transistor with the emiter going to ground the collector going to your device then going to positive and the base going to your arduino output.

I'm on my phone I'll try and get a diagram included when I'm on my pc

I'm using a LED strip. About 20m in length and drawing 12A at peak.

I thought of using N-Channel MOSFETs with Drain to the LEDs, Source to the PSU and Gate to the PWM out. Are there notable advantages / disadvantages with MOSFETransistors vs NPN?

I'm no electronics expert but my understanding of PNP v NPN is that they work differently the PNP one connects to the high side (positive) and is triggered by the gate being pulled low whereas the NPN is the opposite it connects to the low side (negative) and is triggered by the base being put into a high state.

from the reading I've done the NPN seems to be easier to use with the arduino and is apparently more efficient, however if your circuit is drawing 12A you might want to consider a solid state relay or relay (depending on how fast you want to change state of the led)

A way to do it is: http://fftarduino.blogspot.com/2011/02/color-organ-spectrum-analyzer-on.html

I strongly suggest not connecting into your speaker, rather use a microphone... Build your own interface or http://negativeacknowledge.com/2008/06/11/final-lightbar-controller/... Sparkfun does not care if you rip their circuits.

Ray

mrburnette: A way to do it is: http://fftarduino.blogspot.com/2011/02/color-organ-spectrum-analyzer-on.html

I strongly suggest not connecting into your speaker, rather use a microphone... Build your own interface or http://negativeacknowledge.com/2008/06/11/final-lightbar-controller/... Sparkfun does not care if you rip their circuits.

Ray

Thanks for the links. Interesting reads. I definitely want the frequency analysing version. Peak volume is interesting but I can't experiment with it as much as I'd like to. Also, a microphone is not an option. There may be a lot of background noise. I don't want the LEDs to light up if someone screams at them :)

What I'm now thinking is a 3.5mm splitter, one going into my Stereo and the other being used for analysing and such. But despite the many threads here about 3.5mm jacks and inputting it into the Arduino, I'm still not sure how to do it. If i took the audio jack with its breakout board , the audio analyser mentioned earlier and a small amp like this I'd still not exactly know how to hook it up. How to deal with stereo? Which pins from the audio jack to take?

As a backup option I could always make the PC (which is the main music output device) analyse the sound and just make the Arduino a LED USB interface. That seems like a less elegant solution however.

Concerning the switching of the high current with the MOSFETs, these here are rated for 60V 30A, the 12A seems to be a peak current and if they do get hot, i have an old heatsink designed for graphics cards lying around that I could use, so I think I should be fine?

What I'm now thinking is a 3.5mm splitter, one going into my Stereo and the other being used for analysing and such.

Most of the iPod, cellphones, and similar including PC headphones are around 32 Ohms impedance - but, some can be lower. If this is the PC line out, then the impedance can be between 100 and 1K Ohm but there is no hard-fast rules. Let just figure it is 600 Ohm to match lowloss microphone cable.

Now, use a resistive bridge such as http://www.stufinnis.co.uk/stereotomono.html To combine the left/right to mono.

The reason for the impedance talk in the earlier paragraph was to suggest that you may need to lower the resistor values in the mixer circuit for use with earphone output. This "may" is a trial 'n error experiment.

I am going to let someone with more experience answer the MOSFet question.

Ray

What I’m now thinking is a 3.5mm splitter, one going into my Stereo and the other being used for analysing and such.
But despite the many threads here about 3.5mm jacks and inputting it into the Arduino, I’m still not sure how to do it.
If i took the audio jack with its breakout board , the audio analyser mentioned earlier and a small amp like this I’d still not exactly know how to hook it up. How to deal with stereo? Which pins from the audio jack to take?

Here is a good link for the MSQEQ7 with wiring diagram and sample code:
http://nuewire.com/info-archive/msgeq7-by-j-skoba/

Here is a link explaining how a Stereo Jack works:
http://pinoutsguide.com/Home/Tele35s_pinout.shtml

if you wanted to use the MSGEQ7 and process the left and right audio separately I think you would have to use 2 MSGEQ7’s