Low-Side Switch MOSFET Drain Voltage Drop in OFF state?
As for the mosfet, when you switch it off (with \$V_{GS}\approx 0\$), in your schematic, the drain is actually floating (unless your MCU gives you the option to enable internal pullup resistors at the input, check that). You may want to do something like this:







simulate this circuit &ndash; Schematic created using CircuitLab

When CTRL is 5V, you get \$V_D=0V\$. When CTRL is \$\approx 0\$, the MOSFET is off and the pullup resistor should set the 3.3V(Logic high) on the MOSFET's drain.

Also a resistor (47k works) from the gate to ground would not hurt, though I don't think this is the reason you're having issues, since your are driving the gate low.