Pages: [1]   Go Down
Author Topic: Switching a stereo audio signal  (Read 819 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
« Last Edit: April 10, 2011, 12:09:37 pm by Rob Cameron » Logged

0
Offline Offline
Sr. Member
****
Karma: 1
Posts: 360
I'm 15. I like making things. I like breaking things better.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Alice asked the Chesire Cat, who was sitting in a tree, "What road do I take?"
The cat asked, "Where do you want to go?"
"I don't know," Ali

Left Coast, CA (USA)
Online Online
Brattain Member
*****
Karma: 331
Posts: 16542
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

http://www.allelectronics.com/make-a-store/item/RLY-538/5-VDC-DPDT-SUB-MINI-RELAY/1.html

Lefty

« Last Edit: April 10, 2011, 12:48:35 pm by retrolefty » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: