Electronic – How to make an io pin 12v tolerant

bufferlevel-shiftingopto-isolator

I've seen plenty of 3v3 circuits that are 5v tolerant, but I'm wondering if I can make something that is 12v tolerant. Basically I have a numato 128 gpio expander and there are so many wires that one bad connection can blow a pin. I would like to make it so that any pin can turn 3v3 on and off or be an input but if 12v accidentally touches the pin I don't want it to blow up. The best I can come up with is possibly an optoisolator or a buffer like the cd4050. I'm having a hard time wrapping my head around how these parts work since I have never used them. Does this make any sense? Am I on the right track?

Best Answer

If you don't need the 3v3 GPIO to drive something with large current, but just use them as voltage outputs, you can simply add a 10k resistor in series for each pin to ensure that the internal IO expander clamping diodes don't get burnt out when 12v are applied. Then you can usually connect a pin to a higher voltage for a short time without adverse effects ((12-3v3)^2/10k = 7.57mW on the clamping diode).