Electrical – 3 way switch with MOSFET

mosfetswitches

it's my first question on here so please be nice.
I want to design a 3 way switch that works with a MOSFET. Aka I want it to work in the same way as a household light would work where it is able to be turned on or off with either switch:

schematic

simulate this circuit – Schematic created using CircuitLab

I have designed a MOSFET circuit already to be controlled by the microcontroller that I am using:

schematic

simulate this circuit

The switch in parallel with the MOSFET just doesn't do what I want to achieve though and I am struggling to think of a way to achieve this.

To clarify:
If the MCU is holding the lamp on, I would like to be able to actuate a switch to turn the lamp off. If the microcontroller is holding the lamp off, I would like to be able to actuate a switch to turn it on.

I hope my problem makes sense.

Best Answer

Something like this? You can still use the 3 way switch and have the micro also function as a 3 way. I left off the gate ctrl because you already know how to do this. You would need two gate controllers for each line, when you want to turn the light on or off with the micro, just toggle one control line high and one line low. Make sure you get the polarity right, NMOS does not turn on if the gate voltage is not higher than the drain voltage.

schematic

simulate this circuit – Schematic created using CircuitLab