Detect plug connection

Mar 07, 2011 17 Replies

Hi



I am currently working in a system that has a connector, for security reasons it would be great to know when the plug is attached, i.e. detect connection.



I have been thinking I found some ideas, the first simple and expensive is to add 2 pins to the plugs, short this pins and when connected we have a nice jumper, like I said is expensive considering my current plug.



The other solutions are not feasible ( with a magnetic switch, metal shell shorted with one pin... etc)



So, how the guys from computers do with the headphones plugs, to switch between speakers and headphones? same in iPods, Cellphones etc.



Any ideas? Do you have some experience in this kid of problems? Thank you!


the usual headphone socket has a build in switch

-Lasse

Traditionally it's a mechanical switch built within the jacks -- when the headphone plug is inserted, it opens what had been a short connecting the audio amp's output to the speakers.

I believe there are newer systems where the detection is done electronically, although I'm not certain exactly how (I can think of a few ways, but I'm not sure they'd always be reliable... heck, probably most reliable would be a photosensor that's physically blocked when a plug is inserted).

Oh, that's it, I was thinking in a complex solution like an OpAmp in one pin and when a wire or wires connected it works like an antenna and then switch signals....

I can't use any mechanical solution due to the kind of connector.

Thanks !

BTW I have a HTC tattoo and in order to listen to the radio you actully need to plug the headphones and uses the wire as an antenna. (I would like to know more about this subject too)

If you know what's on the other side you might be able to use a couple of resistors (pullup and series) going into a CMOS input-- but not if it might be AC coupled.

Computers seem to have this complex method that goes through software "You just plugged something into the microphone jack" but it seems it gets confused easily and fails to switch over, at least on my Dell.

Generically speaking, many antennas would have dimensions in the ballpark of one-quarter of their operating wavelength. For the FM broadcast band,

88-108MHz, at the center of the band (~97.5MHz), the wavelength is 300*10^6M/s / 97.5*10^6/s = 3m. One quarter of that is ~77cm (~30"), which very conveniently is the same ballpark that many headphone cords tend to be.

In other words: The headphone cord makes a reasonably decent and effectively free antenna. For something the size of a cell phone, designing a decent antenna into the package itself takes a fair amount of work/expense, that HTC probably didn't feel was justified.

---Joel

of

^6M/s

ely

nt

HTC

Thanks for your great answer, to all

Even If I can implement that function I think it is interesting

of

^6M/s

ely

nt

HTC

Thanks for your great answer, to all Even If I can't implement that function I think it is interesting

Remote microphones are often "phantom powered" if the signal you are sending is always AC or always DC you might be able to use a variant of that.

On Monday, March 7, 2011 10:12:05 AM UTC-8, Pr=E9cis d'electronique wro= te:

Well, if one pin is GND, and you have a spare position, you can make all pl= ugs short the spare to GND. With a small pullup resistor on that socket, the socket will indicate HIGH when there's no plug inserted.

Options are critically dependent on what's on the signal pins and whether the system can tolerate disturbance or measurement of the system parameters while active.

How secure? Adding two pins shorted can be defeated by shorting the wire before unplugging. A challenge/response system would be much more difficult to defeat.

Do you really need to know if the plug is disconnected? An alternative might be to PREVENT the plug being disconnected. Screw, clamp, alarm, guard dog, fence charger....

Most issues like this turn out to be WAY more complex than we think. A simple solution that doesn't really do what's needed is a waste of effort.

Oh come on now!

Have you ever taken a look at a headphone jack? Practically all of them (the ones that switch out internal speakers) have a small set of auxiliary contacts built into them that are operated by plug insertion. Stuff like this is available even at Radio Shack.

Most commonly available jacks integrate the audio signal switching and jack functions such that the audio signal in is redirected to the phone plug within the assembly. But there are jacks available where the switch contacts are isolated from the jack contacts and are available to do control whatever logic or signal levels apart from the jack output you'd like.

Paul Hovnanian mailto:Paul@Hovnanian.com ------------------------------------------------------------------ Quando Omni Flunkus Moritati (When all else fails, play dead) -- Red Green

The switching jacks are an issue for me also.

I often listen to radio via headphones until the wife wakes up (_every_day_)... my body is attuned to sunrise ;-)

So I worry about the jack wearing out. But examination of my JVC schematic indicates the need for major mechanical surgery to simply add a switch :-( ...Jim Thompson

| James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | Remember: Once you go over the hill, you pick up speed

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

Hmm, one of our cats is like that: The sun is out? Oh, good, it must be time for breakfast! Let me go and walk over the still-sleeping people and meow at them until they feed me!

Which JVC radio is it?

Our cat is also like that.

Our #2 daughter (Jennifer) was a problem. She'd wake up at dawn, go into #1 daughter's (Madeleine) bedroom and stare at her until she woke up ;-)

Madeleine would scream, "She's staring at me again!" ;-)

Jennifer was always a cracker-jack all around...

One morning we woke up, Jennifer (about age 2) was not to be found. Panic! Doors are all locked (dead-bolts, so she couldn't have left the house). Search everywhere. About to call police, when I hear faint giggling coming from the kitchen. Go to kitchen, nothing. Finally look up, and she's on top of refrigerator! Then I realized, chair against kitchen counter... she climbed up on counter, then up on top of the fridge :-)

She's now a chemist, running City of Phoenix Water Labs.

Oldie... FS-6000 ...Jim Thompson

| James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | Remember: Once you go over the hill, you pick up speed

I envisioning a 'toon image of Jim's eyes bulging out, followed by his shouting "I'll save you, Baby Jennifer!" as he dashes towards the fridge and steps on a bar of soap on the floor...

Dave Platt AE6EO Friends of Jade Warrior home page: http://www.radagast.org/jade-warrior I do _not_ wish to receive unsolicited commercial email, and I will boycott any company which has the gall to send me such ads!

In my experience, the jack contacts wear out just as often as the internal switch contacts. Either way, repairs will be required. Trying to eliminate the switch in a design may not buy you much.

It might be possible to repair such an appliance by removing the bad jack, soldering wires onto the PC board pads and locating a new jack elsewhere should an exact fitting component not be available. I've done this a number of times. It doesn't look pretty but the appliance still works.

Paul Hovnanian mailto:Paul@Hovnanian.com ------------------------------------------------------------------ Trust the computer industry to shorten the term "Year 2000" to Y2K. It was this kind of thinking that got us in trouble in the first place. -- Adrian Tyvand

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required