The MOSFET link you provided is maybe a bit oversized/overrated if your relay is small and doesn't consume much current.
Also, the MOSFET need to have low Vgs, below 3V, which is not case in the one you provided.
I would rather use something like AO3402, or 2N7000 if you don't want surface mounted.
The Relay is 5v but it is powering an AC light at 230v, just before I order some 2n700, is it absolutely certain that the P2N2222A will not work for this project (only for time sake) if I can do what I need to do with what I currently have would be great.
The circuit look like, although I would use another MOSFET instead of the 2N3903, with pulldown on its gate
OK so pretty new to reading these things can you confirm I understand and elaborate on the questions I have please:
with pulldown on its gatedo you mean connect the gate to the 3v positive ?
PORT C-2, I am guessing this GPIO2?
- So from GPIO2 (if above is correct) add a 1k resistor
- Add a 2n700 (if you confirm a P2N2222A is not enough) by connecting to the middle pin after the resistor.
- Connect the right pin off to GND (I am powering this by a 9V battery through a regulator) so would that be to 3.3v ground yes or the ground on the 5v side of the board or does it not matter?
- Connect the left pin to a 10K resistor and then what is the 12V after that ?
- Also connect the left pin to a 2n700 (if you confirm a P2N2222A is not enough) connecting it to the right hand pin of the 2nd MOSFET then also that pin to GND, again if so to 3.3V ground ?
- Also connect GND to the middle pin?
- Connect the left hand pin of the 2nd mosfet to the IN pin of the relay ?
Sorry if got mixed up but at this moment that is what I can make out from that diagram, which may be totally wrong lol.