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.

Zener diodes to protect microcontroller inputs

Status
Not open for further replies.

deweyusa

Member
Hi

I have a question about protecting a microcontroller's analog inputs. I have a PIC that I'd like to use to measure an analog signal up to +5VDC. I was planning on using a standard voltage divider, consisting of two resistors in series, with the input going in the top of the upper resistor, a ground on the bottom of the lower resisotor, and a 3.3V zener in parallel with the lower resistor. The input to the controller would come from the node between the resistors:

**broken link removed**

Since the PIC can take a max of 3.6V on an analog input, and I've heard a lot of talk of the soft knee of most zeners, I was thinking of making the resistors equal in value, so the max the PIC would see in normal operation would be theoretically 2.5V (half the max input). It might serve to effectively lower the precision of the ADC's result a little, but would hopefully add a little protection to the circuit.

Now the question: I have seen a few app notes from Microchip that show a "typical" resistance to a PICs input in the range of 470K. However, I've seen many zener datasheets that show a "test current" in the neighborhood of 20mA. I'm assuming that is the amount of current it takes for the zener to kick in, and notice that many datasheets don't promise much unless you operate the zener at the test current.

If so, that would mean I'd need at least 20mA available from the input through the top resistor to divert through the zener to ground in a protection scenario, which, if I'm doing my math right, means half the input voltage drops over the top resistor, half the bottom one. This means at max input, 3.6V / 20mA = 180 Ω, which just seems dangerously small for a processor's input to me. Am I missing something? Would I want a further resistor to the right of the middle zener node, between the node and controller to limit current? If so, what would a safe range for it normally be?

Also, I've heard about these TVS devices as an alternative to a zener. But, I can't seem to ascertain whether they are made for sudden, ultra-high voltages (as in static spikes), or for continued slightly-higher than normal inputs (like someone hooking up +12V to an input designed for +5). Is a TVS made for sustained overvoltage conditions? Is that usually a concern in microcontroller input protection, or is static the main worry usually?

Thank you for your help!
-Josh
 
hi,
Whats the value of R1 and R2.??
The PIC analog input expects a source impedance of less than 10K in order to run at its optimum rate.
If you examine the datasheet for the PIC it shows two clamp diodes on the input.
One connected to +V and the other to 0V, IIRC these diodes can sink 20mA, which means if you have a source resistance that limits the input current, to say 10mA, due an over voltage, these diodes will protect the PICs input.
 
Most times, I have seen limiters built with two diodes clamping the input line to ± power and a series current limiting resister. In your case, I would use your zener to build a voltage source set to 2.6 v. That plus the diode’s forward drop will clamp at the maximum allowable voltage and still leave most of the operating range of the input in its linier range.
 
Hello all, and thank you very much for the help. Eric, you mentioned source impedance. Am I correct that you treat the positive and ground rails as the same node, then calculate impedance (in this case parallel resistance) between that node and the one between the two resistors and that is your source impedance?

-Josh
 
Hello all, and thank you very much for the help. Eric, you mentioned source impedance. Am I correct that you treat the positive and ground rails as the same node, then calculate impedance (in this case parallel resistance) between that node and the one between the two resistors and that is your source impedance?

-Josh

hi,
I would also consider the R1||R2 combination as the total resistance.
What range of source impedance are you expecting.?

EDIT: this image is based on the PIC's datasheet,
 

Attachments

  • AAesp01.gif
    AAesp01.gif
    28.8 KB · Views: 888
Last edited:
I'm afraid that's an unknown for me. I'm hoping to offer a general analog input for sensors...but I'm afraid I don't know what the majority of their source impedances will be. I know one of them is a simple potentiometer-like water level sensor that is 10K across its fixed terminals.

Am I also correct that by matching source to load, you will see 1/2 of the power transfer to the load? (Does that apply to AC only, or DC too?)

Thanks again
-Josh
 
I'm afraid that's an unknown for me. I'm hoping to offer a general analog input for sensors...but I'm afraid I don't know what the majority of their source impedances will be. I know one of them is a simple potentiometer-like water level sensor that is 10K across its fixed terminals.

Am I also correct that by matching source to load, you will see 1/2 of the power transfer to the load? (Does that apply to AC only, or DC too?)

Thanks again
-Josh
hi Josh,
The matching impedances is not an issue with the PIC's analog input as its impedance is very high so it will impose a minimal load on a source impedance of ~ 10K.

The point you have to consider is the sampling rate of the analog signal when the source resistance is high, if you want optimum accuracy you must give the PIC's internal adc capacitor time to charge/discharge to the 'new' signal level.

If the sampling rate and acquisition time is long when using a higher than recommended source resistance, adding a small value capacitor from the adc pin to 0V will allow the charge on the small cap to charge the the internal capacitor.

In cases where the source resistance is very high a common method is to use a non inverting amplifier between the signal source and the adc pin.
A OPA [amplifier] has a very high input impedance a low output impedance.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top