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 »

Hmm - if we want to get really techy, we could use Arduino tilt sensors to exclude any measurements affected by cornering, braking, accelerating, driving on hills etc. Only 'straight and level' measurements would get through :D .
"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 »

You wouldn't be left with much data on the roads round here. :lol: :lol:
You've lost me with the algorithms, I'm a hardware guy. Good work though mate. :ok
I'm hoping my hardware version will work this time, but waiting for an emptyish tank is a slow process even with a thirsty van.
'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 »

bigbadbob76 wrote:You wouldn't be left with much data on the roads round here. :lol: :lol:

That seems to be case even on normal urban roads around Nottingham. But the good thing is that the fuel level doesn't change rapidly, so one or two reliable level measurements every few minutes will be more than enough.

bigbadbob76 wrote:I'm hoping my hardware version will work this time, but waiting for an emptyish tank is a slow process even with a thirsty van.

I think the 1Hz voltage readings give a good indication of the problems that a hardware solution faces. I'm surprised how often my sender appears to show 'empty' briefly, even when I've got more than half a tank full. I only have to pull off from a standstill for the voltage to jump to it's maximum value of just over 8V.
"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 »

CJH wrote:Hmm - if we want to get really techy, we could use Arduino tilt sensors to exclude any measurements affected by cornering, braking, accelerating, driving on hills etc. Only 'straight and level' measurements would get through :D .

A 3-axis accelerometer looks like a better solution: https://www.amazon.co.uk/DFRobot-Triple ... B00G3IJVXU" onclick="window.open(this.href);return false;

Image

The program could then have a threshold for acceleration in any axis above which the fuel sender reading would be ignored.
"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 »

Now you're getting serious. :lol:
'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 »

bigbadbob76 wrote:Now you're getting serious. :lol:

You mean I'm getting carried away. I bought a couple of these for playing with.

Image

They're tiny. I'll start by just logging the output alongside the fuel sender voltage, so that I can see how it performs. I suspect that even when the accelerometer says there's no acceleration, the fuel may take a second or two to stop sloshing about. So there'll be some tuning required, but with a bit of luck I can make a reliable digital fuel gauge out of it.
"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 »

I haven't made a start with the accelerometer (Busfest!), but I've continued to capture the voltage across the sender in the meantime. I filled the tank the day before setting off for Busfest, and this is what the readings look like so far. The blue dots are the raw 1-second measurements, and the orange line is the average of the last two minutes of data points - a crude smoother.

Image

Busfest is a two-hour journey from Nottingham. Or at least it should be. On the way there on Friday morning the A42 was closed because a van had crashed into the railings on one of the roads that passes over the A42 and had knocked part of the barrier onto the road below. So I was in near-stationary traffic for about an hour and a half - starting the engine to inch forward every now and then. It's interesting that you can see this period in the orange trace on the graph: between about 75 minutes and 110 minutes was the worst bit, when I first joined the queue and there was virtually no movement. It's also worrying that just starting the engine every now and then was enough to show a measurable change in the sender voltage. During that hour and a half the voltage increased by about 0.7V!

Other things to note:
1) When the tank is completely full, the minimum voltage, ~4V, is almost exactly half the maximum voltage.
2) When the tank is full, the sender output is really stable - sloshing has almost no effect, as you'd expect.
3) As the tank starts to empty, there are definite bands in the measured voltage. For instance, there's a prominent gap between 5.95V and 6.07V, which may indicate wear or dirt on the sender windings.
4) There are no measurements between 7.3V and the 'empty' value of 8.04V. I suspect this may be the difference in resistance between the end of the sender windings and an end stop.
5) Even the crude 2-minute average seems to show quite a good representation of the decreasing fuel level.

I am still planning to log the accelerometer output alongside the sender voltage, as I do think that it will be a good way to eliminate any sender measurement that's affected by any sort of acceleration. I expect the orange line to look a lot smoother after that.
"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 »

I made some progress with the accelerometer this evening.

Image

I can now read the raw x, y and z acceleration values. So I'll add this code to the fuel sender voltage logging code and then use the accelerometer values to filter the sender output.

The accelerometer seems to have a non-negligible offset in each axis, so that it doesn't read zero when there's no acceleration (even when accounting for a component of gravity due to it not being perfectly level). But since I won't be mounting it perfectly level, just rigidly fixed to the dash somehow (maybe just Blutac at first), the offset doesn't matter. I'll simply put the van on a level bit of road and record the outputs for a few seconds, so that I can treat those outputs as my 'zero'. Then I'll exclude the fuel measurements where the acceleration is too far from zero - threshold to be determined by experiment.
"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 »

watching with interest. :ok
'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 »

At last I can update my version of this.
It's taken me a while to use a tank of fuel as I've not been using the van much.
Using the 2200uF capacitor in place of the 220uF one works well.

Image

My gauge is just above the top of the red, on the level and driving round bends/up and down hills etc the light is off.
If I park on a hill such that the needle drops into the red the light comes on.
I reckon this is the best I can achieve with the stock sender and it's working as well as I need.
If you get any boards made Chris, my capacitor is 16.2mm diameter, 8mm pin pitch. :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 »

bigbadbob76 wrote:At last I can update my version of this.

I missed this! This seems like a great result. I'm getting through my stocks of dashboard PCBs so will have to place another order soon, and that would be a good time to get some boards made for your circuit.

My day job has been taking up much of my spare time recently, so I've not been able to do much with my Arduino setup. I did get it to record the accelerometer outputs alongside the fuel gauge voltage - it even displays the accelerometer outputs on the little display screen, and I noticed shortly after fitting it that the 'zero' readings were all over the place. I think the gaffer tape that I used to fix the accelerometer board to the binnacle must have come unstuck, so it's flapping about on the end the wires! So the data I've collected over the last tankful will be useless. Oh well.
"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 »

bigbadbob76 wrote: If you get any boards made Chris, my capacitor is 16.2mm diameter, 8mm pin pitch. :ok

That's a big fella! It would swamp my little board outline that I made to fit behind either a non-tacho fuel gauge...
Image

...or a tacho version.
Image

Replacing a few components with surface mount wouldn't help much, as I need room for the DIP8 chip, the variable resistor and the terminal block. I found this version at RS: 10mm diameter, 5mm pin pitch.

Image

Will that version be OK? I had a quick go at laying out your circuit based on this 10mm capacitor.

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 »

Looks good Chris, that one will be fine, it just needs to provide the delay.
Mine was just one I had and is a high quality/low ESR one so is physically bigger.

I havn't done any more with my arduino stuff either, the distance logging isn't working as expected so I need to re-visit it at some point but I'm not in any rush.
'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've tidied up the layout a bit, so after I've checked for blunders (like 'have I got the gauge terminals the right way round?') this one should be ready to order. I've ordered a few samples of that MC3423 IC, and will check what other components are needed so I can order them at the same time as the PCB.

I assume the variable resistor is there to adjust the point at which the LED triggers - any idea what value you've ended up setting it to?

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 »

Looking good!!
I'll check the resistor tonight, IIRC I have a fixed value in there.
The VR was to allow for different sender resistances but I think we've established that the senders are all the same.
It also allows you to set the trigger point you want. I went with the top of the red portion of the gauge scale but others may wish to adjust that.
Up to you if you include it. :D
'86 1.9 DG, 4 spd, tintop, camper conversion.
Split case club member.

Post Reply