Electronic – How to completely turn off device when float switch is open

designswitches

Background

Below is the circuit I designed to open a solenoid valve after a delay from C2 (represented by L1).

S1 is a float switch which closes when a resevoir goes below a given level. The reason S1 is not directly in line with the source is the school of hard knocks lesson that the reed switch (inside the float switch) fuses from the current through the solenoid.

My problem is that the reference voltage being provided by R3 will constantly drain current, even when the valve isn't activated by the bias at Q1. I thought about putting both the inverting and non-inverting inputs on S1, so that neither the inverting nor the non-inverting inputs will have a voltage, but what would the effect be here?

Questions

I vaguely recall that if the two inputs are at equal voltage the output will be zero? Is that correct?

If not, are there other suggestions for stopping wasteful current in the circuit?
enter image description here

PS

This the first circuit with a specific function in mind I've done from scratch, so … other design flaws/suggestions you see, feel free to mention 🙂

The LM386 is just the op amp I have handy. I didn't feel the need to get a comparator because it's a delay of 7+ seconds, so the slow switching isn't really a concern.

Also R3 is actually 240K.

Edit: Per comments, modified image
Would this be the correct way to implement the PMOSFET?

enter image description here

Best Answer

Ok, since I did not understand your need for a delayed turn-off, I've fixed that. Rather than modify my previous answer, I've provided this one instead.

schematic

simulate this circuit – Schematic created using CircuitLab

When the switch is closed, D1 provides a path for voltage to turn on Q1, while R2 charges C1. When the switch opens, the voltage on C1 through D2 keeps Q1 on until C1 has discharged to about 5 volts, at which time Q1 turns off. Using a MOSFET with a gate threshold (Vgth) of 4 volts provides a delay of 7 seconds for the values shown. The easiest way to change the delay is to change R3.

Turnoff is quite gradual, taking ~.5 seconds, so some heatsinking is a good idea. On the other hand, the gradual turnoff suggest that the flyback diode is unnecessary.