How to switch a MOSFET to drive a 5v relay from Raspberry pi?
This is what you should be looking for to switch NMOS and relay. Source is grounded.







simulate this circuit &ndash; Schematic created using CircuitLab