Protecting PIC inputs from over-voltage

Status
Not open for further replies.

DSGarcia

New Member
I have an input signal that can be as high as 25VDC. I would like to read anything above about 2V as true and anything near 0V as false. How can I protect the PIC from the higher voltages (and possible voltage spikes)?
Thanks,
Dale
 
Just a simple series resistor to limit the current, almost all PIC inputs have protection diodes that clamp to the supply rails - there are odd pins that dont, so check the datasheet.
 
Nigel,
Thanks--a couple of points for clarification though. The data sheets do not indicate that higher voltages are permissible from what I can tell (VDD+0.3 max for the PIC16F688 for example); is it still safe? I presume that I calculate the current for the maximum expected voltage (25V), but that should also be enough current for perhaps 3 to 5V inputs--correct? I calculate 20mA maximum current at the maximum voltage would require a 12.5K resistor (this allows 2.4 mA at 3V); will this work?
Thanks,
Dale
 
You could use a resistor (around 10K) and a 4.2 or 4.7 volt zener diode if you want to be very sure.
 
picbits and picasm,
Thanks for the information. How do I connect the zener and could you recommend a part number?
Thanks,
Dale
 
input -> 10k resistor -> pic input
zener with stripe to pic pin and other side to ground.

Any small 4-4.7v zener will suffice
 
Thanks for the help.
Dale

You don't need a zener, the PIC is designed specifically just for a resistor - simply calculate the resistor value for a low current. If you have a 25V signal, as you mentioned, a 20K resistor would pass 1mA, a 200K would pass 100uA, through the protection diode to the +ve supply rail. Nice easy value, use a 100K resistor - it's not at all critical.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…