PDA

View Full Version : Interfacing to a headphone jack...



DavidMil
11-23-2009, 07:16 AM
I need help creating a simple circuit that will allow a BS2pe processor to receive a high input from the headphone jack on my laptop when the laptop starts playing music.· The program·will ignore the input for a specific time once the line goes high,·so it's just a matter of waiting for·a high input.· I·connected a multi meter to the·jack and only saw about 800mv max, but I realize that's probably not a very accurate reading.· Any help would be appriciated.

Thanks,
David·

Franklin
11-23-2009, 08:13 AM
The bs2 will not be able to do this by itself you will need something to do signal processing and that will be the part that senses the music playing. 800mv is about right for a audio output but it will fluctuate depending on the level of music and it's type.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

DavidMil
11-23-2009, 11:41 AM
I was thinking about something like a transistor with the headphone jack tied to the base through a resistor.· Once the base voltage 'turns the transistor on' the first time to send a high to the input pin on the processor it won't matter to the program what happens to the transistor for a set amount of time; until the program forces the input low and waits for the transistor to·'turn on' again.·

PJ Allen
11-23-2009, 11:56 AM
800mv may or may not get it that way.· You'll get much better results with a comparator, then you can use a pot to adj a trigger point even at a very low voltage.· Look for a LM339.

Beau Schwabe (Parallax)
11-23-2009, 01:53 PM
DavidMil,

In order to make a bipolar transistor turn 'on', the B-E junction needs to see about 550mV before it starts to conduct in it's linear mode. Since the nature of your signal is audio and likely to be 800mV peak-to-peak it could very well be +/-400mV ... IOW below the transistor threshold of 550mV. You can however bias the transistor input in a way that even a very small signal well below 550mV is enough to turn the transistor 'on'. The attached circuit allows you to adjust this bias so that the SCR (made from the NPN and PNP transistor) will trigger and latch the output from about 300mV to 700mV.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

DavidMil
11-23-2009, 02:15 PM
Thank you Beau, that's perfect!
And thank you all for your suggestions.

David

PJ Allen
11-23-2009, 10:02 PM
Gee, I thought the Stamp was supposed to be part of the solution.· Well, whatever.

Bet the next post will be about "How do I unlatch the latch?"·

[I know how.]

Beau Schwabe (Parallax)
11-23-2009, 10:48 PM
PJ Allen,

I know you know this, but perhaps I should have added more detail (tongue in cheek - grin)

Sending a HIGH signal from the Stamp to the RESET pin will cause the latch to become unlatched.
When latched, the OUT pin goes LOW, which can be read from the Stamp.
Adjusting the 10K Pot allows you to adjust the latching threshold between 300mV to 700mV.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

erco
11-24-2009, 03:22 AM
In my very early days as a CW ham (using morse code), I built an automatic keyer to send a full minute of CQ CQ CQ de WA4CIK CQ... .

I recorded my code from a code practice oscillator into an audio cassette recorder. Then played it back at high volume out the headphone jack, through an audio transformer then rectified the audio signal with a bridge rectifier & cap, and used that to drive a relay directly, which keyed my transmitter. It worked great.

When it works, brute force rocks !

David, you could probably do something similar with an audio transformer to get higher than 800 mV.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."