cancel
Showing results for 
Search instead for 
Did you mean: 

How to protect GPIO input from voltages greather than 3.3V/5V being applied there?

genisuvi
Associate III

Hi, I'm using the stm32F207Z mcu for input/outputs digital processing. Mcu will also handle the Ethernet communications.

Our application will read logic levels from GPIO pins configured as inputs, but it is also able to write on other GPIO port configured as outputs.

Our application consists in a '0' level detection inputs and writing output levels for LEDs, relays, etc.. de/activation. Obviously NMOS transistors will be used with this outputs:

https://4donline.ihs.com/images/VipMasterIC/IC/INFN/INFN-S-A0012812997/INFN-S-A0012813698-1.pdf?hkey=6D3A4C79FDBF58556ACFDE234799DDF0

From the outside, our card interface could be seen as '0' detection and '0' writable card (a kind NPN inputs, NPN outputs "concept"). We can read '0' and we can also put '0' in order to close external input/output circuitry. The card reads GND and it also gives GND to the user attached circuits.

Said this, users must give 'GND' or "highZ" to the inputs. The inputs user's circuits should not put positive voltages here (neither negative), except by an user error. The problem I see here is when user's attached circuit VCC is V>3.3V/5V and user "puts" 12V, 24V, etc. node there (input pin) by error/mistake. As I have read in datasheet, pins allow less than 3.3V/5V (depends of kind of pin).

With the outputs is happening the same. The external circuit is connecting its GND reference node. It could be "receiving" any situation: "hz", '0', '1' from our card pin.. Sometimes user could be connecting the positive voltage node of its circuit instead its ground node. But nMOS maximum VDS value achieves up to 30V, so I don't panic about card elements damage if users puts 12V.. 24V by error on output pins.

I think the damage risk is at the input pins.

All right connected external input circuit:

0693W00000SvHHAQA3.png 

Error connection between user input circuit and our card:

0693W00000SvHL7QAN.pngNOTE: R2 = 600~1K2

Before considering optos devices as a solution, I would like to know how to give a protection against putting voltages greater than 3.3V/5V at input pins: fuses, TVS, zener...

  • Any suggestion? TVS, diodes, etc..
  • and how to define the correct parameter values?

Thanks in advance

1 REPLY 1
S.Ma
Principal

How about level shifters? Either mono or bidirectional, depending on toggling speed? Maybe a quick look at digikey?