How can I make led light up when I insert headphone plug?
Jul 9, 2003 at 8:06 PM Thread Starter Post #1 of 10

dokebi

500+ Head-Fier
Joined
Mar 25, 2002
Posts
882
Likes
11
I want to make it so that if a headphone plug is inserted an LED light turns on indicating it. Is there an easy way to do this? Also, how do momentary switches/buttons work? I saw some very nice buttons but they are all momentary and would like to configure it for use with an amp's power on/off function.
 
Jul 9, 2003 at 8:22 PM Post #2 of 10
You can get jacks that also incorparate
a switch when the jack is inserted.
One example is

http://www.mouser.com/index.cfm?hand...teria=161-0084

It incorporates a DPDT. You could easily wire this to turn on an led
when the jack is inserted.

Momentary switches turn "on" for
a split second when the button is depressed, and then go back, along with the button,
to thier default position. To use these, you'd
need a microcontroller I imagine.
What buttons did you look at? They should be
available in a static configuration.
 
Jul 9, 2003 at 9:54 PM Post #3 of 10
Quote:

I want to make it so that if a headphone plug is inserted an LED light turns on indicating it. Is there an easy way to do this?


I just hacked this circuit out:

hp-jack-led.png


SW is a normally-closed switch. Many headphone jacks have two of these built in which you probably aren't using, so we're going to use one of them to control the LED. Q1 is a small JFET, configured such that the n/c switch connects the gate to V- in the amp, pulling it below the source, which is at [virtual] ground. This cuts off current through the JFET. When the switch opens due to inserting the headphone jack, the 10K pullup resistor (Rp) brings the gate above the source, saturating the JFET, bringing the LED on. 10K is a random value I picked out of the air that should work, but 100K is more efficient and should still work.

Several things to beware of. First, check your JFET's spec sheet to see what the maximum Vdg voltage is. The one I'm using (2N5484) is 25V; since the gate can be as low as V- in this setup and drain is at V+ less the drop of the LED, this means you can only use this circuit with up to 27V on the power supply, if your LED has a 2V drop. Play it safe and don't use it on supplies higher than 24V, or get a JFET capable of tolerating a higher Vdg difference. Alternately, you can put a resistor inline with the n/c switch to form a divider such that the gate doesn't go all the way to V-. Another thing to beware of is that the JFET is used in saturation, which means you need a JFET with a small enough Idss that the LED isn't too bright or burning up. If you can't find a suitable JFET or you want to tune the brightness, you'll need to add a source resistor.

Have fun with this!

Quote:

Also, how do momentary switches/buttons work?


The keys on your keyboard are momentary switches. Holding the actuator (button, bat, whatever) down opens or closes the contact (depending on the switch type), and releasing the actuator returns it to the normal state.

Quote:

I saw some very nice buttons but they are all momentary and would like to configure it for use with an amp's power on/off function.


As you can see, these are not the right kind of switches for power, in and of themselves. You'd have to lash up a relay or a transistor circuit to do what you want.
 
Jul 9, 2003 at 11:51 PM Post #4 of 10
That's interesting. Couldn't you also set it up so that the amp doesn't turn on until you plug in your headphones? To turn it off, you just unplug the headphones. That would be cool for a really small design or even if you don't want to fool with an on/off switch.
 
Jul 10, 2003 at 5:42 AM Post #5 of 10
Quote:

Couldn't you also set it up so that the amp doesn't turn on until you plug in your headphones?


Not without consequences you might not want to accept. First off, realize that this circuit needs to stay powered up all the time -- if this circuit turned the amp's power completely off, it couldn't turn itself back on. So to make this do what you want, you'd have to put the amp downstream from this circuit and let the resistors drain current from the battery to keep the JFET active even when the amp is "off". You'd want to get the quiescent drain well under 1mA, and probably only use it with rechargeables which will self-discharge anyway so you're not losing much by running this circuit all the time.

The next problem is that JFETs aren't good power devices. They tend to have low current limits. Instead, you'd want to use a bipolar transistor here. In fact, I could have done the headphone LED circuit with a bipolar. I only chose a JFET because I could use fewer parts that way. I haven't tried it, but it seems to me that you'd want to put a resistor from V+ to an NPN transistor's base, then a wire from that through the n/c switch to drain that current away from the base when the switch is closed. Then when the switch opens, the current flows into the base and opens the transistor up. You'd need one more resistor to act as a current limiter for the LED (I got away without this by using a JFET). It's not hard to find a transistor that will supply enough current to easily drive the LED plus an amp. You might consider using a Darlington transistor instead, if the additional voltage drop isn't a problem in your situation. This will lower the quiescent current of the circuit and if you use a power Darlington you should have no problem powering even a fairly hefty headphone amp from it, and at the same time the quiescent current will be lower than with a single bipolar.
 
Jul 10, 2003 at 1:59 PM Post #7 of 10
I got a panel mount mini jack from Digikey the other day. It has four contacts, the usual three and one that connects to ground when you plug the headphones in. You could hook that up to your LED, using the voltage between a rail and ground.
 
Jul 10, 2003 at 6:02 PM Post #8 of 10
Quote:

First off, realize that this circuit needs to stay powered up all the time


Oh yeah. That whole "standby mode" thing. I guess you could rig some mechanical connection to close when you plug the phones in, but that might be kludgy unless it was designed right. Possible, though.
 
Jul 10, 2003 at 6:23 PM Post #9 of 10
I believe the link I posted above
has a DPDT switch that is independent of the jack
circuit. It's "thrown" when the plug
is inserted or removed. You can use
this to turn on/off the power. Please
correct me if I'm wrong.
 

Users who are viewing this thread

Back
Top