Overvoltage protection on input

Thread Starter

jwfx

Joined Jan 15, 2025
13
I am designing an input to a microcontroller that connects to an open collector output on another device (both devices share a ground):
1746533844051.png
GPIO is connected to one of the GPIOs on a RP2040 (3.3V-tolerant). My device doesn't need to source a specific amount of current - just enough so I can detect the state.

I'm trying to add protection for overvoltage and also ESD/surge (it may be a long wire run between the devices). For ESD/surge, I've used the SMF3.3 which appears to be rated for the job (datasheet):

1746534178452.png

For overvoltage, the maximum I need to support is 12V being connected instead of the open collector. I found the Ruggeduino uses a zener diode and PTC fuse to implement overvoltage protection like so:

1746535082841.png
But the specifications of their PTC fuse seem a bit unusual (or at least I can't seem to source an equivalent on LCSC): 220 ohm cold resistance and 30mA trip current (annoyingly they don't offer a specific part number).

The best I can find on LCSC is the PRG18BB101MB1RB (datasheet) which is 100 ohm cold and 300mA trip current. This would possibly still be workable but I'd need a 1.5W diode which is a bit large (especially when I have 2 copies of this whole schematic).

Can anyone please suggest an alternative to this setup or some alternative parts? I'm ordering the PCB from JLCPCB so parts need to be available from there ideally.

Also if anyone has any other suggestions for input protection I'm all ears :D

Thanks!
 
Last edited:

Ian0

Joined Aug 7, 2020
13,097
1. put a schottky diode in series with R1. That stops the 12V feed in current back into the 3.3V supply.
2. put a resistor (can be quite large, say 4.7k) between The end of R1 and the GPIO pin. This prevents you forming an attenuator along with the pull-up resistor, as that will reduce your noise immunity.
3. move the zener to the other end of the resistor, so that the resistor protects the zener from 12V.

(sorry, no diagram, as I’m passing time in Schiphol airport, and don’t have anything on which to draw it)
 

MisterBill2

Joined Jan 23, 2018
27,164
For a solid input protection clamp, use two diodes in series, reverse biased, between the 3.3v source and common, then feed the GPIO from the junction. Then have a 100 ohm series resistor to the external input. Or use a 1000 ohm resistor if the input connection is really high impedance, such as CMOS. That scheme will survive 12 volts very well. I used 1N4001 diodes, good for one amp.
 

Ian0

Joined Aug 7, 2020
13,097
For a solid input protection clamp, use two diodes in series, reverse biased, between the 3.3v source and common, then feed the GPIO from the junction. Then have a 100 ohm series resistor to the external input. Or use a 1000 ohm resistor if the input connection is really high impedance, such as CMOS. That scheme will survive 12 volts very well. I used 1N4001 diodes, good for one amp.
The only snag is that 12V on the input would cause 87mA to flow into the 3.3V supply. If the loading on the 3.3V supply is less than 87mA, and is supplied by a series regulator (or non-synchronous buck) then the voltage of the 3.3V supply could be raised as high as 11.3V.
 

panic mode

Joined Oct 10, 2011
4,864
For a solid input protection clamp, use two diodes in series, reverse biased, between the 3.3v source and common, then feed the GPIO from the junction.
i do not like that type of protection because just about every regulator supplying that 3.3V rail is a series regulator and any devices designed to operate on 3.3V have very tight supply voltage tolerances. problem with series regulators is that they cannot clamp rail voltage in case of disturbance. so in case someone wires things wrong externally (for example input touches 12V or 24V rail), that protection diode will get 12 or 24V on 3.3V rail. not only will this not protect the input but it will cause massive number of casualties among anything connected to 3.3V rail....

Edit... i see Ian0 beat me to it.
 

Thread Starter

jwfx

Joined Jan 15, 2025
13
1. put a schottky diode in series with R1. That stops the 12V feed in current back into the 3.3V supply.
2. put a resistor (can be quite large, say 4.7k) between The end of R1 and the GPIO pin. This prevents you forming an attenuator along with the pull-up resistor, as that will reduce your noise immunity.
3. move the zener to the other end of the resistor, so that the resistor protects the zener from 12V.

(sorry, no diagram, as I’m passing time in Schiphol airport, and don’t have anything on which to draw it)
Thanks! I'm not too sure which zener you're referring to in step 3 - is this what you're suggesting?
1746541789145.png
 

panic mode

Joined Oct 10, 2011
4,864
i prefer to have galvanically isolated I/O. this allows most flexibility when wiring to different circuits.
but if you do not care about that and still want protection, the simplest option is to reduce current (increase resistance). this will clamp wide range of interference signals (positive or negative) to a safe level without affecting circuit performance or causing failures or delays to work again.

1746541691248.png
 

panic mode

Joined Oct 10, 2011
4,864
that is bad. if "their device" is miswired, it will damage your circuit. for example common types of errors are wrong polarity or wrong voltage...

imagine 12VDC instead of open collector from "their device". your D1 (SMF3.3) will be smoked instantly, and after that input will be the next casualty.

imagine they reversed polarity, same will happen, since C1 is now forward biased abd current will be even larger.

to protect your protection devices you MUST use resistors or similar to limit the current to safe levels.

this would be MUCH better...
if "their device" is 12V, R2 will limit fault current and save D1.
and D1 that is not destroyed will easily protect GPIO.

even if polarity is reversed and input is -12V, D1 and GPIO are protected.
1746542344004.png
 
Last edited:

Thread Starter

jwfx

Joined Jan 15, 2025
13
i prefer to have galvanically isolated I/O. this allows most flexibility when wiring to different circuits.
Sadly I can't easily provide galvanic isolation as there is also a full duplex RS-232 connection between the devices (which seems like a pain to provide isolation for).

that is bad
I know the schematic I posted in #6 isn't right, I was just trying to draw the circuit I thought Ian0 was describing (sounds like I've misunderstood his instructions).

With your schematic from #7, I guess the TVS diode would go here?
1746542623297.png

I think I like your schematic from #9 the most, not sure why I didn't think of just connecting it like that in the first place. Is D2 even needed at that point? If the reverse voltage of D3 is exceeded I think there are bigger issues haha.
 

panic mode

Joined Oct 10, 2011
4,864
post #3 was suggesting something like this. the problem with this is that it only work for stouces that have low impedance or circuits that are sufficiently low impedance (current draw is greater than fault current).
in typical circuit using series regulator, this is not the case so this does not work well. fault current in this case could be huge - much greater than current draw of the MCU itself. so MCU would be powered not by own supply, but by fault current getting to "3.3V" rail through input resistor and upper diode. if input is negative lower diode would clamp the input voltage to -0.7V and for most ICs this is survivable.

1746542813059.png

you keep ignoring advice. you NEED series resistor to limit the current. preferably large value resistor (so that fault current can be smaller). to see the problem, forget about CORRECT connections, analyse what happens when "they" miswire things and do something like in image bellow. this WILL destroy both diodes... congratulation, your protection FAILED. your device is DEAD. that would not happen if you used one of circuits from posts #7, #8, #9.
1746543286397.png
 
Last edited:

Thread Starter

jwfx

Joined Jan 15, 2025
13
you NEED series resistor to limit the current. preferably large value resistor (so that fault current can be smaller).
I apologise - I didn't intentionally leave off the current limiting resistor. I do realise I need one in series with the input to limit the current (I meant to match your diagram in #7 but missed it when recreating it in KiCad).

Set up like this:
1746544277775.png

With -12V connected (i.e. overvoltage + incorrect polarity), current will flow this way:

1746544677545.png

It's only ~15mA in the worst case (15.3V across 1k), but as you said the voltage ends up clamped to -0.7V which is out of spec for the RP2040 (it has an absolute maximum of -0.5V). Admittedly the RP2040 would probably be fine, but it'd be nice if there was a solution which didn't put the GPIO at negative diode drop.

With 12V connected (i.e. overvoltage), the TVS diode clamps first as it has the lowest breakdown voltage, which I don't think I want (it doesn't have a rating for continuous current, even if it's only 12mA):

1746545421574.png

I guess the solution to this is to use a D2 with a lower breakdown voltage than D1.

Here's a simulation which shows the above: https://www.falstad.com/circuit/cir...VBM31pGrMlmyGrZqKBilFMB5AHthMZhKjiPwkDAIOC2EA

Please let me know if I've said anything wrong.
 

panic mode

Joined Oct 10, 2011
4,864
excellent....

i think you got it...;)

most MCUs also have option to use internal weak pull-up. this may be in 100k. using external pull-up is always an option too but the value is something you get to choose. for example those resistors in protection circuit do not need to be 1-5k, you may use 22k, 27k etc. and it will work the same way but the fault current (if miswired) would be reduced even more. i would also check the power rating of the resistors to make sure you are in the clear for tolerable voltage range. for most automotive and industrial uses 30V is a very reasonable limit.
30V*30V/22k = 41mW. so even 0.1W SMD resistors will do fine even is error is continuous.
too high resistance is not good as noise immunity goes down (circuit picks up interference).
 

Thread Starter

jwfx

Joined Jan 15, 2025
13
Thank you! I am going to stick with the lower value resistors as I'd prefer there be a bit of a current going through the open collector (it's usually controlling an LED, so having more current flow through it feels like a good idea).

It seems like a lot of diodes, but I think this is what I'm going to go with:
1746549903764.png


When the input is >3.3V, the current is is sunk from the input through D2 which has a typical breakdown voltage of 3.3V (lower than D1 and D3), putting GPIO at 3.3V.

When it's <0V, it is sourced from GND through D1 which has a forward voltage of 400mV at 10mA (lower than D2 and D3) to the input, putting GPIO at -400mV.

Here's a simulation showing the above: https://www.falstad.com/circuit/cir...fIFwrFbN1Kz48kgxq5tI5UDYAHsFMImpBiBokDAIDc2EA

This seems like the ideal setup, thanks for the help all!
 

MisterBill2

Joined Jan 23, 2018
27,164
The only snag is that 12V on the input would cause 87mA to flow into the 3.3V supply. If the loading on the 3.3V supply is less than 87mA, and is supplied by a series regulator (or non-synchronous buck) then the voltage of the 3.3V supply could be raised as high as 11.3V.
That could certainly happen if no system to clamp the 3.3 volts was not included. Good point.
 

Ian0

Joined Aug 7, 2020
13,097
That could certainly happen if no system to clamp the 3.3 volts was not included. Good point.
Normally the fault current is small in comparison to the current from the regulator. Then one day a mystery fault appears.
After some measurement with the scope. . .
. . The supply voltage keeps increasing over 3.3V. My 3.3V regulator is faulty. Replace it . .
. . the new one is also faulty. Must be a bad batch, , ,
somewhat later. .. .But it only fails when the external input is connected,
eventually . . . wrong clamp circuit on the external input.
. . bodge it with a resistor across the 3.3V supply and a big capacitor until I get chance to redesign the board.

Been there. Done that.
 

MisterBill2

Joined Jan 23, 2018
27,164
Normally the fault current is small in comparison to the current from the regulator. Then one day a mystery fault appears.
After some measurement with the scope. . .
. . The supply voltage keeps increasing over 3.3V. My 3.3V regulator is faulty. Replace it . .
. . the new one is also faulty. Must be a bad batch, , ,
somewhat later. .. .But it only fails when the external input is connected,
eventually . . . wrong clamp circuit on the external input.
. . bodge it with a resistor across the 3.3V supply and a big capacitor until I get chance to redesign the board.

Been there. Done that.
OK, I had not considered the power supply as being a problem, but certainly there could be an issue from a high current voltage being connected. The power supply could have a shunt diode string that will conduct as the voltage exceeds 3.4 volts. In addition, the input series resistor could be a low wattage one that fails like a fuse. AND, of course, since the monitor circuit is high impedance, the series resistor can be a higher value to limit the current without much voltage drop. Adding the shunt diodes string, perhaps five 1N4001 diodes with the 0.7 volt forward conduction drop, could clamp at 3.5 volts in theory. Some experimenting would be required, it might only need four diodes.
 
Top