# Driving MCU input from +24V signal with zener and mosfet

I've designed a circuit to drive a +5V MCU input from a +24V signal that I believe would work, but looking at other examples it seems like MOSFETs aren't frequently used for this purpose. My primary goal with using +24V is that it's the input voltage for other functions on my board, so its readily available, and using a higher voltage on limit switches is useful for preventing false triggering. The basic idea is to use a zener diode on the gate of the MOSFET to prevent anything < ~+18V from driving the gate. Would this work? I've seen solution that involve voltage dividers, which seem inefficient, and opto-isolators, which would be somewhat pointless here as the +24V for the limit switch signal is coming from the same board.

• Your existing solution would work better if you swapped the diode and the resistor. Use something like 10V-12V zener. 18V is kind of high to protect 20V abs max Vgs. But still. the simplest thing to do is just use the existing 5V you have, run that through the switch, and back to the MCU. No circuitry required. Also, using a higher voltage on the switch doesn't do anything for false triggering so you don't gain anything. If false triggering is a problem, you have a switch problem. Or noise is triggering the MCU. Commented Feb 23 at 17:41

You can just use a voltage divider. No transistor necessary. BTW, using 24V instead of 5V won't prevent false triggering. That sounds like a problem with your switch.

simulate this circuit – Schematic created using CircuitLab

Or you can level shift it:

simulate this circuit

Or you can do this for ultra low power/current usage:

simulate this circuit

• So the reason I'm not crazy about using a voltage divider here is because: 24V/2.4kΩ = 10mA 10mA^2 x 2.4kΩ = 0.24W So I could just barely use a 1/4W resistor, but it would get hot. I'd really like to know if my circuit would work, or if not, how I could use a MOSFET to do this. Commented Feb 23 at 17:07
• @flimsy, double the resistor values and put two of each in parallel. If heat generated is really a requirement over simplicity and cost, than the optocoupler is a fine solution. Why would you think it's pointless? BTW, I've included one more idea in my answer. Commented Feb 23 at 17:19