A new problem I have is to create an automatic switch between two sources, only one of the sources should be active at a time. There is a "backup" source (5V battery), as well as another source. Once this source drops below a 3V threshold it should stop (and go back to the battery).
We wish to use a power (N- type)mosfets (with a \$V_{gs-th}\$ of 2V) to do the switching. The best circuitry that goes into the direction I've come up to is as following:
simulate this circuit – Schematic created using CircuitLab
(Notice the diode above the mosfet is to emulate a power mosfet)
Now the gate voltage is simply the \$\frac{2}{3} \cdot \left(V_{bat} - V_{var}\right)\$. (PS: I know this 2/3rd is not correct, it is currently included in the schematic so I have a point where I can edit the exact voltage difference)
Now this works for the battery: it is disabled as long as the variable source is above the threshold. However this isn't the case for when the variable source becomes too low. Then the variable source should be "disconnected" (so it can charge up again).
But I can't seem to add such a feature without breaking the current way.