Fuel Gauge/Sender Variants

An alchemy of sparks, copper wire and earth

Moderators: User administrators, Moderators

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Fuel Gauge/Sender Variants

Post by CJH »

bigbadbob76 wrote:The chip datasheet gives you the time formula. ;-) minutes would be good but would need a HUGE capacitor. 1000uF = 10s so 6000uF = 1 min. We have to compromise. ;-)

Very happy for you to take the lead on that compromise. Interesting that a HUGE capacitor is still only 6 thousandths of a Farad. When common components come in 'micro' and 'pico' denominations it gives the novice (me) the impression that the original unit could do with rescaling a bit! Reminds me of that old joke about the unit of intelligence - the 'Tary'.
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
bigbadbob76
Registered user
Posts: 1733
Joined: 07 Nov 2016, 14:41
80-90 Mem No: 15707
Location: Isle of Skye

Re: Fuel Gauge/Sender Variants

Post by bigbadbob76 »

Yes, working where I do, I'm I often encounter the microtary. :wink:
Although I always thought that military intelligence was an oxymoron. (what's one thousandth of a moron then? a millimoron?)
Anyway, back to capacitors.... you do occasionally come across capacitors of a few Farads in audio work but they're rare in run of the mill electronics.
'86 1.9 DG, 4 spd, tintop, camper conversion.
Split case club member.

User avatar
bigbadbob76
Registered user
Posts: 1733
Joined: 07 Nov 2016, 14:41
80-90 Mem No: 15707
Location: Isle of Skye

Re: Fuel Gauge/Sender Variants

Post by bigbadbob76 »

I had the van out today, gauge showing a bit below half full, light came on round a long fast left hand bend. We need a bigger capacitor cap'tn. Or maybe two in parallel.


Sent from my iPhone using Tapatalk
'86 1.9 DG, 4 spd, tintop, camper conversion.
Split case club member.

User avatar
937carrera
Registered user
Posts: 3599
Joined: 05 Apr 2015, 19:29
80-90 Mem No: 16333
Location: N Yorks.

Re: Fuel Gauge/Sender Variants

Post by 937carrera »

How about one like this. Big enough ?

Image
1981 RHD 2.0 Aircooled Leisuredrive project, CU engine
1990 RHD 1.9 Auto Sleeper with DF/DG engine

User avatar
bigbadbob76
Registered user
Posts: 1733
Joined: 07 Nov 2016, 14:41
80-90 Mem No: 15707
Location: Isle of Skye

Re: Fuel Gauge/Sender Variants

Post by bigbadbob76 »

Nay, thats just a tiddler. Haha.
I filled up today and it sloshed out the neck, oops.
Golf gauge, full to the brim, 4.32V.
Image



Sent from my iPhone using Tapatalk
'86 1.9 DG, 4 spd, tintop, camper conversion.
Split case club member.

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Fuel Gauge/Sender Variants

Post by CJH »

My daughter came home for a couple of days, and she spotted my dashboard PCBs (you can't miss them, there are components all over the house!). She asked how you go about 'programming' the spare LEDs. And in that question I realised that maybe the answer to the long period smoothing that a sloshing fuel level sender requires might be a software approach, rather than an unfeasibly large capacitor. A cheap ATTINY85 Arduino board could be dedicated to monitoring the voltage on the sender and smoothing the values over several minutes before earthing an output pin to trigger the dashboard LED. This would give the end user the option of varying the smoothing interval and/or the triggering voltage by reloading the software with different constants. Just a thought.

Image
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
bigbadbob76
Registered user
Posts: 1733
Joined: 07 Nov 2016, 14:41
80-90 Mem No: 15707
Location: Isle of Skye

Re: Fuel Gauge/Sender Variants

Post by bigbadbob76 »

Software is certainly one way to go although personally I'd rather avoid it for such a simple circuit but could be combined with a trip computer.
I've put in a 2200uF 16V capacitor to try that, it should give us 22 seconds delay. if that's not enough we might have to go down the software route.
Tank is full at the moment but I'm going out to Harris in the van at the weekend so will see how it goes. :ok
'86 1.9 DG, 4 spd, tintop, camper conversion.
Split case club member.

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Fuel Gauge/Sender Variants

Post by CJH »

After a decent run over the weekend I thought I'd start logging the needle position when I fill up - when I know how much fuel goes in and therefore how much was theoretically left in the tank.

After 240 miles my tank took 45l to fill up and my needle showed this (a little below half):

Image

So that means I'd averaged 24mpg, and therefore the remaining 15l (assuming I could run the tank dry) would have got me another 80 miles. So actually I was still quarter full - the needle is definitely showing more than that. I know the needle will accelerate below the half way point, but this hasn't helped my confidence in the lower reaches of the gauge. I'm definitely going to have to carry some spare petrol and take the tank lower.

I figured I could quite easily modify my Arduino installation to log the voltage on the tank sender wire, say every 15 seconds, to see how it behaves in normal driving and to work out the parameters of a suitable low pass filter smoothing algorithm. If that can be tuned to give a reliable level, it could even give an estimate of remaining range based on the current trip values.
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
bigbadbob76
Registered user
Posts: 1733
Joined: 07 Nov 2016, 14:41
80-90 Mem No: 15707
Location: Isle of Skye

Fuel Gauge/Sender Variants

Post by bigbadbob76 »

Hmmm.....
Interesting stuff Chris.
While heading home from Harris tonight I let the fuel gauge drop into the red just out of interest.
With it at the bottom of the red and the led not come on, I pulled over and measured the volts, 8.47V!!!!
With 25miles left to go I got worried and checked back on this thread.
8.47V equates to over 240 ohms and by Chris and Bigherbs tests that's pretty empty, maybe 5l left which might or might not get me home. Eeek.
So I filled up and it took 46.27l
Not so bad after all. 14l would have got me home.
Looks like my circuit has died though.
I,ll test and repair tomorrow.
Would be good to know how far I can get when the led comes on as that is a defined voltage, smoothed over 22 seconds.

Update- I replaced the chip and it's working again. Got a full tank to get through before I can see how well it works though.


Sent from my iPhone using Tapatalk
'86 1.9 DG, 4 spd, tintop, camper conversion.
Split case club member.

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Fuel Gauge/Sender Variants

Post by CJH »

I finally had a chance to implement a sender voltage logger in Arduino, to provide the raw data for a smoothing algorithm. I've set it to record at 1Hz initially, just to see how quickly the sender moves. I took the van for a drive round the block - all 30mph and 20mph (yes, really :roll: ) roads, no hard braking or fast cornering. It turns out that the sender moves quite quickly.

Image

There's evidently quite a lot of sloshing going on. I've used the little screen that I was using as a digital clock to display the voltage in real-time, so I can see the effect of accelerating and braking, turning left and right, etc. Higher voltage means higher resistance, which means lower fuel level, so the peaks in the graph correspond to accelerating or turning left, and the troughs correspond to braking or turning right. Just from this little plot you can tell that my journey round the block was anti-clockwise, so mostly turning left. And you can see where I stopped at the lights for ~25 seconds (4:35-5:00).

There are a few points at just over 8V (8.05V in fact). The fact that that seems to be a maximum value suggests that perhaps the float on the sender was temporarily out of the fuel, due to sloshing. So if my display gets close to 8V then I know it's time to fill up, regardless of what the dash gauge shows.

I'll keep it at 1Hz for the rest of this tank I think - the SD card is plenty big enough - and then I'll see about a suitable 'low pass' smoothing algorithm.
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
bigbadbob76
Registered user
Posts: 1733
Joined: 07 Nov 2016, 14:41
80-90 Mem No: 15707
Location: Isle of Skye

Re: Fuel Gauge/Sender Variants

Post by bigbadbob76 »

All good info there Chris. :ok
But if you avarage out the voltage you still won't get a true level. that's what the gauge does and we know how inaccurate that is. :lol:
I think you need to do a delayed trigger, so
if V>8 for > 1 minute, Led=on.
Even then it might not be great as slosh would stop it triggering when it should.
There's more to this fuel light than first meets the eye, as I've found out myself. :wink:
'86 1.9 DG, 4 spd, tintop, camper conversion.
Split case club member.

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Fuel Gauge/Sender Variants

Post by CJH »

You could be right. Here's the same plot with the average overlaid - it's evidently biased by the high values.

Image

As you say, there's more to it than meets the eye. But I think there are various options. I could give more weight to readings that are the same as several of their immediate neighbours (within a threshold), or I could completely ignore any readings that are more than a certain threshold different from both of their immediate neighbours. Ideally the filtered value should pass though all the points that aren't affected by sloshing. It's easy to see that value in the graph (a shade under 6V), but getting the algorithm to return that value is a challenge.
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Fuel Gauge/Sender Variants

Post by CJH »

Here's a quick and dirty implementation in Excel. I looks at the absolute differences between the last four voltage readings, and if the sum of those absolute values is below a threshold then it averages those four values. If the sum is above that threshold then it keeps the last average value. So it's ignoring any values that aren't the same as the last three neighbours, which seems to effectively ignore the sloshing. The grey line is the result.

Image

Obviously I'll have to see how it fares over a longer period, but I think there's scope for something to work.
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

User avatar
937carrera
Registered user
Posts: 3599
Joined: 05 Apr 2015, 19:29
80-90 Mem No: 16333
Location: N Yorks.

Re: Fuel Gauge/Sender Variants

Post by 937carrera »

Time for a pause ?

Why doesn't the existing fuel gauge work accurately ?

1. Float not in centre of tank
2. Breather tanks allow a lot of slosh with slow return
3. Tank is shallow & wide

I'm not sure that's ever going to be fixed without fundamental redesign.

Back to the low fuel light. How does it work in modern cars. I don't know, but I suspect that it simply looks for a "low" signal then flicks the light on and leaves it on. Is that another approach to consider ? You might need the trigger to be lower than the reserve and depend on an element of slosh to bring it on at roughly the right time ???
1981 RHD 2.0 Aircooled Leisuredrive project, CU engine
1990 RHD 1.9 Auto Sleeper with DF/DG engine

User avatar
CJH
Registered user
Posts: 3018
Joined: 15 Jul 2013, 06:51
80-90 Mem No: 12576
Location: Nottingham

Re: Fuel Gauge/Sender Variants

Post by CJH »

Yep, that seems like a good analysis of why the gauge isn't particularly accurate. The gauge itself attempts to cope with those issues by simply moving the needle very slowly - it's equivalent to a filter with a very long time constant. So with some basic programming it should be possible to reproduce the needle behaviour at the very least. Using a slightly longer period of data, here's a plot of a 30-second average for instance.

Image

But evidently there's more in those sender measurements that we can make use of. Here's a plot where I've attempted to filter out all the 'unreliable' data points. The 'reliable' data points are plotted in green. A data point is deemed 'reliable' if the standard deviation over an 8-second period (4 before and 4 after) is below a certain threshold - in this case I used 0.1V.

Image

I'd say there's a chance that a (weighted) average of those 'reliable' points will give quite a good reading. Of course, it'll depend on whether the 'reliable' data points are representative of the true level - stopping at the lights on a hill for instance would produce a period of 'reliable' points which are wrong - but even that effect could be reduced by averaging the reliable points over a long enough period.
"I'm a man of means, by no means....King of the Road!"

1983 Viking Xplorer, 2.1DJ

Post Reply