I have a guitar vocoder effects pedal that outputs to a power amp (80W 100W TPA3116D2 Mono Amplifier Board Class DC 12V-26V Digital Audio Power Amplifier Sound Board AMP), which is connected to a single speaker (4'' 180 Watt Two-Way Speakers). The guitar pedal is connected to amp with a 1/4" jack patch cable.
When I output sound from pedal I want to animate a LED or mutiple LEDS. What's the safest way to measure the mono signal output form pedal and animate a string of LEDS? In the past I've used done an analogRead() of positive lead of the sound output from a 5V sound module before it goes to a speaker using an Arduino. In that instance the sound module and Arduino shared the same power source. Also the sound module was stereo, where I performed an analogue read of one channel and used the other channel for the speaker.
Is there an easier way to achieve this effect without Arduino? I just want to flash LED when there is a sound output from pedal to speaker like a process status indicator.
Thanks for posting the needed information. I suggest you get your favorite browser and search for "color organ" they were around before computers and yes it is even being done with an Arduino.
You ALWAYS need to protect against the negative half of the AC audio signal. A guitar pick-up can't put-out enough current to hurt the Arduino, but the Arduino can "damage" (distort) the signal and a pedal might damage the Arduino.
With a power amplifier, the output can swing as high as the power supply voltage so you need to protect against that.
Your amplifier has an additional complication in-that it's a bridge amplifier (the speaker has two "hot" connections and no ground). You can use one of the connections as long as you go through a series capacitor (maybe 1uF) to block the DC.
If you can tap-into the pedal output, that would be "safer". An active pedal like that will be buffered (lower impedance than a guitar pickup) so that makes things easier.
Here are a couple of circuits for lower voltages - The resistance values are for "buffered" guitar signals or line-level or headphone signals.
This is a bias circuit. The audio signal rides on top of the bias (half of Vcc) so you can read the negative half of the signal and negative voltage never gets to the Arduino.
This circuit safely kills the negative half of the signal (without hurting the signal to the amp). But it only works for volume/loudness. You need the bias circuit if you want frequency information because you'll need the full undistorted waveform.
An advantage to the 2nd circuit is that you can use the optional lower ADC reference (1.1V on an Arduino Uno) if you need more sensitivity. (That won't work with a 2.5V bias. )
For the speaker connection you can use a 5:1 or 10:1 Voltage Divider (2 resistors) in front of the bias or protection circuits. Resistors that add-up to around 10 are about right (it's really the ratio that's important) and note that the voltage will be dropped a bit more.
It wouldn't hurt to add Protection Diodes. (You can leave-out the current-limiting resistor if you already have a voltage divider.)
I made The World's Simplest Lighting Effect with an Arduino. It flashes the LED in when the sound is louder than average and off when it's less than average. It automatically adjusts/calibrates itself so you get a lot of "LED action" with loud or quiet sounds.
In any case, you'll need a voltage divider and probably a protection circuit with a power amp.
Thanks @DVDdoug for the different circuit options. I am going to try using a voltage divider and protection circuit sampling the line out of the pedal (before it connects to the amp).
Does the pedal need to share the same power source as the Arduino?
Right now the pedal is connected to a USB powerbank via a stepup regulator cable which supplies 9V. The Arduino would be powered independently via VIN pin with the 11.1V Lipo. Do the pedal and Arduino power lines need to share a common ground and if yes how would I achieve this? As the pedal is the most expensive part of circuit, I'm wary of releasing 'blue smoke".