...if you need a pull down or pull up it should be pace BEFORE the 4k7 ( where the transil sits )
WHY? What is the difference between putting the pull-down resistor
BEFORE the current-limiting 4k7 in that circuit versus putting the pull-down resistor
AFTER it?
The circuit in question is posted here:
https://www.eevblog.com/forum/microcontrollers/robust-microcontroller-input-protection/msg125866/#msg125866Also...
Why not just use a transistor instead? It would invert the signal, but handling that in the MCU's code is easy. It would offer reasonably good protection too. Here's an example circuit showing a +12V input and a GND input to an MCU (automotive environment):
You'll note the 1K resistor is AFTER the 10K because, quite honestly, I don't see why that 1K pull-down needs to be placed BEFORE the 10K. Again, if you could explain why, I would love to hear it.
Also, in terms of the
resistance value of the pull-down, it doesn't seem to matter too much. Here are circuit simulations for a 1K pull-down versus a 100K:
The smaller resistance value of 1K would probably have better noise immunity, but I don't see a significant difference in terms of that resistor being used to pull down the base in cases where the +12V input is floating. The purpose of that pull-down is in my linked PNG file above is to prevent unintentional switching of the transistor.