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.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top