Fuel sender adapter circuit; advice/recommendations - Page 1
Forum section: electronics / projects

author: int2str
author_rank: Regular Contributor
timestamp: December 12, 2017, 07:44:45 am
content: BackgroundPlanning to hook up a BMW fuel sensor to an aftermarket data logger. The logger takes 0-5V input voltages with an unknown load/resistance. The fuel sensor is simply resistive with a 20-500 Ohm range.Thoughts/considerationsI could use a simple voltage divider but I feel like I would give up half of the ADC range inside the data logger since using a 500 Ohm resistor for the divider would mean my range is ~0-2.5V max. Also, since we're talking fuel levels in a race car here, some buffering would also be good. The buffering is also a problem though because I don't know what the input resistance of the data logger is.Proposed circuit/solutionI'm thinking of making a custom circuit board to do the following:Circuit blocks (input to output order):Voltage divider with a 500 Ohm resistor to get 0-2.5V rangeNon-inverting op-amp with gain of 2 to scale to 0-5V analog (avoiding ADC steps)RC-filter to average the voltageOp-amp buffer so input impedance of data logger doesn't affect RC time constantWith a standard dual/quad op-amp and a few caps/resistors this should be a super simple PCB.Please let me know if I'm on the right track or if anyone has a much better option.If no objections, I'll go ahead and post a circuit diagram for review.Thanks for your help!!!!!!

author: AndyC_772
author_rank: Super Contributor
timestamp: December 12, 2017, 08:36:24 am
content: Hi,Do you know the variation in resistance vs fuel level that you get from the sender? What shape is the fuel tank?Do you need a linear response (voltage vs fuel level)?If it's for a racing application, how accurate do you need it to be, especially at or near the 'empty' end of the scale?Is there a fixed reference voltage available, or will the output of your circuit vary with battery voltage?A simple circuit as you describe might be sufficient, but there are plenty of other options out there.claimer: I do this stuff commercially.

author: int2str
author_rank: Regular Contributor
timestamp: December 12, 2017, 08:48:39 am
content: Quote from: AndyC_772 on December 12, 2017, 08:36:24 amNot exactly (see next answer).QuoteThe fuel tank is "saddle" shaped (Image of tank).There are two sensors, one on each side. Each sensor has a range or 10 Ohm (Empty) to 250 Ohm (Full). Currently assuming the sensors are wired in series from a wiring diagram I've seen, but will verify.QuoteI'll take what the sensors can give me. Would prefer linear of course, but the data logger can also apply a curve to the input, so as long as it's deterministic and repeatable, I'm good.QuoteHard to quantify, but pretty accurate - especially at the empty end of the scale. It could spell disaster if it shows fuel for one more lap but then doesn't actually have it.QuoteThe data logger has a stable 5V reference.QuoteSuch as? I'm listening

author: Rerouter
author_rank: Super Contributor
timestamp: December 12, 2017, 09:21:12 am
content: Use an op amp as a Howland current source of about 8mA.5v is read as open circuit sensor and should read empty.4.X is empty0.X is full0v is a shorted to groundThen in software do 15 second rolling average slosh filtering. This is how the modern clusters do it. However they do a direct read when ignition is first turned on.Being a BMW sensors I presume a tubular. Where it has about an inch thick metal cylinder with a low fuel contact.If it's this model. When that low fuel contact is reached the sensor has bottomed out and will not be able to read any lower. Equally the wiper arrangement will cause some hysteresis on the ohm level. Shifting as much as 5ohm on up vs down.The other thing is depending on the original age. High ethanol fuels can dissolve the plastic feed through where the contacts are. And the plastic base plate (there is a plastic one under the metal facia)

author: int2str
author_rank: Regular Contributor
timestamp: December 12, 2017, 10:56:30 am
content: Everything I find about the howland current source circuit suggests about ~6 resistors and more importantly a +/- supply of ample range. So not sure how easy that would be to implement given I only have ~+12V and +5V at my disposal.

author: Rerouter
author_rank: Super Contributor
timestamp: December 12, 2017, 11:10:32 am
content: +5V,http://tinyurl.com/ycw9wlxtyou would sample your ADC voltage off the op amp output.Code:http://www.falstad.com/circuit/circuitjs.html?cct=$+1+0.000005+1.3241202019156522+58+5+50%0Aa+256+160+368+160+0+5+0+1000000+1.0003886524497694+1.0004086602228184%0Aw+368+160+368+96+0%0Aw+368+160+368+224+0%0Ar+256+224+368+224+0+1200%0Ar+256+96+368+96+0+1200%0Ar+256+96+144+96+0+1200%0Ar+144+224+256+224+0+1200%0Aw+256+176+256+224+0%0Aw+256+96+256+144+0%0Ax+187+67+217+70+4+24+R1%0Ax+300+67+330+70+4+24+R2%0Ax+185+259+215+262+4+24+R3%0Ax+298+259+328+262+4+24+R4%0Ax+179+338+224+341+4+24+load%0Ag+144+96+128+96+0%0AR+144+224+112+224+0+0+40+5+0+0+0.5%0A174+256+288+256+384+0+500+0.48020000000000007+Tank+Sensor%0Aw+272+336+320+336+0%0Ag+320+336+320+368+0%0Aw+256+288+256+224+0%0Ao+2+64+0+4099+10+0.003125+0+2+2+3%0A

author: int2str
author_rank: Regular Contributor
timestamp: December 12, 2017, 11:36:26 am
content: Hmmm, looks intriguing. I'll look into that circuit.Thanks!

author: AndyC_772
author_rank: Super Contributor
timestamp: December 12, 2017, 12:38:55 pm
content: Quote from: int2str on December 12, 2017, 08:48:39 amThis would be my main concern. Before spending too much time trying to work out how to interface the sender to your data logger, I'd first identify whether or not it's accurate and repeatable enough at the bottom end of the scale. If it can't tell the difference between having 1 lap left and having less than 1 lap left, repeatably and reliably, it's not really doing the job you need, and no scaling and signal conversion circuit will help.QuotePurpose-built race cars tend to use solid state sensors, which don't suffer from hysteresis, and typically have a 0-5V buffered output (and/or CAN bus) as standard. Or, depending on your budget and how important your fuel strategy is, you might consider a fuel flow meter as well, so you know exactly how much you've actually consumed during the race.

author: Tomorokoshi
author_rank: Super Contributor
timestamp: December 12, 2017, 12:47:18 pm
content: You may want to look into a hazardous location power barrier.

author: int2str
author_rank: Regular Contributor
timestamp: December 13, 2017, 04:57:07 am
content: Rerouter,Thanks, that's a really neat circuit you introduced me to. Read up much more about it and breadboarded it out and it works great on the breadboard.Currently testing with an LM358 and of course I'm hitting the rail hard, but I have a better op-amp on order.Though, since I also have ~12ish (it's the car's battery/alternator voltage) volts on the same cable that carries the 5V reference, what's preventing me from powering the op-amp with 12V to get it off the rails?Any concerns there?Thanks for your help!

author: floobydust
author_rank: Super Contributor
timestamp: December 13, 2017, 05:12:41 am
content: Please be very careful that unsafe power cannot get to the fuel sender, even if faults occur. Nobody likes 12V on a fuel sender causing a little meltdown inside a fuel tank.I could go on about IS barriers and intrinsic safety, which applies to stationary fuel tanks. But in a car, have current-limiting resistors to the sender so a 5V->12V fault could never happen. If your Vreg and op-amp shorts, what happens? There is a path for 12V to reach the sender.

author: Rerouter
author_rank: Super Contributor
timestamp: December 13, 2017, 06:13:46 am
content: While you can power it off 12v, I would recommend against it. Atleast not without a automotive grade regulator Infront of it.To the other poster. Such a failure mode would still have a 1.2K resistor inline. Reducing the dissipation power to quite low levels.The old bimetallic fuel sender's out of Ford Falcon and the like dissipated 3-5W. Not to mention a sealed fuel tank with more than a film of fuel can not explode as the concentration of vapour is too rich. It's why hydrogen tank flow can be measured with thermal flow metres. It's too rich to burn.

author: DBecker
author_rank: Frequent Contributor
timestamp: December 13, 2017, 06:39:38 am
content: What era of BMW?After the mid-1990s BMW dual sender systems have both signals go to the instrument cluster, and the averaging is done there. You can see both values when running diagnostics.Older analog gauges put a substantial amount of current through the gas tank senders, and the senders were often open wire-wound rheostats. I wouldn't be overly concerned about a few milliamps of current.

author: floobydust
author_rank: Super Contributor
timestamp: December 13, 2017, 07:41:23 am
content: Quote from: Rerouter on December 13, 2017, 06:13:46 amNo, the op-amp's input is directly connected to the fuel tank sensor. Need some current limiting if the IC shorts. 5V with little or no capacitance does not ignite gasoline, but 12V is much easier.The spark is from total energy: voltage, current, capacitance, inductanceA 1960 Ford sender rheostat may have been a watt or two, but it was sized to run cool, had no capacitance, little inductance and current was limited by the gauge.OP does not have a multi-watt rheostat, and current limiting under any fault condition is necessary.

author: int2str
author_rank: Regular Contributor
timestamp: December 13, 2017, 08:02:56 am
content: Here's the best picture I could find of the rheostat:https://images.prussianmotors.com/empower/inv_000662.jpg@floobydustI can put in a current limiting resistor on VDD for the opamp.@dbecker1995. According to the wiring harness, the two sensors are in series.I like that everyone is concerned about safety here - trust me, I am too.But, if all else fails, remember, this is a racecar - it also has a fire extinguisher system built in

author: Chris Wilson
author_rank: Super Contributor
timestamp: December 13, 2017, 12:08:57 pm
content: I am a race car engineer and can say for sure a float type fuel level indicator cannot be relied upon to accurately portray whether enough fuel remains in a large volume shallow tank for one more lap!!! Use a flow sensor.

author: floobydust
author_rank: Super Contributor
timestamp: December 13, 2017, 06:20:42 pm
content: OP's tank oddly has dual level sensors, presumably to correct for tilt?I notice the (pic) level sensor is a VDO thick-film potentiometer with tank-shape correcting resistors. It's output should be linear, corrected for tank geometry.For the haz loc safety aspect, not a resistor on the op-amp's VDD, but instead a series resistor on the op-amp's (+) input, so no high-current path through a failed IC to the tank sensor. Perfectionists would also have the same on the (-) input to null any offset due to op-amp input bias current.The other resistors connecting to the tank sensor should be infallible, that is worst case they see 2/3 of their rated power. So a 14V fault and 1k2 gives 1/4W parts to be used there.

author: int2str
author_rank: Regular Contributor
timestamp: December 14, 2017, 01:29:56 am
content: Quote from: floobydust on December 13, 2017, 06:20:42 pmYuppQuoteAs best as I can tell, there are only two possible sources of the current:1. The 5V input, which is covered by the 1.2k resistor also rated at 50mA max from the data logger (not sure if actually enforced)2. VDD of the OpAmp. That's why I suggested I can introduce some current limiting there.But yes, instead of on VDD (or even in addition), I can also use resistors on +/- inputs. Though I'll have to simulate/test that to make sure that doesn't affect the circuit.

author: int2str
author_rank: Regular Contributor
timestamp: December 14, 2017, 09:31:36 am
content: Schematic and board layout attached.Note that I willNOTbe using the LM358N, but a suitable rail-to-rail opamp instead.Thoughts?

author: int2str
author_rank: Regular Contributor
timestamp: December 14, 2017, 09:47:41 am
content: Just realized the PCB image is tiny.Here's a larger cleaned-up version.

author: int2str
author_rank: Regular Contributor
timestamp: December 14, 2017, 10:19:47 am
content: Sorry to reply to my own thread so many times...This might be a good opportunity for me to try some SMD soldering.Are the components spaced to tightly?

author: DBecker
author_rank: Frequent Contributor
timestamp: December 14, 2017, 06:16:15 pm
content: Quote from: floobydust on December 13, 2017, 06:20:42 pmOlder BMWs are rear wheel drive. The fuel tank straddles the driveshaft. In the late 1980s BMW changed from a tube running under the driveshaft to a passive suction jet transfer using the fuel return line to siphon fuel from the off-side well. That change meant that each half of the saddle tank needed its own level sensor.As for geometry correction.. the fuel gauge clearly indicates empty and full. Anything in between is open to interpretation. Later digital instrument clusters did some level correction in software, thus measuring the level sensors individually. The primary fuel consumption estimation is done by summing injector open time, not by monitoring tank level.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: December 14, 2017, 06:31:08 pm
content: I would also like to thank Rerouter for suggesting that Howland current source circuit.I had been looking for something like that for a while as a solution to a problem I'd been dealing with when using a simple divider circuit to take ADC readings from a specific type of potentiometer that has very poor manufacturing tolerances and varied quite a lot from instance to instance. The knob on this pot has several detent positions, and I was trying to come up with a universal set of threshold values to determine position, but failing due to the aforementioned variation.I tried this circuit out yesterday (using an MCP602) and it works rather nicely, giving me a linear voltage output with wide steps between pot positions.But, I have a question: my pots are 45-50K, so through trial-and-error in the linked Falstad simulation I determined I need 100K resistors to cover the full range. Would this make the output signal high impedance? That is, not quite suitable for feeding directly to an ADC? Would it need buffering first?Quote from: int2str on December 14, 2017, 10:19:47 amDoesn't look too bad to me. I would perhaps move the components above and below the op-amp so they are a little further away.What I like to do when trying to determine whether a layout of SMD components is easily hand-solderable, is to print it out on paper actual size and get my soldering iron in hand (off, of course!) and make sure I can get to all the pads and joints without any other parts being in the way. For example, avoiding having two resistors laid-out with ends facing, but not enough space between to get the iron to the pad of one without risk of touching the other.

author: floobydust
author_rank: Super Contributor
timestamp: December 14, 2017, 09:14:56 pm
content: I would have a decoupling cap for the op-amp's power and another to limit bandwidth.The sensor is right next to the fuel-pump motor wiring, so I'd expect RFI to come in.AN-1515 A Comprehensive Study of the Howland Current Pumpsee 4 Dynamics

author: int2str
author_rank: Regular Contributor
timestamp: December 15, 2017, 04:43:47 am
content: Decoupling added - good point, thanks.

author: Rerouter
author_rank: Super Contributor
timestamp: December 15, 2017, 07:47:11 am
content: HwAoRrDk (how in the world do you pronounce that?)The output for your ADC as taken directly from the op amp output is always low impedance, and buffered, its why I am such a fan of this circuit. no matter how you load that output, the feedback network is compensating it out.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: December 15, 2017, 04:06:38 pm
content: Quote from: Rerouter on December 15, 2017, 07:47:11 amAh, okay, thanks. I wasn't sure. I thought maybe the high-value resistors in the feedback might affect things where otherwise lower-value ones would not.P.S. Read the capital letters first.

author: int2str
author_rank: Regular Contributor
timestamp: January 10, 2018, 04:51:22 am
content: Board came in today!Works great - at least on the benchThanks again for exposing me to this neat circuit, this was a lot of fun!