Go Down

Topic: currrent limiting (Read 2622 times) previous topic - next topic

tim77777

Hi, I am using a pro mini, 5V 16MHz and am op-amp circuit that together draw about 30mA of current.

The power supply for the mini comes from a TRS socket in another device, 5v -Ring; 0v -shield. The tip feeds into an A/D convertor on that other device and comes from a PWM pin on the mini. So, when the mini is plugged into the other device via its TRS socket, the mini is powered, and provides a PWM signal to the other device.

However, when a plug is inserted into the TRS socket, the tip and ring are temporarily shorted out which brings the system down on that other device. I have put a resistor in series with the ring (150ohms) which limits the current and stops the other device shutting down, but it also drops the voltage to the pro Mini to 3.3 volts, as expected. And also drops the voltage to the op-amp circuit which stops it working properly.

At 3.3Volts does the pro-mini automatically drop back to 8MHz?

Any ideas about how I can fix this without redesigned the op-amp circuit?

PaulRB

#1
Jun 29, 2018, 09:08 am Last Edit: Jun 29, 2018, 09:19 am by PaulRB
No, the Pro Mini will not automatically drop to 8MHz. It may continue to work at 16MHz but there is no guarantee. Thr brown-out detector in the ATmega may just continually cause resets.

Using a resistor is not a suitable way of providing 3.3V power to the circuit.

Perhaps you should explain what the "other device" is and what is normally plugged into its TRS socket. Why does/did that not also cause a short?

ChrisTenone

Perhaps you should get a 3 volt mini. And an op amp that works at 3 volts as well.
What, I need to say something else too?

PaulRB

Perhaps you should get a 3 volt mini. And an op amp that works at 3 volts as well.
I don't see how that would avoid the OP's problem, Chris. There would still be a short circuit as the plug is inserted into the TRS socket. The OP tried to limit the short circuit current with a resistor, but that won't provide the Pro Mini with a stable supply, even if it is a 3.3V version.

tim77777

#4
Jun 29, 2018, 09:58 am Last Edit: Jun 29, 2018, 10:00 am by tim77777
the pro mini does seem to work ok at 3.3 volts, but maybe the 8mHz 3.3 volt version would be more reliable. The 3.3 volts with a resistor in series was just a coincidence relative to the resistor size required to limit to 30mA.

the opamp circuit is attached. How can I modify that to work at 3.3 volts. It is ok at 5 volts, but the amplitude from pin 7 is pulsating when operating at 3.3 volts.

The TRS socket is currently only used for this purpose, and for an analog potentiometer. The series resistor is not a problem for the potentiometer though.

Why won't the supply be stable with a resistor in series?

ChrisTenone

I don't see how that would avoid the OP's problem, Chris. There would still be a short circuit as the plug is inserted into the TRS socket. The OP tried to limit the short circuit current with a resistor, but that won't provide the Pro Mini with a stable supply, even if it is a 3.3V version.
You are right Paul. I had interpreted the problem as the voltage dropping from the resistive fix, and the op amp not working properly. I hadn't really considered the mini's current requirement, which is the real problem. Fixing the power glitch is surely the way to go.
What, I need to say something else too?

PaulRB

Quote
Why won't the supply be stable with a resistor in series?
Because the current drawn by the circuit won't be constant. It will vary from moment to moment depending on what the Pro Mini is doing. And because of Ohm's law, the voltage drop across the resistor will also vary.

PaulRB

#7
Jun 29, 2018, 11:51 am Last Edit: Jun 29, 2018, 11:59 am by PaulRB
I get why the short circuit was not a problem with the analog pot. The full resistance of the pot would have been between the jack's ring and shield, so 1K, 10K or whatever.


So this is the input to the Arduino's analog pin? And an Arduino PWM output pin connects to the mysterious "other device" through the tip of the TRS jack & socket?

Short-circuit issues aside, have you tested that the A/D input of the "other device" will accept the PWM signal? Normally some low-pass filter is required to change the PWM signal into an analog voltage to achieve that.

tim77777

Mysterious, ha :-).

Yes the input from an audio source goes through to A0 on a Pro mini, the frequency of the source is detected and written via analogWrite to an output pin. This gives a varying pulse width proportional to the frequency.


I have a series resistor and cap to ground after that, that changes the PWM to DC.

The varying DC is fed on to the tip of the TRS socket on the other device, read by an A/D, and used for .... mysterious purposes.
 

tim77777

Because the current drawn by the circuit won't be constant. It will vary from moment to moment depending on what the Pro Mini is doing. And because of Ohm's law, the voltage drop across the resistor will also vary.
I see. It seems to work OK. What sort of problems can I expect?


tim77777

You are right Paul. I had interpreted the problem as the voltage dropping from the resistive fix, and the op amp not working properly. I hadn't really considered the mini's current requirement, which is the real problem. Fixing the power glitch is surely the way to go.
Yes, after disconnecting the power to the mini only, the amplitude becomes stable. So, the op-amp is not the problem.

Even with the pulsating the application is still working though, I suppose because it is a function of frequency, and so the amplitude variation is not a problem. Though it will be in the future because I need to establish the input level at sometime for clipping and to cut out noise.

tim77777

It was in line with requirements to do things this way, but if I can't get a somewhat stable supply, the proMini will need to have its own supply, and that's out of line with the requirements. An additional external supply is not doable.

Even if I use a different type of jack to prevent the ring/tip short, there still needs to be some protective current limiting to stop a user shorting something.

Is there a way the regulated 5volt supply from the external device, can be made suitable?

wvmarle

Maybe you should indeed go to 3.3V for your Pro Mini (and run it at 8 MHz), but then using a linear regulator such as the AMS1117-3.3 which has short circuit protection built in (the current is limited to 1.1-1.2A).
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

PaulRB

#13
Jun 29, 2018, 04:14 pm Last Edit: Jun 29, 2018, 04:36 pm by PaulRB
Maybe you should indeed go to 3.3V for your Pro Mini (and run it at 8 MHz), but then using a linear regulator such as the AMS1117-3.3 which has short circuit protection built in (the current is limited to 1.1-1.2A).
Two reasons why not, I suspect:

The OP needs to avoid the short circuit in the first place. Even if the regulator protects itself, the Pro Mini and the op-amp circuit, the 1A+ surge could damage the mystery device, or cause it to shut off to protect itself. Also, could the jack tip touch 5V while the ring touches 0V? That would cause parasitic, reverse-polarity powering of the Pro Mini?

Secondly, I'm guessing the Pro Mini will be doing FFT, so may need to run at the full 16MHz rather than 8.

Here's a simple idea: put a dpst toggle switch into the circuit to isolate the 5V & 0V from the TRS socket. Plug in, then switch on. Switch off before unplugging. Or is that not sufficiently idiot-proof?

Can the mystery device be re-wired internally so that the jack tip is 5V and the ring is the a/d input? That might avoid the short circuit problem.

If not, and the toggle switch idea is not suitable, maybe something with a fet, that powers on the circuit once 5V is correctly connected?


tim77777

thanks for that.  Using Autocorrelation rather than FFT, so perhaps 8MHz would do.


Toggle switch. OK for me, but yes a user might muck that up, as could I occassionally.


I don't think rewiring would help, 5v tip, wiper on ring. or 5v on ring, wiper on tip, would still be shorted.

A FET. OK, sounds good. I don't know how to do that other than saying that when the tip shorts to the ring the FET turns on and provides 5 volts. It would also need to switch off when the ring and tip is shorted again when the plug is removed. Is that possible? and how?

Go Up