There are lots of ways to do that. Sounds like you've got one working. But just using the N-channel MOSFET below the load, instead of the P-channel above it, would do it and may be simpler.Wayneh - I built your circuit from post 29 -- not the one with the two comparators. But I made a colossal mistake in describing the requirements. The voltage from the fuel sender is 7.5 V when EMPTY and 1.9 V when full. I described it backwards in my initial post. To fix that, I put an inverter on the output of the comparator.
Yeah, that's what I was getting at in #34. The system voltage will vary in the real world and some tweaking will be needed once you see how it's working on the boat.The main difficulty, however, was tweaking things. My breadboard power supply has 13.0 volts, not 12. And on the boat, the circuit will be fed from the boat's main DC system, which could be anywhere from 12 V to 14 V. So some way to adjust things was needed.
I'm confused by this. The variable pot should be ~50K and replace R5 (in the circuit in either #29 or #39). This adjusts the hysteresis. I suppose if you have it working by tweaking the pull-up resistor, that's OK. Check the specs of your comparator to see if it can sink the current fed to it through that small a resistance at the pull-up.So I modded the circuit and put a 50K trim pot (set at about 26.5K) in place of R4 and a 1K trim pot (set at about 420 ohms) in place of R2. The R4 pot adjusts the lower (cut-in) threshold and the R2 pot adjusts the upper (cut-out) threshold.
Yes those were residual from simulating the sender. You can remove them completely.Oh -- and there was a mistake in the drawing. R1 and R7 are shown as "100". They should be "100K". I assume it was a typo -- the circuit didn't work at all with 100 ohm resistors in there, but works like a charm with 100K resistors.
Good move.While testing, I didn't actually put in the MOSFET and relay. I just hooked up the output line to an LED. Made it much easier to adjust the trim pots while swinging the float arm of the fuel level sender back and forth. I could see the LED turn on and off out of the corner of my eye while focusing on the adjustments, etc.
Be sure to come back and report how it turns out.Thanks to everyone for all the help! Now to build the final circuit board, seal everything up in a watertight enclosure, and install on the boat. Just as soon as the metal shop finishes fabricating my tank.