Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I/O Pin Over Voltage Protection

Status
Not open for further replies.

stolzie

New Member
Hi All,

I am looking into an application where I need to protect my 5V PIC pins from customers connecting incorrect voltages to them e.g. 12V to 24VDC

I was looking at using transil's for the application (DAS108S1 from ST), but I am not to sure whether they would be suitable for the job or not. Does anyone else have any other suggestions on how to protect the pins?

Thanks for your input.

Stolzie
 
Assuming that they are input pins, then you could use a current limiting resistor (say 1k) from the input to the pin and a 5.1V zener from the pin to ground. If someone connects 24V then (24-5)/1000 = 19mA will flow.

If it's not input pins then a little more info would be useful.

Mike.
 
Pommie isn't thinking PIC!, you only need a series resistor to protect PIC input pins, as they already include protection diodes. Simply calculate the resistor based on the voltage and the maximum current you want to flow in the protection diode - bear in mind you need VERY little current for a PIC input, so the resistor can be fairly large.

If it's an ouput pin, and you connect an external supply to it, even if it's only 5V, you're likely to kill the PIC.
 
Nigel, I would have given the same answer as yourself a few weeks ago, but since looking at the max voltage allowed on a digital input in the DC characteristics table of the data sheets and finding it to be Vdd, I now believe the protection diodes are only there to suppress transient spikes and should not be relied upon to clamp higher voltages.

I commented in this thread my confusion as to the purpose of the protection diodes.

Mike.
 
Pommie said:
Nigel, I would have given the same answer as yourself a few weeks ago, but since looking at the max voltage allowed on a digital input in the DC characteristics table of the data sheets and finding it to be Vdd, I now believe the protection diodes are only there to suppress transient spikes and should not be relied upon to clamp higher voltages.

Check the MicroChip application notes, one even feeds mains through a resistor directly to an I/O pin - I think you're misinterpreting the datasheet specifications!.
 
Resistor alone without either zener or diodes will cause damage to PIC GP3 or RA5 or RE3 pin when configured as input pin and when an overvoltage is applied.

Like Pommie, I would design the circuit to make sure no current would flow in any of the PIC internal protection diodes, at all times.

For nasty input, I would use a series resistor with two schottky diodes from input pin to both Vdd and Vss.
 
eblc1388 said:
Resistor alone without either zener or diodes will cause damage to PIC GP3 or RA5 or RE3 pin when configured as input pin and when an overvoltage is applied.

You obviously have to be aware of special case pins, as with anything else, but a simple resistor is a perfectly acceptable technique, frequently used in the MicroChip application notes.

If you're going to start ignoring the facilities MicroChip build-in for you, you may as well go back to micro-processors rather than micro-controllers?
 
Can you explain why Microchip state the max voltage on a digital input is Vdd and on an analogue input is Vdd+0.6

Mike.
 
Pommie said:
Can you explain why Microchip state the max voltage on a digital input is Vdd and on an analogue input is Vdd+0.6

No, except that as the digital input is 'digital' there's no point going higher than Vdd, and as an analogue input is 'analogue' it can vary apart from being just 0 or 1.

Not to mention that datasheets aren't exactly reknowned for their lack of errors :)
 
Thank you all very much for the replies!

From what I have gathered from the posts is that, I need a resistor in series with the input pin of the pic (excluding special pins where I will need a zener diode to protect them) and for output pins if an external voltage is connected to it bye bye pic!

So output pins will have to be protected with an opto coupler arrangement.

So here is the good question, what if the pin serves as both either an input or an output? Can you protect them or do they have to have a specific state either input or output?

Thanks

Stolzie
 
The resistor/zener combo will still work, but your output current will have to be very low.

An alternative if you only need logic levels without any significant current, is to keep the pin as an input with a 200k resistor from the pic to ground and a 1k to the external input. Now, by switching the week pullups on you will output a logic high. Turn them of and the 200k resistor will pull it low. :D Edit, I should add, this is really only useful on chips like the 12f509 pin GPIO3 which is input only. Turns an input pin into an output - magic.

Mike.
 
Last edited:
Pommie said:
An alternative if you only need logic levels without any significant current, is to keep the pin as an input with a 200k resistor from the pic to ground and a 1k to the external input. Now, by switching the week pullups on you will output a logic high. Turn them of and the 200k resistor will pull it low. :D Edit, I should add, this is really only useful on chips like the 12f509 pin GPIO3 which is input only. Turns an input pin into an output - magic.

Mike.

Well that is a very handy trick to know! Thanks for the info.

Cheers

Stolzie
 
stolzie said:
Thank you all very much for the replies!

From what I have gathered from the posts is that, I need a resistor in series with the input pin of the pic (excluding special pins where I will need a zener diode to protect them) and for output pins if an external voltage is connected to it bye bye pic!

So output pins will have to be protected with an opto coupler arrangement.

So here is the good question, what if the pin serves as both either an input or an output? Can you protect them or do they have to have a specific state either input or output?

You really need to be more specific about EXACTLY what you want to do, by correctly designing the circuit for how it's going to be used it will normally take care of any 'protection' problems. Outputs are rarely a problem anyway, as there 'should' be nothing feeding into them - check the hardware extras section of my tutorials for some examples.

If you do something stupid (like connecting an output pin to Vdd or Vss), there's a slight chance of damaging the PIC, but they are really VERY sturdy devices.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top