Post History
The BJT is overkill and might have issues of its own (voltage spec, ESD etc) and you don't need to switch a lot of current either. Also a plain zener is too slow to help against spikes, you need a ...
#1: Initial revision
The BJT is overkill and might have issues of its own (voltage spec, ESD etc) and you don't need to switch a lot of current either. Also a plain zener is too slow to help against spikes, you need a TVS. Similarly with the optocoupler, it is overkill and in general just a last resort in case you suspect very bad conditions on-site (bad grounds etc). Additionally, an optocoupler turns into a useless waste of space when you use same grounds on the primary and secondary as in your schematic - it literally does nothing except adding BoM cost. Beware of the [Arduino optocoupler disease](https://electronics.stackexchange.com/questions/714850/what-is-arduino-optocoupler-disease)! The most standard way to do this is a simple voltage divider as in my answer here: https://electronics.stackexchange.com/a/756620/6102 Which is more or less identical to your 2) schematic so that's what I would use. It doesn't matter if it's a MCU or a hall effect sensor you need to protect. Simple, inexpensive, safe. Except you can use a much higher series resistor towards the MCU, the value is by no means critical but high resistance means better protection of the MCU pin in case of mishaps. Also consider that the Schottky diodes will have some forward voltage so you won't cap the signal level to exactly 3.3V but rather to 3.3V + V<sub>fwd</sub>. BAT54 got roughly 0.3V<sub>fwd</sub> so you should place it towards a +3V ref in case the exact voltage is important.
