I'd like to have a 12V signal as an input to a microcontroller, but it can only handle 5V on the input pins. This circuit will be used in a truck, so the "12V" signal can vary by quite a lot.
My question is this: Is it possible to drive a N-MOSFET with a higher voltage than what will be switched? The picture below shows what I'd like to do.
In this circuit, the 5V will be regulated, and stable.
I don't want to use a resistive voltage divider, as the input could be very variable, and this could either damage the MCU, or provide an unreliable signal. I'm open to alternate suggestions as to how this could be done.