1
\$\begingroup\$

I am trying to protect a +5V Digital Output pin from miswiring to +12V, using a Zener diode.

When I simulate a simple protection circuit, the zener clamps the voltage as expected:

Miswire to 12V Zener, no output pin in model

However this simulation assumes the digital output is in a high impedance state. It's possible that the microcontroller is on, and driving the digital output pin low. In this case, no current goes through the Zener:

Miswire to 12V Zener, model output driving low

In this case, the Zener is in parallel with the digital output sink CMOS, so it doesn't even turn on.

To get the Zener to turn on, I can put more resistors between the Zener and the digital output pin: Miswire to 12V Zener, extra resistor before digital output But the resistors end up dissipating more heat than the Zener, and I have to add so much resistance to keep the digital output in spec, that the Zener is almost useless.

I've read a lot of guides about using Zeners to protect digital I/O, and none of them mention the case where the digital I/O is driving low. How should I use a Zener in this situation? Or can I ignore the case where the digital I/O is driving low?

Circuit Simulation

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

The output cannot drive (sink, in this case) infinite current so it won't behave as your simulation with output low. But typically they can sink 10 or 20mA with a volt or less drop so the output will likely remain within the 0-5V range even with the zener diode doing nothing. The resistor will see more power dissipation, of course.

Also if there is no power on the microcontroller, then the current (with many microcontrollers) will flow through protection diodes to the Vdd rail. The output is only relatively high impedance for applied voltages in the range 0 to Vdd minus or plus some portion of a diode drop (the portion depending on how much you consider to be low leakage current as well as the temperature etc.).

\$\endgroup\$
1
\$\begingroup\$

Your 3rd circuit is correct. If you're worried about heat dissipation, replace the resistors with PTC self-resetting fuses. For example, 21 mA trip, 10 mA hold, 24 V max.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ PTC fuses are pretty awesome. I know Zeners are sometimes used to deliberately trip PTC fuses in an overvoltage scenario. When I said that the resistors are dissipating more heat than the Zener, what I meant was the Zener is expensive and useless since the resistors required for the "digital output low" scenario will basically solve the problem without the Zener. Same for the PTC fuse. I'm trying to understand how to solve the problem with a Zener, but all the solutions make the Zener irrelevant. \$\endgroup\$
    – Luminaire
    Dec 19, 2022 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.