I'm using a RFP30N06LE.
This is the circuit:


I'm doing some measurement tests to see if I understood the operation of a mosfet as a switch.
The problem is that both with Vgs=5V (actually 4.7V measured) and with Vgs=0 I have at the ends of resistor R3 about 12V.
Why?
The mosfet should behave like a switch: ideally a short circuit when Vgs=5V (so about 12V on R3) and an open circuit when Vgs=0V (0V on R3)
This is the circuit:


I'm doing some measurement tests to see if I understood the operation of a mosfet as a switch.
The problem is that both with Vgs=5V (actually 4.7V measured) and with Vgs=0 I have at the ends of resistor R3 about 12V.
Why?
The mosfet should behave like a switch: ideally a short circuit when Vgs=5V (so about 12V on R3) and an open circuit when Vgs=0V (0V on R3)