Author Topic: Fuel sender adapter circuit; advice/recommendations  (Read 4732 times)

0 Members and 1 Guest are viewing this topic.

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Fuel sender adapter circuit; advice/recommendations
« on: December 12, 2017, 07:44:45 am »
Background
Planning 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/considerations
I 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/solution
I'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 range
  • Non-inverting op-amp with gain of 2 to scale to 0-5V analog (avoiding ADC steps)
  • RC-filter to average the voltage
  • Op-amp buffer so input impedance of data logger doesn't affect RC time constant

With 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!!!!!!
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4208
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #1 on: December 12, 2017, 08:36:24 am »
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.

[Dis]claimer: I do this stuff commercially.

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #2 on: December 12, 2017, 08:48:39 am »
Do you know the variation in resistance vs fuel level that you get from the sender?

Not exactly (see next answer).

Quote
What shape is the fuel tank?

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

Quote
Do you need a linear response (voltage vs fuel level)?

I'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.

Quote
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?

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

Quote
Is there a fixed reference voltage available, or will the output of your circuit vary with battery voltage?

The data logger has a stable 5V reference.

Quote
A simple circuit as you describe might be sufficient, but there are plenty of other options out there.

Such as? I'm listening :)
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #3 on: December 12, 2017, 09:21:12 am »
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 empty
0.X is full
0v is a shorted to ground

Then 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)
 
The following users thanked this post: rvalente

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #4 on: December 12, 2017, 10:56:30 am »
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.
« Last Edit: December 12, 2017, 11:01:10 am by int2str »
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #5 on: December 12, 2017, 11:10:32 am »
+5V,

http://tinyurl.com/ycw9wlxt

you would sample your ADC voltage off the op amp output.



Code: [Select]
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
 
The following users thanked this post: rvalente

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #6 on: December 12, 2017, 11:36:26 am »
Hmmm, looks intriguing. I'll look into that circuit.

Thanks!
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4208
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #7 on: December 12, 2017, 12:38:55 pm »
Quote
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?

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


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

Quote
Quote
A simple circuit as you describe might be sufficient, but there are plenty of other options out there.

Such as? I'm listening :)

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

Offline Tomorokoshi

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #8 on: December 12, 2017, 12:47:18 pm »
You may want to look into a hazardous location power barrier.
 

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #9 on: December 13, 2017, 04:57:07 am »
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!
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6924
  • Country: ca
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #10 on: December 13, 2017, 05:12:41 am »
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.

 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #11 on: December 13, 2017, 06:13:46 am »
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.
 

Offline DBecker

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: us
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #12 on: December 13, 2017, 06:39:38 am »
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. 
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6924
  • Country: ca
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #13 on: December 13, 2017, 07:41:23 am »
To the other poster. Such a failure mode would still have a 1.2K resistor inline. Reducing the dissipation power to quite low levels.

No, 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, inductance
A 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.
 

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #14 on: December 13, 2017, 08:02:56 am »
Here's the best picture I could find of the rheostat:
https://images.prussianmotors.com/empower/inv_000662.jpg

@floobydust
I can put in a current limiting resistor on VDD for the opamp.

@dbecker
1995. 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 :D
 

Offline Chris Wilson

  • Super Contributor
  • ***
  • Posts: 1081
  • Country: gb
  • Race car engineer, dog lover, hoarder.
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #15 on: December 13, 2017, 12:08:57 pm »
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.
Best regards,

                 Chris Wilson.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6924
  • Country: ca
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #16 on: December 13, 2017, 06:20:42 pm »
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.
 

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #17 on: December 14, 2017, 01:29:56 am »
OP's tank oddly has dual level sensors, presumably to correct for tilt?

Yupp

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

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

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #18 on: December 14, 2017, 09:31:36 am »
Schematic and board layout attached.
Note that I will NOT be using the LM358N, but a suitable rail-to-rail opamp instead.

Thoughts?
 
The following users thanked this post: rvalente

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #19 on: December 14, 2017, 09:47:41 am »
Just realized the PCB image is tiny.
Here's a larger cleaned-up version.
 

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #20 on: December 14, 2017, 10:19:47 am »
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?
 

Offline DBecker

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: us
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #21 on: December 14, 2017, 06:16:15 pm »
OP's tank oddly has dual level sensors, presumably to correct for tilt?


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

Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1456
  • Country: gb
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #22 on: December 14, 2017, 06:31:08 pm »
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?

This might be a good opportunity for me to try some SMD soldering.

Are the components spaced to tightly?

Doesn'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.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6924
  • Country: ca
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #23 on: December 14, 2017, 09:14:56 pm »
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 Pump see 4 Dynamics

 

Offline int2strTopic starter

  • Regular Contributor
  • *
  • Posts: 96
Re: Fuel sender adapter circuit; advice/recommendations
« Reply #24 on: December 15, 2017, 04:43:47 am »
Decoupling added - good point, thanks.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf