6
\$\begingroup\$

I have a pogo connector with +8.4 V/GND/SDA/SCL. I would like to protect my microcontroller from overvoltage (+8.4 V could potentially touch SDA/SCL). I tried this circuit:

Enter image description here

But the thing is: There is only 2.4 V on the I²C pin with this circuit, while 3.3 V without. The circuit is working great, but 2.4 V for a high level is out of the spec of the esp32-pico-d4 I'm using (2.475V minimum). How can I modify the design/components to have almost 3.3 V on the GPIO pin (when it's high) and a precise voltage clamping?

I looked at many questions about overvoltage protection on Stack Exchange, but I didn't find a solution to my issue.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Be aware/wary of switching time (and capacitance) of the diode. "Shouldn't" matter for I2C too much (it's relatively slow), but worth noting in general. \$\endgroup\$
    – TLW
    Feb 9, 2022 at 1:44

6 Answers 6

10
\$\begingroup\$

How can I modify the design/components to have almost 3.3V on the GPIO pin (when it's high) and a precise voltage clamping ?

Zener diodes are not as perfect as you might probably think. Even below the zener voltage they will still conduct some current and, due to the pull-up resistor (4.7 kΩ) not allow the full 3.3 volts to appear on your I2C pin. You might fare better if instead of a zener diode you used a Schottky diode from I2C pin to your local 3.3 volt rail i.e. across your 4k7 resistor: -

enter image description here

This will restrict the I2C voltage to about 3.6 volts or maybe 3.7 volts by returning excess current injected through the 330 Ω resistor to the power rail. This relies on most chip's abilities to withstand a slightly higher voltage on their IO pins than their supply rail pins. It's common practise but will only work if your I2C interface chip has this "excess" ability.

\$\endgroup\$
8
  • \$\begingroup\$ Thank you so much for your answer. I will try this circuit as soon as I receive some schottky diodes. I was suspecting my zener diode to leak some current but I was not sure. I read everywhere that they are not ideal but I wanted to test a simple circuit to feel how simple overvoltage protection work and its limits. About the ability of my board (Tinypico with esp32) to withstand slightly higher voltage on I2C, I will check that. Thank you very much for the diagram ! \$\endgroup\$ Feb 9, 2022 at 9:01
  • 1
    \$\begingroup\$ @AyubowanPro please take the 2 minute tour to understand the motivation behind folk giving free help. \$\endgroup\$
    – Andy aka
    Feb 9, 2022 at 9:02
  • 2
    \$\begingroup\$ Putting a zener diode between +3.3V and GND would give some extra protection. Otherwise this relies on something else in the circuit to sink the 15 mA clamp current. \$\endgroup\$
    – jpa
    Feb 9, 2022 at 9:47
  • \$\begingroup\$ @jpa I'm glad you mentioned that and, if the OP gave more information about the threat and their internal power supply regime I will endeavour to clarify that point more. \$\endgroup\$
    – Andy aka
    Feb 9, 2022 at 9:57
  • \$\begingroup\$ With your circuit design, is it better to connect the schottky and the 4,7k resistor to a 3.3V LDO (I have one on the PCB I'm designing) or to the 3.3V internal regulator of my board (Tinypico) ? \$\endgroup\$ Feb 9, 2022 at 10:42
10
\$\begingroup\$

Zener diodes below about 5v are really terrible and pass significant current below their zener voltage.

This chart for a typical small zener diode (BZX84) shows how soft the "knee" voltage is for the low voltage zener diodes in comparison to higher voltages. The 6.8V device has a fairly sharp turn-on whereas the 3.3V version hardly has any knee" at all.

(Note the graph uses a log scale for the y-axis which expands the low current characteristics).

The 3.3V diode on this chart passes about 100uA @ 2.4v

Zener diodes above about 6V operate by a different mechanism called the avalanche effect and exhibit much closer to ideal operation. I personally, never use zener diodes below that 5-6v.

Another undesirable characteristic of low voltage zener diodes is their very high capacitance - the BZX84 3.3v device has 450pF of capacitance. This high-level can badly affect circuits like I2C protection. Other approaches using a schottky diode to a supply have much lower capacitance.

enter image description here BZX84 Datasheet

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Thank you very much for the graph. I didn't know that low nominal voltage zener diodes let pass too much current in the undesired direction. Very interesting ! I will use your advise of not using zener below 5V. Moreover, I know understand why I see many people use them at 5V and above and not so much at 3.3V lol \$\endgroup\$ Feb 9, 2022 at 9:11
3
\$\begingroup\$

You have a 3.3 V supply and a 3.3 V Zener diode, with a resistor between them.

Therefore the voltage across the resistor would be 0 V and no current can flow. So it cannot work as you intended because the parts don't work as you imagine.

There is a misconception of Zener diodes as 'magic voltage drops'. Actually, they are a linear part with a set of characteristics, specified in their datasheet. The actual behaviour of the Zener must be designed for, not the imaginary voltage drop.

So you need a different circuit completely.

\$\endgroup\$
1
  • \$\begingroup\$ You are right. I struggle to simulate in my mind the circuit. It is difficult for me to know what is the voltage at each wire and where the current flows. I was aware of the non ideal zener diode characteristics but I still have difficulties to apply them in reality. \$\endgroup\$ Feb 9, 2022 at 9:30
1
\$\begingroup\$

How about a bi-directional level shifter with equal levels?

This setup is used for different voltages on a i2c bus, but I think it should work for 3v3 to 3v3 as well (but I have not tested this). The mosfet should be able to withstand 8v4 on the connector side, and follow the signal otherwise.

https://assets.nexperia.com/documents/application-note/AN10441.pdf

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1
  • \$\begingroup\$ Very interesting circuit here. Thanks ! If other members tell it will work, I will try it. \$\endgroup\$ Feb 9, 2022 at 14:39
0
\$\begingroup\$

Here's one (terrible) approach:

enter image description here

It's essentially an ideal diode connected from the output to 3.3v, and an input resistor so it doesn't sink "infinite" current.

Major issues with this approach:

  1. It requires a matched pair of transistors for the current mirror. (You can get dual packages with 2 matched transistors.)
  2. It requires a fair few components.
  3. Although this works at low frequencies, the transient response is terrible. You can mitigate this by adding a (Schottky) diode clamp in parallel with the FET, but this doesn't remove transients, just reduces their length.
  4. As the FET has a finite resistance, the output does increase with high voltages, just slowly. You can mitigate this by increasing the resistor, but:
  5. Your output impedance is terrible (3.3k, in this example). This mainly becomes an issue at higher frequencies. You can mitigate this by decreasing the resistor, but see 3 and 5.
  6. At high voltages you start dissipating a fair amount of power across the resistor. You can mitigate this by increasing the resistor, but see 4.
  7. You have a fair bit of loading on the output, which further slows/distorts signals.

(You can of course do essentially exactly the same thing with an op-amp instead, although beware bandwidth.)

(You can also do something similar with an ideal diode, although, again, beware bandwidth.)

...that all being said, just use an isolator. It's easier. (Unless you're doing this in volume, in which case it's not the cheapest option.)

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thank you for your design. I will try to understand it with its limitations. \$\endgroup\$ Feb 9, 2022 at 9:33
-2
\$\begingroup\$

2.4 V for a high level is far too low in my opinion

Why does your opinion matter here? The only "opinion" that matters is the datasheet for the device you're connecting to. Nothing else is important.

As a quick reference, I grabbed the datasheet for the TI OMAP-L138 microcontroller I'm currently working with. For a 3.3V supply, logic-high on the inputs is 2.0V minimum and logic-low is 0.8V maximum. Your input with 2.4V for logic-high would be rock-solid reliable.

That said, your circuit may not give 2.4V reliably, because Zeners are not a brilliantly linear component. You'd need to look at their curves with tolerances and over different temperatures to be sure of whether 2.4V is a best-case or worst-case.

I'd also add that your protection circuit should cover the input going below 0V as well. You may think that this couldn't happen, but if you're in any kind of industrial environment then this isn't a safe assumption.

\$\endgroup\$
5
  • 2
    \$\begingroup\$ People's opinions and experience are intrinsic in most decision making, deliberately or otherwise. That's natural. All of your four paragraphs are citing your opinion or interpretation. \$\endgroup\$
    – TonyM
    Feb 9, 2022 at 14:31
  • 4
    \$\begingroup\$ In the esp32-pico-d4, high level requirements are : VDD + 0.3V max and 0.75 * VDD min. In my case, VDD is equal to 3.3V. So, high level must be 2.475V min so 2.4V is out of spec. \$\endgroup\$ Feb 9, 2022 at 15:36
  • \$\begingroup\$ @TonyM None of your statement is correct, I'm afraid. The voltage levels required for high/low logic level inputs are not subject to opinion or interpretation. I gave one example I had access to; as I said, the OP needs to check the datasheet for their device. Experience can help to add additional tolerances which may not appear on the datasheet (e.g. EMC), but this is not an "opinion" either. \$\endgroup\$
    – Graham
    Feb 9, 2022 at 15:40
  • 2
    \$\begingroup\$ @AyubowanPro Fair enough. You could improve your question by saying what your actual thresholds are then, because that's a specification, not an "opinion". :) \$\endgroup\$
    – Graham
    Feb 9, 2022 at 15:41
  • 1
    \$\begingroup\$ Sorry, not matching the words. (pg1) pure opinion (pg2) used TI OMAP-L138 because thought it would match but doesn't (pg3) "circuit may not give" (pg4) speculative opinion. Unfortunately your comments read like you'll not be budging but the first (pg1) sets the rest up for a fall. Without that and the guessing of (pg2), you'd have a reasonable answer. Anyway, no harm done, I'll leave you to it. \$\endgroup\$
    – TonyM
    Feb 9, 2022 at 16:21

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.