thanks guys,
I'll first try to keep the highside voltage doubler driving but just use a voltage divider on the GPIO VCC pin to prevent the idle voltage from turning the MOSFET on.
I'll check the MOSFET bootstrapping too, it might just be enough since I'm just sending pulses from time to time to the solenoid, never more than a second.
There is nothing wrong with a high side switch, even an NPN, in general. The trouble is driving the gate high. You never answered my questions about the relay characteristics. A relay should be rated in terms of two voltages (or sometimes currents). One is the minimum level that
must be applied to
assure the relay will activate (pull-in) . The other is the maximum level that you
must be below to
assure the relay turns off (drop-out). These are the numbers you design your circuit around.
As you have seen, it takes much less than 5V to activate the relay. I'm surprised your relay activates with only 3.3V applied to the gate of the FET. I believe you said the Vth of your FET is 1.6V, so that only leaves 1.7V on the relay! That is a bit surprising. Once you know the pull-in and drop-out voltages of the relay, you can design a driver circuit. These are not necessarily the actual voltages for any given relay, rather numbers that guarantee
every relay of this model will work in your design.
I would ditch the voltage doubler and use a small P channel FET or a PNP transistor to drive your N-FET. This will make the circuit work with a 3.3V MCU... if you work at it a bit. Using a P-FET to drive the relay makes this easier and simpler. Or, if the MCU has 5 volt tolerant outputs and it can run open collector/drain, the MCU can drive the gate directly with only a pullup resistor.
BTW, you seemed to ignore my point about the FET gate in your present design needing a pull down resistor. Once the voltage doubler has created a higher voltage on the output cap, it will remain and not bleed off easily. So you need a resistor to do that.
Like the others, I think the voltage doubler makes the design more complicated. If you want some sort of redundancy for security, use two FETs in series with separate gate driving circuits. Then no single fault in either circuit would cause the relay to be activated... other than a short between gate and source. That can be fixed by using a high value resistor in series with the gate (R1 in your drawing), large enough that it can't provide enough current to switch the relay.
What about the relay failing shorted? That is common for relays when the contacts weld together. It doesn't take much to make them stick.