How to prevent short circuit problems when inserting stereo phono plug into receptacle?

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Hello,
I have 2x sensors that come from the manufacture with a stereo phono plug at the end.
Sensor #1: Tip is power (3.3V), ring is analog signal (0 to 3.3V representing sensor reading), and sleeve is ground.
Sensor #2: Tip is power (12V), ring is digital signal (0 to 3.3V), and sleeve is ground.

The problem I am facing is that when you insert the sensor into the port, the tip of the phono plug will momentarily make a connection between the tip (power) and the ring(data). This is not an issue with the 3.3V power, but if using 12V power this sends 12V into the microcontroller which is bad. What is a good way of accommodating this?

Here is my circuit currently:
phono_plug_question1.jpg
  • The 33 ohm resistor is there to protect the power when it gets short circuit temporarily when plugging the phono plug in (draws 0.1 amp when shorted to ground).
  • I need the microcontroller to have control of giving power to the sensor, so I put a transistor on the ground pin of the phono plug, is this an acceptable way of accomplishing this?
  • The 200k ohm pull-down resistor is there so that when no sensor is plugged in, the reading is 0 (ground). This seems to be such a high resistance that it doesn't effect the sensors analog-output, or the sensors digital-output.
My main problem is how to protect the data line from that temporary 12volt short. Any help or advice on this would be greatly appreciated!

Also, I have some phono receptacles that have the 2x switches inside... however, the short circuit occurs before the switches are open, and still occurs temporarily even after the switches have opened... so I'm not sure how useful it will be to utilize the phono receptacle switches?

Here is the sequence:
phono_plug_question2.jpg

Thanks and any help or advice is greatly appreciated!
 

KJ6EAD

Joined Apr 30, 2011
1,581
Change to a more appropriate connector type such as an E4 or mini DIN. By the way, the connectors you have now are phone connectors, not phono connectors.
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Change to a more appropriate connector type such as an E4 or mini DIN. By the way, the connectors you have now are phone connectors, not phono connectors.
This is unfortunately not an option. They come from the manufacture like this and cannot be changed. There are a ton of sensors out there from various manufactures in various industries that use these phone connectors on the end, so the industry is dictating this to be an acceptable connection, and is why I am trying to accommodate it. I agree a different connector would be more convenient for me, but I need to accommodate it this way.
 

ebp

Joined Feb 8, 2018
2,332
The problem with any sort of processor-controlled switching scheme is that the fault conditions can arise at any time. If someone pulls the plug with power enabled, you wind up with 12 volts on the input.

Most inputs, both digital and analog, are protected by diodes to the supply and ground of the IC. Typically these diode can handle current of 5 to 10 mA while maintaining non-damaging voltage at the input. A few can only handle 2 mA, so the datasheet must be consulted (usually in the "absolute maximum" section, though for older parts there may be no spec). If it can be tolerated without interfering with the signal, a simple series resistance to limit the current is often sufficient. CMOS inputs that don't have internal pull-up or pull-down resistors will generally work just fine with quite large series resistance, though the slew-rate limiting and delay effects of the capacitance of the input with the series resistance must be considered. Series resistance may have very little or very substantial effect on analog inputs, and no generalization can be made.

For the 12 volt digital signal, a series resistance of 10k would provide good protection and be very unlikely to interfere (neither 12 V nor a phone plug is at all likely for any sort of fast signal). If in doubt, external diodes can be added. Any convenient signal diode, such as 1N4148, would suffice.

One caution with the diode clamping method - if the entire "receiving" circuit operates at very low power, the current through the resistor and clamping diodes might be enough to raise the supply voltage of the circuit. If that is the case, other more elaborate methods must be used. If a zener dode is considered, remember that device with reverse breakdown of less than about 5-6 volts are true zeners (higher are avalanche diodes) and the "knee" of the voltage-current curve is very rounded, meaning they start to conduct at a voltage well below nominal breakdown. Special transient suppression devices may be a better choice, both for sharper knee and much lower capacitance.

I haven't looked in a very long time, but some of the major IC manufacturers used to publish ap notes on protecting inputs. Texas Instruments is a good place to start looking.
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Instead of an NPN switching the ground connection, could you use a PNP to switch the +ve supply?
Thanks for the idea! This seems like it could solve the insertion problem, but if the user was to pull the plug out when it was activated it would still send the 12V into the 3.3V tolerant microcontroller.

The problem with any sort of processor-controlled switching scheme is that the fault conditions can arise at any time. If someone pulls the plug with power enabled, you wind up with 12 volts on the input.

Most inputs, both digital and analog, are protected by diodes to the supply and ground of the IC. Typically these diode can handle current of 5 to 10 mA while maintaining non-damaging voltage at the input. A few can only handle 2 mA, so the datasheet must be consulted (usually in the "absolute maximum" section, though for older parts there may be no spec). If it can be tolerated without interfering with the signal, a simple series resistance to limit the current is often sufficient. CMOS inputs that don't have internal pull-up or pull-down resistors will generally work just fine with quite large series resistance, though the slew-rate limiting and delay effects of the capacitance of the input with the series resistance must be considered. Series resistance may have very little or very substantial effect on analog inputs, and no generalization can be made.

For the 12 volt digital signal, a series resistance of 10k would provide good protection and be very unlikely to interfere (neither 12 V nor a phone plug is at all likely for any sort of fast signal). If in doubt, external diodes can be added. Any convenient signal diode, such as 1N4148, would suffice.

One caution with the diode clamping method - if the entire "receiving" circuit operates at very low power, the current through the resistor and clamping diodes might be enough to raise the supply voltage of the circuit. If that is the case, other more elaborate methods must be used. If a zener dode is considered, remember that device with reverse breakdown of less than about 5-6 volts are true zeners (higher are avalanche diodes) and the "knee" of the voltage-current curve is very rounded, meaning they start to conduct at a voltage well below nominal breakdown. Special transient suppression devices may be a better choice, both for sharper knee and much lower capacitance.

I haven't looked in a very long time, but some of the major IC manufacturers used to publish ap notes on protecting inputs. Texas Instruments is a good place to start looking.
I liked the Zener idea. This seemed like it would work better than the 4148 clamping diodes, since they can only tolerate around 150 - 200mA right?

I found this Zener:
https://www.digikey.com/product-detail/en/on-semiconductor/1SMA5913BT3G/1SMA5913BT3GOSCT-ND/917671

And paired up with the equivalent 33.33 ohm resistors (equivalent of 6 watts) this seems like it should clamp the voltage going to the microcontroller at 3.3V, and also not interfere with the analog or digital signals?

Here is what I came up with so far, how does this look?
phono_plug_question3.jpg
 

ebeowulf17

Joined Aug 12, 2014
3,307
Thanks for the idea! This seems like it could solve the insertion problem, but if the user was to pull the plug out when it was activated it would still send the 12V into the 3.3V tolerant microcontroller.



I liked the Zener idea. This seemed like it would work better than the 4148 clamping diodes, since they can only tolerate around 150 - 200mA right?

I found this Zener:
https://www.digikey.com/product-detail/en/on-semiconductor/1SMA5913BT3G/1SMA5913BT3GOSCT-ND/917671

And paired up with the equivalent 33.33 ohm resistors (equivalent of 6 watts) this seems like it should clamp the voltage going to the microcontroller at 3.3V, and also not interfere with the analog or digital signals?

Here is what I came up with so far, how does this look?
View attachment 152490
Are you planning to use the exact same input circuit for both 3.3V analog and 12V digital circuits? I think it will be easier to do things well if you handle them differently.

For 3.3V analog, you probably don't want a 3.3V Zener, because it will start leaking significant current before the 3.3V limit is reached. If you need meaningful analog readings anywhere near full scale, the Zener could mess things up pretty badly. You can use a higher voltage Zener, or a pair of signal diodes.

As for the 12V side I would use a current limiting resistor inline with the signal input to reduce the amount of current the Zener has to handle. You might also want to consider a different current limiting arrangement on the power side of the 12V system. The resistors you've drawn aren't rated for high enough wattage to handle a continuous short of 12V to ground, and they're already pretty large. If you're only worried about shorts to the signal line, then a resistor on the signal input takes care of everything, and it can be much higher resistance (therefore lower current and lower wattage) since it doesn't need to supply power to the sensor. If you do want short circuit protection on the 12V output, you might want to consider a current limiting circuit instead of just using resistors.
 

ebp

Joined Feb 8, 2018
2,332
ebeowulf has addressed the issues very well!

I can't make any more detailed recommendations without data on the sensors.
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Are you planning to use the exact same input circuit for both 3.3V analog and 12V digital circuits? I think it will be easier to do things well if you handle them differently.

For 3.3V analog, you probably don't want a 3.3V Zener, because it will start leaking significant current before the 3.3V limit is reached. If you need meaningful analog readings anywhere near full scale, the Zener could mess things up pretty badly. You can use a higher voltage Zener, or a pair of signal diodes.

As for the 12V side I would use a current limiting resistor inline with the signal input to reduce the amount of current the Zener has to handle. You might also want to consider a different current limiting arrangement on the power side of the 12V system. The resistors you've drawn aren't rated for high enough wattage to handle a continuous short of 12V to ground, and they're already pretty large. If you're only worried about shorts to the signal line, then a resistor on the signal input takes care of everything, and it can be much higher resistance (therefore lower current and lower wattage) since it doesn't need to supply power to the sensor. If you do want short circuit protection on the 12V output, you might want to consider a current limiting circuit instead of just using resistors.
Thanks again for the info.
Yes I was planning on using the same input circuit for both sensors. The 3.3 volt sensor outputs an analog 0-3.3v signal. The 12V sensor outputs a 3.3V digital signal. Firmware on the microcontroller is configured to switch between analog input and digital inputs.
About what voltage level would the Zener start to mess things up do you think? I really only need up to 3 volts of analog.
Would it be better to use 2x signal diodes? Most people always recommend 2x 4148 diodes (one from ground to signal, one from signal to 3.3V). Would this be able to handle the 12V though?
I didn't think I needed to add an additional inline resistor since when the 12V shorts to the signal wire, it goes through those resistors first, which is essentially the inline resistor right?
I calculated a continuous short of 12V to ground, through 33 ohms to be 4.36 watts. I am using 3x 100 ohm, 2 watt resistors, for an equivalent ohm of 33, and equivalent wattage of 6, so this should be enough right?
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Would it be better for me to put the 3x resistors on the "SENSOR_ANALOG_OR_DIGITAL_READING" instead, and not have them on the "SENSOR_POWER_3.3V_OR_12V"?
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Actually, I take that back about moving the 3x resistors... the 12V could still short to ground and this would remove protection, so nevermind that.

So this is my final drawing so far, how does this look?

I added the inline 100 ohm, 1/8 watt resistor. Would definitely appreciate some feedback on this:
phono_plug_question4.jpg
 

ebeowulf17

Joined Aug 12, 2014
3,307
Thanks again for the info.
Yes I was planning on using the same input circuit for both sensors. The 3.3 volt sensor outputs an analog 0-3.3v signal. The 12V sensor outputs a 3.3V digital signal. Firmware on the microcontroller is configured to switch between analog input and digital inputs.
About what voltage level would the Zener start to mess things up do you think? I really only need up to 3 volts of analog.
Would it be better to use 2x signal diodes? Most people always recommend 2x 4148 diodes (one from ground to signal, one from signal to 3.3V). Would this be able to handle the 12V though?
I didn't think I needed to add an additional inline resistor since when the 12V shorts to the signal wire, it goes through those resistors first, which is essentially the inline resistor right?
I calculated a continuous short of 12V to ground, through 33 ohms to be 4.36 watts. I am using 3x 100 ohm, 2 watt resistors, for an equivalent ohm of 33, and equivalent wattage of 6, so this should be enough right?
Lots of good questions there. I'll see what I can do.

Regarding the Zener effect on analog accuracy, I don't know exactly where to draw the line, but there are tolerances on every spec, so I don't like to cut things too close. The datasheet shows that a nominal 3.3V Zener can have a Zener voltage as low as 3.13V, and that the current at the Zener voltage is 113mA. The transition isn't a brick wall, and it isn't linear, so I don't know how much current flows 0.13V below the Zener voltage, but I'll bet it's not zero.

So, what effect does that leakage current have on your measurements? This is where things get interesting. First off, without knowing the output impedance of your sensor, there's no way to know if tens or hundreds of mA leakage will impact the signal quality. It's better not to risk it if you're not sure.

Beyond that, even if you have a zero impedance signal source, you've got the question of current limiting resistors. If you had 113mA going through 33ohm resistance that would be 3.7V dropped across the resistance! Obviously that much leakage will wreak havoc on everything, regardless of whether the resistors are on the power or signal side.

I'd probably go with a 3.6V Zener initially and then do some experiments to check linearity of my signal as it approaches 3V.

Regarding your calculations, they all seem to check out. I must've miscalculated something last time. I will say that I've read/been told countless times to double the resistor wattage needed - not sure how important this really is, but it seems to be taken for granted around here. In that case you'd want 3W instead of 2W resistors, and maybe 2W instead of 1.5W Zener.

If you were willing to have separate 12V and 3.3V jacks, then you could move your current limiting resistors to the signal input on the 12V system, where they could be high resistance, low wattage items. On the 3.3V side you'd have basically nothing to worry about. I don't see how you're going to have the jack provide both 3.3V and 12V power anyway - seems like dedicated jacks would be easier all around.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Actually, I take that back about moving the 3x resistors... the 12V could still short to ground and this would remove protection, so nevermind that.

So this is my final drawing so far, how does this look?

I added the inline 100 ohm, 1/8 watt resistor. Would definitely appreciate some feedback on this:
View attachment 152569
The new resistor should move left so that it's between the R2 and D7 connections instead of before R2. As drawn, it's a voltage divider reducing your signal voltage (although if I've done the math right, it's only a 0.05% drop in signal, so the difference probably isn't critical!)

EDIT: Just noticed the resistor wattage. Double check me since I've already gotten this wrong once, but I think in a short circuit scenario the new resistor sees 6.525V (12V supply minus 3.3V Zener, divided proportionally between resistors) and 65mA, making ~424mW. Based on that you need at least 1/2W, maybe 1W if you believe the doubling rule.
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
P.S. At some point I crossed a line from answering what will work to describing what I think is easier, which isn't necessarily relevant. Feel free to ignore my comments on big rearranging and separating of jacks. As far as I can tell your plan will work as long as you make sure the Zener voltage is far enough away from your signal voltage, and that all your wattages have sufficient safety margin.

Hopefully ebp will weigh in again - I'm learning as fast as I can, but I'm still a noob compared to the experts here!
 

ebp

Joined Feb 8, 2018
2,332
As I said before, the knee of the voltage-current curve for true zeners is generally very rounded. I looked at a datasheet for an ON Semi 500 mW 3.3 V zener. The voltage for a reverse current of 1 mA is specified as 2.3 V minimum, 2.9 V maximum. It is completely unsuitable for voltage limiting a signal. Zeners rated for higher power will be worse (general rule - if you want sharp knee, use low-power types). My general assessment is that a zener will not work satisfactorily for the analog signal.

A moderate resistance in the signal line and clamping with signal diodes is generally a much better solution. If the series resistance cannot be tolerated, then more elaborate methods must be used, For analog signals a precision limiting amplifier (requiring a good voltage reference) would be typical. For digital signals, discrete bipolar or MOSFET circuits might be suitable.

Again, I can't make any better suggestions without data on the sensors.
 

ebeowulf17

Joined Aug 12, 2014
3,307
As I said before, the knee of the voltage-current curve for true zeners is generally very rounded. I looked at a datasheet for an ON Semi 500 mW 3.3 V zener. The voltage for a reverse current of 1 mA is specified as 2.3 V minimum, 2.9 V maximum. It is completely unsuitable for voltage limiting a signal. Zeners rated for higher power will be worse (general rule - if you want sharp knee, use low-power types). My general assessment is that a zener will not work satisfactorily for the analog signal.

A moderate resistance in the signal line and clamping with signal diodes is generally a much better solution. If the series resistance cannot be tolerated, then more elaborate methods must be used, For analog signals a precision limiting amplifier (requiring a good voltage reference) would be typical. For digital signals, discrete bipolar or MOSFET circuits might be suitable.

Again, I can't make any better suggestions without data on the sensors.
Awesome! Thanks for providing better data on the Zeners. I knew they could be bad in applications like this, but I didn't realize how extreme it was!
 

Alec_t

Joined Sep 17, 2013
14,313
Apart from protecting the microcontroller which does the reading, does sensor #2 also need to be protected from having 12V temporarily shorted to its data output?
How much current does sensor #2 draw from the 12V supply?
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Apart from protecting the microcontroller which does the reading, does sensor #2 also need to be protected from having 12V temporarily shorted to its data output?
How much current does sensor #2 draw from the 12V supply?
Yes. Sensor #2 can tolerate 12V being shorted to its data output... the problem is the microcontroller can't tolerate it. Sensor #2 uses 25mA at 12V. Sensor #1 uses 10mA @ 3.3V.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Yes. Sensor #2 can tolerate 12V being shorted to its data output... the problem is the microcontroller can't tolerate it. Sensor #2 uses 25mA at 12V. Sensor #1 uses 10mA @ 3.3V.
And again I'm tempted to recommend using some sort of active current limiting circuit instead of resistors for short circuit protection. Right now you've got 6W worth of resistors spec'd. With 33ohms at 25mA, your 12V supply is dropping over 800mV to <11.2V.

If you used a transistor based limiting circuit, such as a "current mirror," you could set a limit around double what you need (just for safety margin) at 50mA. If it's designed right, you'll have negligible voltage drop until you reach the 50mA threshold, and then the limiting circuit will kick in. With a 50mA limit, you'll have less than 1/2W to dissipate instead of more than 4.5.

Don't get me wrong - if your system works and you don't want to mess with it, I get that, but I thought I should mention the potential benefits of active vs passive limiting. Food for thought.
 
Top