Pump controller driven by variable-resistance fuel level sender

Thread Starter

leighwebber

Joined Aug 30, 2016
17
Oops. Thought it was milli-farads. My bad.

AnalogKid -- turn on at 1.7 V or lower, turn off at 6.5 V or higher. And stay off until it hits 1.7 V or lower.
 

Thread Starter

leighwebber

Joined Aug 30, 2016
17
Oops -- thought it was 100 millifarads. My bad.

AnalogKid -- turn on at 1.7 V or lower, turn off at 6.5 V or higher -- and stay off until it drops back to 1.7 V or lower.
 

ericgibbs

Joined Jan 29, 2010
11,156
hi leigh,
If you drive the 12Vdc 1.5A directly from a PNP transistor it will be necessary to use a high power Darlington transistor or a Power P MOSFET.
OK.
E
 

Thread Starter

leighwebber

Joined Aug 30, 2016
17
I plan to use a relay rated at 8 amps. I have two of them, one with a coil resistance of 320 ohms and one with 600 ohms. Should be close enough.
 

crutschow

Joined Mar 14, 2008
25,680
I would go with a two comparator, one FF, one small transistor, one relay (or one power transistor, no relay which should be more reliable) design as AK suggested.
It's a little more complicated but I think the independent adjustment of the high and low trip points is a big advantage in setting up the circuit in your application.
If that sounds good to you I, or someone else, can put something together to do that.
 

Thread Starter

leighwebber

Joined Aug 30, 2016
17
I'm going to breadboard Eric's design and test it out. I'll keep everyone posted on the results. I should have all the parts (including the fuel sender unit) by Monday.
 

crutschow

Joined Mar 14, 2008
25,680
I'm going to breadboard Eric's design and test it out. I'll keep everyone posted on the results. I should have all the parts (including the fuel sender unit) by Monday.
Okay.
Just be aware, that circuit has some interaction between the high set point and the low set point.
 

Thread Starter

leighwebber

Joined Aug 30, 2016
17
Thanks -- I take it I'll have to adjust a set point, test, adjust the other set point, test, set the first set point, etc. until I zero in on the values I want.
 

wayneh

Joined Sep 9, 2010
16,401
For the record, here's a version of what I suggested in #2 that comes close to meeting the required voltage switching points. R6 can be the pump itself or a relay.

Screen Shot 2016-08-31 at 3.36.38 PM.png

Green = sender voltage
Blue = voltage on non-inverting input (switching points)
Red = pump current
Screen Shot 2016-08-31 at 3.40.14 PM.png

R4 and R5 could both be 50K pots to adjust the switching points.
 
Last edited:

Thread Starter

leighwebber

Joined Aug 30, 2016
17
I'll breadboard this one as well. That MOSFET is out of stock at Digikey. Could I use a Digikey part number 568-12317-6-ND instead? It is a MOSFET P-CH 16V 4.66A 8-SOIC.
 

wayneh

Joined Sep 9, 2010
16,401
And don't be anchored by the one I chose. I spent zero time choosing it. It is just a generic P-channel MOSFET in that schematic.

Also note that if you're using a relay to invert the logic, you could use an N-channel instead, as I showed in post 12.
 

wayneh

Joined Sep 9, 2010
16,401
Since safety is a consideration, some thoughts.

Maybe add a 3-position toggle switch, center off, to allow for manual override. If you think having the pump fail to come on is bad, consider it failing to turn off!

Automotive and marine electrical systems are notoriously noisy. Whatever circuit you end up with should be "hardened" against this noise and transients. I'm no expert on this.

Whatever switching voltages you choose probably change with the system voltage, from 11 to 15V or so. The "reference" voltage established by the voltage divider in this circuit will also move. This may all work out ok but be aware. A voltage regulator to protect the circuit might be helpful.

You may want to put a 47K resistor (value doesn't matter much) between the sensor and the comparator input, and put a 100uF or larger capacitor on that pin and ground. This would prevent fast switching from sloshing, electric transients and so on.

Since almost any comparator you get will have 2 or 4 comparators in the package, you could use the 2nd one to reverse the logic and use the Nfet arrangement.
 

Thread Starter

leighwebber

Joined Aug 30, 2016
17
Thanks for the tips. I have one thing going for me: the fuel level sender is actually being fed by a microntroller, not by boat battery directly. I left this out of the discussion to keep it simpler. The microntroller is designed to translate engine data (rpm, oil pressure, temperature, fuel level, etc.) into NMEA-2000 data. NMEA-2000 is a simple RS-422 bus plus a protocol for formatting and managing data packets. Smart devices like wind sensors, speed sensors, etc. know how to speak NMEA-2000 on their own. Dumb devices like temperature, oil pressure, and fuel level sensors are just simple analog devices that provide a variable resistance. Old fashioned engine panels with analog gauges just send 12V down those wires and read the voltage drop. The gauges are simply voltmeters.

My nifty microcontroller, however, can be configured to read analog devices by sending a *controlled* voltage down the wire, measuring the voltage, and converting it to a digital packet (called a "sentence") that it drops on the NMEA-2000 bus. Each sentence contains a string that identifies the type of sensor and its digital value. At the helm I have a multi-function display (a B&G Zeus-9 if you're interested). It can interpret any flavor of NMEA-2000 sentence and display the data in really beautiful graphics. You can set up any number of display configurations and select what instruments to display, whether to show them as digital values, images of old-fashioned analog gauges, etc. It is totally cool.

My microcontroller has a bunch of analog inputs. I can configure the device to give each input port a name, and also calibrate it so that it interprets, say, 6.5 V as 100% full and 1.7 V as 0. Or any value I want. I already have one port connected to the main fuel tank sender, and I will be connecting the other to my day tank. On my mfd, I can set up a panel that shows both fuel gauges as well as engine RPM, oil pressure, temperature, etc. The mfd itself can be configured to sound alarms for defined values of any sensor. So I can set an alarm on my day tank fuel level to yell at me if the pump we're all working on here fails to kick in. It would be nice if the mfd was smart enough to send out control signals to the pump, but it can't. Hence the need for the circuit.

So -- the voltage that the comparators will see will be very clean: a precise voltage, no spikes, etc. When the MOSFET turns the pump on, however, the supply voltage will come from my house battery, which will be about 13 V, plus or minus a volt. The pump won't care. I just hope the circuit doesn't hear what's happening on the power side of the MOSFET.

BTW -- I assume that the circuit won't mind me connecting an independent power source like that.
 

Thread Starter

leighwebber

Joined Aug 30, 2016
17
Since safety is a consideration, some thoughts.

Maybe add a 3-position toggle switch, center off, to allow for manual override. If you think having the pump fail to come on is bad, consider it failing to turn off!

Automotive and marine electrical systems are notoriously noisy. Whatever circuit you end up with should be "hardened" against this noise and transients. I'm no expert on this.

Whatever switching voltages you choose probably change with the system voltage, from 11 to 15V or so. The "reference" voltage established by the voltage divider in this circuit will also move. This may all work out ok but be aware. A voltage regulator to protect the circuit might be helpful.

You may want to put a 47K resistor (value doesn't matter much) between the sensor and the comparator input, and put a 100uF or larger capacitor on that pin and ground. This would prevent fast switching from sloshing, electric transients and so on.

Since almost any comparator you get will have 2 or 4 comparators in the package, you could use the 2nd one to reverse the logic and use the Nfet arrangement.
 

Thread Starter

leighwebber

Joined Aug 30, 2016
17
Forgot to mention: the three-position toggle switch is a great idea. Failure to shut off is not much of a problem, because the day tank has a return line to the main fuel tank. If it overfills, the fuel just flows back where it came from. But the toggle switch will let me fill the tank manually in case my circuit goes the way of all marine electronics.
 

#12

Joined Nov 30, 2010
18,210
You may want to put a 47K resistor (value doesn't matter much) between the sensor and the comparator input, and put a 100uF or larger capacitor on that pin and ground. This would prevent fast switching from sloshing, electric transients and so on.
It will also make the system start up in the "on" condition so it tops up every time the power first comes on. TS preferred this in post #1.
 

wayneh

Joined Sep 9, 2010
16,401
Here's the inverted version I would probably use. It uses the second comparator on a single IC package, dual comparator to reverse the logic. I typically use the LM339 (quad) for everything and use the extra comparators to run indicator LEDs to show whether things are connected, voltage is above some level or not, etc. Very handy.

Screen Shot 2016-09-01 at 10.44.19 AM.png
 

Thread Starter

leighwebber

Joined Aug 30, 2016
17
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. 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. Also, I wanted to be able to tweak the degree of emptiness that triggers the pump and the degree of fullness that stops it. When I first put the circuit together, the pump would start only when the sender was at the completely empty position, and would only stop when at the completely full position. In real life, the tank may never get completely empty due to the design of the plumbing. And I don't want the pump to have to fill the tank completely to overflowing. 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. 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.

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.

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.
 
Top