13

I have a Pi 3b+ in a MIDI foot controller and part of the I/O is a pair of expression pedal sockets. After, ahem, getting the tip and sleeve round the wrong way, they are working correctly now.

But, during testing, I disconnected one while the system was powered up and it shorted out the Pi, which is now dead. The circuit feeds 3.3 V to the ring, which is connected to the pedal potentiometer, and measures the voltage off the tip (connected to the pot's wiper). When the pedal is disconnected, the plug temporarily shorts the ring (3.3 V) to ground. So I added a 150 Ω resistor on the 3.3 V supply wire. But I don't know if that's enough, and I'm not game enough to try it without being fairly certain I won't destroy another Pi.

Is a current limiting resistor enough? If so, what value is "enough"?

Or do I need something more complicated to protect the Pi?

I don't know exactly how long the short lasts for, but it's well less than a second in practice.

Note: The circuit has an switch in the socket, so I can add a little bit of extra resistance when the jack is plugged in. That way, I can detect the "unplugged" state (ADC reads full 3.3 V) and max plugged voltage 3.1 V as separate states.

The solution I settled on was using a 470R current limiting resistor on the power going to the jacks. This is working just fine.

fret
  • 264
  • 2
  • 10

2 Answers2

14

How do I avoid a temporary short circuit from destroying the PI?

It's very easy really:

  • power down your Pi
  • alter the connections
  • power on the Pi again

Electronics are not hot-pluggable by nature, they have to be designed in a special way to be hot-pluggable. People start to forget that because many modern interfaces support hot-plugging, notably USB. In older times you would apply the procedure above if you needed to connect an external keyboard to your laptop.

If you want to design a hot-pluggable interface, you have two options:

  • make sure the connector prevents unwanted contacts and ensures the correct connect-disconnect sequence (as USB does)
  • make sure your device survives any possible connections in any sequence

The latter is how audio jacks are designed: amplifiers have current limitation so they can survive a short, and a headphone can handle 2x voltage if it gets accidentally connected between L and R instead of L/R and GND.

Current limiting resistors are often used in JTAG/UART/debug adaptors to make them hot-pluggable or at least more robust. Whenever such a resistor will be enough depends on the circuit you have designed.

Dmitry Grigoryev
  • 28,277
  • 6
  • 54
  • 147
5

If you short circuit the 3.3V rail to Gnd you will instantly kill the Pi.

Frankly anyone who connects a power rail to external circuitry (from the Pi or any other device) is just asking for trouble!

You can use the power rails to provide power to external circuitry with suitable care - which excludes a TRS plug which is practically guaranteed to cause a short - they are designed for audio (or occasionally video) signals. You should NEVER connect power on a live system - devices which are designed for hot plugging e.g. USB use special connectors to ensure safe connection.

No responsible engineer would connect a live power rail to use for logic connection without protection and would not use a TRS jack for power!

If you are powering an external circuit any series resistance will compromise its operation (unless the current is minimal). You DON"T put resistors in power rails.

No one can design your circuit for you, even if you published a proper specification.

Milliways
  • 62,573
  • 32
  • 113
  • 225