audio input switching

Discussion in 'General Electronics Chat' started by biggestbrad27, Aug 13, 2009.

  1. biggestbrad27

    Thread Starter New Member

    Aug 13, 2009

    I'm attempting to build a device to switch between audio inputs. The signal I would like to use as my switching signal would be power turning on from an X10 power outlet. I would convert this to an appropriate voltage level as to not blow up/melt circuit components of course.

    My question is: what would be an IC that I could use to accomplish the switching?

    I was thinking of using a switching multiplexer like the AD8182, but I'm not sure how to tell if that would degrade my audio signal or not.

    Last edited: Aug 13, 2009
  2. kkazem

    Active Member

    Jul 23, 2009
    Hi biggestbrad27,

    Regarding the use of the AD8182, it is extreme overkill and a very expensive way of doing it as that IC is more geared for TV or RF signals up to 750 MHz. For the audio band, up to 20KHz, you don't need that complexity or expense. I'm not sure what you mean by an X10 Power Outlet; do you mean a 120 VAC, 60 Hz standard wall outlet, or a 10 place power strip? If so, why would you want to use that to switch your audio signal?

    Anyway, one good way of doing this would be to use a CMOS 4016 or 4066 (14016 or 14066 for ON-Semi parts) quad analog switch, for which you'll need to generate a single logic-level input to switch the two audio signals. You would tie two of the outputs together, use a CMOS inverter or even a single transistor or MOSFET inverter between your logic-level input and the second switch section control input, while the logic-level input itself would go to the control input of the first section of the quad IC. Of course, the other two sections would be unused and it's important to tie all 3 pins of both unused switch sections to ground. The logic-level for switching will depend on the supply voltage you use, for example, if you use 5VDC to supply the chip, then you'll need a logic-level signal of <= 0.8 for a low, and >= 3.5 for a high. See the datasheet for details. Audio signal #1 would go the #1 switch input and audio signal #2 would go to the #2 switch input. Thus, when you change logic-levels (low to high, or high to low) the circuit output (where both the #1 and #2 switch outputs are tied together), the output will be audio signal #1 for a high and audio signal #2 for a low.

    One final issue, you cannot apply an audio signal that is bidirectional with respect to the CMOS chip's ground. Both audio inputs must always remain between the IC ground and the IC's power supply value. This can be easily done with a dual op-amp chip like the LM358 or the MC34072. Use one of the op-amps for audio signal 1 and the other for audio signal 2 as follows:
    make a unity gain inverting amplifier by connecting the op-amp's inverting (minus) input to it's output thru a 100K resistor and another 100K between the inverting input and one-side of a 0.1uF cap. The bidirectional audio input connects to the other side of the cap. Finally, using another pair of 10K or so resistors (they should be of equal value) connected in series as a voltage divider, connect the top side of the top divider resistor to your 4066's power supply voltage and connect the bottom-side of the bottom divider resistor to circuit ground. Connect the center point of the divider (the divider's output = VCC/2) to the non-inverting (+) input of the op-amp to bias it up to 1/2 of the supply voltage. Make both op-amps in the dual op-amp IC with the same circuit. One of your audio inputs will feed the first op-amp circuit and the other will feed the 2nd op-amp circuit. The ground side of your audio inputs must connect to your circuit ground.

    Connect each of the op-amp outputs to the input of the CMOS switch. The op-amp circuit will bias up the audio signals to 1/2VCC so that the audio inputs to the cmos switch stay within the range of VCC to ground. This assumes that your audio input voltage levels are not more than about 2 volts peak.

    One last thing. You must capacitively isolate the output of the CMOS switch before using that signal to feed an audio amplifier. Use a 10uF electrolytic with the plus side toward the CMOS switch output and the minus side will be your audio output that goes to your audio amplifier input. Don't forget to connect the audio amplifier's input ground to your CMOS switch circuit's ground.

    You can use a 9V battery to run the CMOS IC and the op-amps, or any convenient DC power supply between 5VDC and 15VDC. But then whatever your power supply voltage, your logic input signal to the CMOS switch should be less than 1/3rd VCC for a low and greater than 2/3rds VCC for a high state.

    Good luck and feel free to ask me any questions if you have them. THis is a very low-cost and good quality way of doing what you want. The CMOS IC should cost less than $1.00 and so should the op-amp IC.

    Kamran Kazem
  3. biggestbrad27

    Thread Starter New Member

    Aug 13, 2009
    First of all, thank you for your proposed solution. I'd like to explain the purpose of my project a little more before I go ahead and start building to see if you still would go about it that way.

    My audio sources are two separate iPods or similar MP3 devices, using a 3.5mm audio cable (L, R, G signals).

    I am using the X10 system to enable me to use a remote control to switch between audio sources from anywhere in the building. I am unable to use another remote system because of the plaster walls/etc that degrade a RF signal so much that even a proported 1000ft range transmitter won't even transmit from floor to floor.

    The X10 wall outlet will turn on when the remote is triggered, which would give me a AC voltage in the particular outlet. I would transform this to the appropriate TTL voltage to operate my suggested multiplexer (maybe I'd go for a cheaper option with less bandwidth as your suggested).

    Using either battery or another transformer I would power the ICs and thus I would have one audio source always, until the X10 was triggered, switching me to the second audio source, and then back to the first once the X10 was deactivated.

    Hopefully that explained a little more fully what system I was hoping to create.

    Thank you for your input.