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.
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.
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?