Electronics > Projects, Designs, and Technical Stuff

PIC Input Protection using a Zener Diode

(1/4) > >>

I want to protect a few PIC inputs from accidental connection to high voltage (12 volts). The PIC will be running 5 volts and the ADC inputs will be connected to some sensors and have a normal voltage of around 2 to 4.8 volts. There will be a 1K resistor between the PIC pin and the outside world. I wanted to toss a 5.1 volt zener from the PIC pin to ground but I was surprised when the zener affected the circuit when operating within the normal range and it restricted the input to around 4.6 volts.

This is the device I am using for the testing 1N4733A http://www.datasheetcatalog.com/datasheets_pdf/1/N/4/7/1N4733A.shtml

Since the only voltage I am concerned about would be 12 volts which would be connected to the PIC through a 1K resistor I am thinking that the built in I/O protection could probably handle it but I was wanting to add something a bit more bullet proof.

Any suggestions?


That makes sense.

The zener starts to conduct at low currents, and will maintain close to 5.1V.  I think there are circuits around online for doing this if you search for zener diode overvoltage production.

Zener diodes are not ideal devices.
If you're using a quite high resistance in series (so you impose low current) the zener voltage will settle at a lower voltage.
Look at the picture, I hope it is clear.
EDIT:(In practice, I'm saying the same thing as allanw)

This is one possible circuit to protect your PIC. I have used a 5.6V zener diode, not a 5.1V. It all depends on your supply voltage stability and level. The data sheet maximum voltage for most 8bit PICs is VDD + 0.3. So if your supply is a rock solid 5V then this gives you 100mV clearance with the 5.1V zener. Three possible problems : -

5.1V might be a bit close to your operating voltage, if this swells to over 5.1V or you have a switching transient that takes it up there the zener will conduct as much current as it needs to in order to get the voltage back down to 5.1V this current will be coming out of your PIC. If you are sure your supply is 5V or under always then you can go with the 5.1V zener. I would get my supply down to 4.9V to use the 5.1V zener. And be using a linear regulator and a fair bit of capacitance near the PIC.

The next problem is not all zeners were made equal. Their voltages start off a bit off and then drift a bit with time and temperature. I am informed that the 5.6V zeners are the most accurate due to the physics of how a zener diode is created.How much truth there is to this I am not sure.

Finally a zener diode only settles down to its final reverse bias voltage when a certain amount of current is flowing through it. So if you just bang 12V on the protected node then there is no problem. A small transient will occur that your PIC should survive. If you only apply 5.9V for instance however, then the current in the zener diode is very small and it may not clamp the voltage as expected.

Any way because of a combination of these, I would if possible take VDD up to 5.3V and use the 5.6V zener. Provided that everything you are connecting to can survive 5.3V. Good luck!

As a small aside, did you know you can connect 240V mains AC to your PIC pin configured as a digital input? All you need is a 10M ohm resistor between your PIC and the mains and it survives! I've seen it! This can be very handy indeed for applications where synchronizing to mains is necessary. When the mains is positive the pin is read as a 1 when the mains is negative the pin is a zero, all the usual as regards interrupts etc obviously apply.


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod