Go Down

Topic: Switching a stereo audio signal (Read 2946 times) previous topic - next topic

Rob Cameron

Apr 10, 2011, 06:48 pm Last Edit: Apr 10, 2011, 07:09 pm by Rob Cameron Reason: 1
I've got a project in mind where I want to be able to turn a standard stereo signal on and off. I'll have a standard stereo mini-phono jack going from my computer to the arduino, and then from the arduino to a pair of speakers. The idea is that a remote switch (talking to the arduino via Xbee) can turn the signal to the speakers on and off (a kind of music kill-switch). I'm trying to figure out the best way to do this electrically.

The most fool-proof way would just be a standard relay, but I was hoping for a more solid-state solution...

One idea was to put a transistor between the photo jacks' ground and real ground, but I assume the voltage going through a stereo cable is probably pretty low...will that even work?

Another was to have the photo jacks' ground going through the arduino on a pin set to low. But, what happens when I set that signal to high to break the connection to ground? Am I going to destroy my computer's audio board, or the speakers, by sending 5v through them?

I've been playing around with the arduino for a while now but everything I've worked with have been using a pretty standard 5v, nothing like this. Any help would be appreciated!


The transistor idea should work alright. Just make sure you use a transistor that can be fully opened with 5 volts. Also, the ground idea would work. Connect one of the cable's grounds to arduino ground and the other to a digital pin. To enable the audio, set it as an output and set it low, otherwise set it as an input for high-z state.


Apr 10, 2011, 07:43 pm Last Edit: Apr 10, 2011, 07:48 pm by retrolefty Reason: 1
As audio is AC voltage your switching device choice is best met with either an analog switch chip (CD4066BM/CD4066BC ?) or a simple relay. As the audio AC signal has both a positive and negitive portion any analog switch device will require both positive and negitive supply rails. This can be a little tricker then it may first appear and can lead to hum being injected onto the audio signal. Your idea of somehow just switching grounds on and off is certainly not sound (pun intended).

All in all I'm in favor of simple 5vdc relays for such audio switching applications. While it's old tech, it's also pretty fool proof and easy to get working. Here is a simple relay that can be powered directly with an arduino output pin as it only draws 28ma of current, not much more then an LED would. One should however wire a reverse biased diode across the relay coil terminals for transient protection. Being it has DPDT contacts, the one relay can switch both the left and right audio signals at the same time with the one relay.



Rob Cameron

Awesome, thanks so much for the reply! That's exactly what I needed to know! I'm purchasing those relays as we speak. :)

Go Up