2

I want to turn on a transistor by playing sound through my computer's soundcard. I thought that this simple circuit with a diode to rectify the AC, capacitor to smooth it out, and a transistor to switch would work.

schematic

simulate this circuit – Schematic created using CircuitLab

But it didn't work. What's going wrong?

Note: What I'm actually trying to do is trigger the PTT on a Yeasu FT-60R hooked up to my computer when the computer starts playing sound. My plan is to use one audio channel as the audio input to the radio, and the other input to drive this circuit. The transistor would connect the radio's MIC line to GND through a 2k resister, which is supposed to trigger PTT. The LED circuit is just to see if the idea works at all.

Gavin Wahl
  • 121
  • 2
  • What is the transistor, diode, capacitor, resistor, LED and the signal amplitude at the base of the transistor? – Spoon Dec 08 '16 at 06:27
  • Firstly there should be a resistor at the base of the transistor to prevent high current flow. Secondly the LED would make switching harder since it's at the emitter, and that it would blow because there is no resistor. – Bradman175 Dec 08 '16 at 06:31

2 Answers2

1

The problem with your circuit is that to turn the transistor on, its base voltage needs to overcome both the B-E drop of the transistor and the voltage drop across the LED. To get to that level, the audio input needs to be one more diode drop higher due to the diode before the base. That comes out to around 3.5 V, which is more than the normal high points "line level" audio, except at some sound peaks.

Here is a possible method that requires audio amplitude that should be within the normal range:

The peaks of the audio signal only need to be 700 mV or so to turn on Q1. When that happens, C1 is discharged and the bottom end of R1 held low. That turns on Q2, which pulls up OUT. R3 only illustrates a load. R2 is to overcome any leakage of Q1 and to make sure Q2 is solidly off when there is no audio signal. It can be omitted in a cost-optimized system.

When audio is no longer present, C1 will charge up thru R1 with a time constant of 10 ms. That allows for plenty of time for peaks of new audio cycles to discharge C1 again before Q2 turns off. The response from audio going away to OUT going low should be a few 10s of ms.

Olin Lathrop
  • 310,974
  • 36
  • 428
  • 915
0

your computer drives a signal whose amplitude is no larger than about a volt... so your diode is dropping all the voltage.

you need to run the audio signal from your computer into an op-amp and use THAT signal to drive your transistor:

schematic

simulate this circuit – Schematic created using CircuitLab

the op-amp provides buffering of your computer's audio output. it will duplicate the input voltage on the output, scaled by R2/R1 set by the potentiometer R2. if you use 100k and 10k, you can get a 10V amplitude signal to drive all your fancy lights. use mosfets.

  • if you don't have any MOSFETs, BJTs are great too, just make sure you put a solid 20k or more at the base... and tie the emitter to common. put the entire load on the collector. –  Dec 08 '16 at 06:36
  • 1
    Mmm I belive one opamp with dual supply is a little overkilling for this application (I believe a PC's headphone output is tough enough to drive one BJT on). But mainly Your circuit has got a few problems: C1 will short opamp output and most likely drive it into instabilty, probably you meant to have it "after" D2. But even correcting this "typo" there is no way to discharge MOS gate and switch it off once AC drive signal has gone. It will stay on impredictably upon gate and surrounding pcb tracks leakage. – carloc Dec 08 '16 at 10:10
  • Yeah, I was really hoping to do it without any power supply – Gavin Wahl Dec 10 '16 at 05:05
  • @Gavin Wahl: you need a power supply to power the LED anyway (or what do you mean by the right most symbol in your diagram) – Curd Jan 10 '17 at 14:58
  • The LED was just to demonstrate if the transistor was on or off. My goal is to switch on the PTT on a radio (see the second part of my question). – Gavin Wahl Jan 10 '17 at 20:37