Electrical – GPIO over voltage input protection

diode-clampgpioover-voltage-protectionvoltage-regulatorzener

I want to design a circuit that can protect GPIO of the microcontroller from high voltages.the GPIO connects externally to mechanical switch.

So my approach was to use zener diode to clamp the high voltages to the low acceptable voltage.My microcontroller can accept maximum of 3.7V on the GPIO.

So the GPIO that i want to protect, has a function of detecting falling edge interrupt. below is my circuit that i have implemented.

zener implementation

In the above circuit D1 is the zener diode with R10 is being its current limiting series resistance. R45 and C36 are part of the denouncing circuit.

So the idea is when someone gives higher voltage like 12V at TP12 and TP13 by mistake, it should clamp it down to 3.0V safely.

here is the datasheet of this zener diode Link

NOTE: R44 was to limit the current flowing through the external switch connected to TP12 and TP13 whenever the zener circuit is not mounted (i.e. R10 0 ohm and D1 not populated).

questions i have is…
Is this the correct way of protecting the GPIO? Have i implemented it
correctly?
what should i do to fix following problem?

problems i am facing…

  • The zener has leakage current and that's why when zener is in the circuit it
    draws 0.141mA through 10K and drops 1.4 V across 10k resulting in 1.9v on the
    GPIO, i want 3.3V ( VCC of the microcontroller) to appear on the GPIO. what
    should i do to fix this?
  • Also i selected 1K for zener so that it doesn't affect de-bouncing circuit
    much and also limits current through zener enough so doesn't exceeds its
    wattage limit.

    zener limit

    but if you look at the above image 5mA is what i should i allow through zener
    in order to get 3.0V. will i damage zener if i pass more current?

Best Answer

The MM3Z3V0T1G is designed to "regulate" to about 3.3v when 5mA is driven through it.

3.3v * 0.005A = 16.5mW typical quiescent dissipation. The package can dissipate a maximum of 300mW of power. 300mW/3.5v = ~86mA maximum sustained current.

To get 5mA to flow through it, R45 will need to be dropped from 10kΩ to ~0Ω because the supply voltage is the same as the regulation voltage... but then it will be impossible to drive the input pin low.

Try R45 = 220Ω and R10 = 0Ω. This should give >3v to the input when the switch is not active, and 3.3v/220Ω = 15mA through the switch when closed.

Reducing R45 and R10 will drastically negate the effects of C36 to "debounce" the switch. Either increase C36 or create a separate R-C filter after the zener.

Related Topic