Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Turn on a switch from audio jack.

Status
Not open for further replies.
:banghead::banghead:
Spec,
Disregard my last post. I feel dumb now. Always read the component before using! I had one remaining lm358n that was left in the little plastic bag that it came in. The bag had the component id printed on it but when I look now it's an lm741. There's a good reason why this isn't working!:confused:

Baxter,

:p To err is human. To err greatly is engineering. I wont mention the goofs I have made along the way!

spec
 
Last edited:
Thanks again spec,
What is the benefits of the opamp in this application and how fast would it turn on as compared to the lesser circuit? A very fast turn on would be important to me.
Thanks.
Spec,
Well, I'm back. I've spent quite a while with this on the breadboard with an actual lm358:wideyed: and I'm lost. I haven't done enough with op-amps to figure out why this is always on. So I'm wondering if you can look at this one more time to confirm that it should work, please! I can tell you that the base and emitter of the bc337 always have just over 2 volts on them both. I've checked my connections over and over again.

I've gotten the other circuits to work but, I have noticed something on the 2 circuits that I got to work and they work like VOX circuits and that isn't good for me because the audio only stays on for a short period and if the voice isn't loud enough they cut off. I was hoping for a circuit that would come on and stayed on then there was any voltage/current sent to the audio jack, caused by the open squelch. Knowing what I know now, I'm just going to try using a simple transistor as a switch circuit.
 
Last edited:
Spec,
If I take R26 and C3 out of circuit 2 I'm left pretty much with a switch and it works for the most part. The longer it's on the more clicking I get. I haven't had a chance to check the biasing and I suspect it must be a bit low causing the transistor to go low briefly.
 
Spec,
Well, I'm back. I've spent quite a while with this on the breadboard with an actual lm358:wideyed: and I'm lost. I haven't done enough with op-amps to figure out why this is always on. So I'm wondering if you can look at this one more time to confirm that it should work, please! I can tell you that the base and emitter of the bc337 always have just over 2 volts on them both. I've checked my connections over and over again.

I've gotten the other circuits to work but, I have noticed something on the 2 circuits that I got to work and they work like VOX circuits and that isn't good for me because the audio only stays on for a short period and if the voice isn't loud enough they cut off. I was hoping for a circuit that would come on and stayed on then there was any voltage/current sent to the audio jack, caused by the open squelch. Knowing what I know now, I'm just going to try using a simple transistor as a switch circuit.
Spec,
If I take R26 and C3 out of circuit 2 I'm left pretty much with a switch and it works for the most part. The longer it's on the more clicking I get. I haven't had a chance to check the biasing and I suspect it must be a bit low causing the transistor to go low briefly.

Hi Baxter,

Hmm, it is odd that version three audio detector, shown in post #19, is not working. I will analyze it some more and see if there is a problem with the design.

I'm not sure what you mean when you say that you have removed R26 and C3 because those part names are not included on the schematic of post #19.

But, in the mean time, can you return the circuit to the original configuration, remove the audio input, place a short across the input, and check if the PMOSFET turns off.

Also, are you using a BC337 transistor? Other medium current NPN transistors will be OK (2N2222, BFY51), but not small signal transistors like the BC54x or BC10x series.

Version three issue 2 schematic does not show the supply pin numbers for the LM358; I expect you have the correct connections (pin 4= 0V, pin 8 = 12V).

Is the Zener diode fitted at the input?

Data Sheet LM358: https://www.ti.com/lit/ds/symlink/lm158-n.pdf

Data sheet BC337: https://www.onsemi.com/pub_link/Collateral/BC337-D.PDF

spec
 
Last edited:
Hi Baxter,

I have had a look at the version 3, issue 2 schematic of post #19 and can't find a problem.

But, I have altered the peak detector to give the transistor an easier time and to improve performance. Note that the input protection diode has changed from a Zener to a small signal high speed diode and the transistor has changed from an NPN type to a PNP type (medium current). The input connections to the opamp have also changed.

The revised schematic is in post #46.

Possible causes of the problem are:

(1) The peak detector is oscillating.

(2) The audio input signal has a DC offset.

(3) The audio source is capacitively coupled and the signal is being DC shifted/rectified by the opamp substrate diodes.

If you would like to build issue 4 of version 3 and see how that works we can take it from there.

By the way, all versions of the circuit can be modified to have a BJT switching element in the output or a relay.

spec
 
Last edited:
Version 3, issue 4 schematic:
Post issue 2 of 2016_0_03

2016_09_28_Iss4_ETO_AUDIO_DETECTOR_Ver3_mod.png


LM358 data sheet: https://www.ti.com/lit/ds/symlink/lm158-n.pdf
BC327 data sheet: **broken link removed**
IRF4905 datasheet: https://www.infineon.com/dgdl/irf4905pbf.pdf?fileId=5546d462533600a4015355e329b1197e

ERRATA
(1) Change R9 to 2K2
(2) Change R15 to 390R
(3) Replace R10 with two 4K7 resistors.
(4) Connect a 10nF ceramic capacitor from the junction of the two new 4K7 resistors to 0V (RF filtering)
 
Last edited:
Hi Baxter,
I'm not sure what you mean when you say that you have removed R26 and C3 because those part names are not included on the schematic of post #19.
spec
The circuit in Post #16
Yes. I did connect pins 4&8 on the lm358
I'll give the new design a try. I must have missed something on the breadboard:banghead:
Thanks again.
 
The LM358 output high is no where near its positive supply voltage so I think the PNP transistor will be turned on all the time. Swap R3 and R15.
EDIT: See my correction to this mistake in post #53.
 
Last edited:
The LM358 output high is no where near its positive supply voltage so I think the PNP transistor will be turned on all the time. Swap R3 and R15.
Hmm you have me worried now AG :)

It is quite true that if an LF358 opamp is driving a load connected to OV the output voltage will only reach a few volts negative from the positive supply line. But if you have no load to 0V, you can pull the output up to the supply line with a resistor (or constant current).

Q2 will be off when the opamp output voltage is around supply line minus 500mV so the lower transistor in the LF358 output (Q13 of Figure 16 on the LM358 data sheet) will still be in the linear region, while the top transistor (Q6) will be biased off. Thus the opamp will also be in its linear region and will operate as a differential amplifier in the peak detector.

The same principle (R9 pull up) is used with the second opamp to turn the PMOSFET off, although here the opamp is operating as a comparator (Schmidt trigger).

It is a long time since I have used an LM358 in anger, but I think this is correct.

In case you are wondering why I have chosen this approach to drive the base of Q2, it is to get the maximum collector current out of Q2 on the schematic of post #46, without exceeding the base and collector currents. The high current is to charge up C2 fast.

Given a free hand, I would have specified an OPA2197, which has Rail To Rail Input/Output (RRIO), very low input offset voltage, and very high input impedance. But I specified an LM358 because of its low cost and ubiquity. An OPA2197 would have simplified the design and improved performance. I would have also made Q2 a medium current PMOSFET.

spec

OPA2197 data sheet: https://www.ti.com/lit/ds/symlink/opa197.pdf

2016_10_03_ETO_LM358_schematic.png

 
Last edited:
Well the plot thickens. While playing with the simple transistor switch circuit I made on my own I discovered that although it seemed to work, when I transmit on the radio I get what I think is RF coming out the jack. It wreaks havoc on the circuit. The audio cable I'm using is shielded and I even put the breadboard in a metal box for shielding. If I transmit on a second radio, the circuit remains stable so the problem is definitely coming through the audio jack. Here is a scope tracing of the offending signal. I'm not sure how to get rid of that or if it's even possible!
IMG_4014.JPG
 
Hi Baxter,

You have a scope: great news.:cool:

From what you say, a low pass filter will be required at the input of the circuits to eliminate the RF.

spec
 
The LM358 output high is no where near its positive supply voltage so I think the PNP transistor will be turned on all the time. Swap R3 and R15.
I have adjusted two resistor values to improve the transistor and PMOSFET turn off (see post #46).

spec
 
You are right, spec. The output voltage of the LM358 will be pulled up by R15 and R3 with only the 50uA of current pulling the base of the BC327 transistor to about (50uA x 4.7k=) 0.235V down from the positive supply which will not turn on the transistor.
 
I've only been able to try the circuits from #16 and #24. I can't do the op-amp ones because the only lm358 I had is dead.
I made a discovery on both those circuits. I said in previous posts that they stay on for a while when there is audio and then turn off. I checked the voltage on the transistor between CE. It's start close to a volt and starts to rise. Eventually getting to 8v and shutting down the transistor. How is the voltage rising. The voltage coming from the audio is steady white noise. It doesn't change and it's voltage stays the same. I don't get it. Any ideas?
 
You are right, spec. The output voltage of the LM358 will be pulled up by R15 and R3 with only the 50uA of current pulling the base of the BC327 transistor to about (50uA x 4.7k=) 0.235V down from the positive supply which will not turn on the transistor.
Thanks AG. It is always interesting and helpful to discuss how a circuit functions. It helps to improve/correct a circuit. For example, as a result of you comment I have improved the drive for both the BJT and PMOSFET. I am probably going to change the BJT to a medium power MOSFET in the end: seems like a much better approach and a simpler design.

spec
 
I've only been able to try the circuits from #16 and #24. I can't do the op-amp ones because the only lm358 I had is dead.
I made a discovery on both those circuits. I said in previous posts that they stay on for a while when there is audio and then turn off. I checked the voltage on the transistor between CE. It's start close to a volt and starts to rise. Eventually getting to 8v and shutting down the transistor. How is the voltage rising. The voltage coming from the audio is steady white noise. It doesn't change and it's voltage stays the same. I don't get it. Any ideas?
Hi Baxter,

Odd happenings.:wideyed:

With post #16 circuit can you try this:

(1) Remove the audio signal from 'AUDIO INPUT': The voltage on Q9 collector should rise to '12V POWER LINE'
(2) Connect 'AUDIO INPUT' to '12V POWER LINE': The voltage on Q9 collector should fall to around 100mV

spec
 
I think the base-emitter junction of the input transistor is rectifying the audio which charges the input capacitor resulting in less base current to turn on the transistor. Then the collector voltage rises as the transistor slowly turns off.
 
I think the base-emitter junction of the input transistor is rectifying the audio which charges the input capacitor resulting in less base current to turn on the transistor. Then the collector voltage rises as the transistor slowly turns off.
That's kinda what I thought, so I removed the capacitor and the issue remains:arghh:
 
Hi Baxter,

Odd happenings.:wideyed:

With post #16 circuit can you try this:

(1) Remove the audio signal from 'AUDIO INPUT': The voltage on Q9 collector should rise to '12V POWER LINE'
(2) Connect 'AUDIO INPUT' to '12V POWER LINE': The voltage on Q9 collector should fall to around 100mV

spec
That's correct.
The radio has to be causing this somehow!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top