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.


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.

  • \$\begingroup\$ What is the transistor, diode, capacitor, resistor, LED and the signal amplitude at the base of the transistor? \$\endgroup\$
    – Spoon
    Commented Dec 8, 2016 at 6:27
  • \$\begingroup\$ 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. \$\endgroup\$
    – Bradman175
    Commented Dec 8, 2016 at 6:31

2 Answers 2


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.


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:


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.

  • \$\begingroup\$ 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. \$\endgroup\$
    – user132523
    Commented Dec 8, 2016 at 6:36
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – carloc
    Commented Dec 8, 2016 at 10:10
  • \$\begingroup\$ Yeah, I was really hoping to do it without any power supply \$\endgroup\$
    – Gavin Wahl
    Commented Dec 10, 2016 at 5:05
  • \$\begingroup\$ @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) \$\endgroup\$
    – Curd
    Commented Jan 10, 2017 at 14:58
  • \$\begingroup\$ 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). \$\endgroup\$
    – Gavin Wahl
    Commented Jan 10, 2017 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.