Fuel gauge recalibrator project

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Youll get decent components from places like RS online or digikey.

Jaycar caps are crap in my experience, ok for prototyping but if its copping summer heat inside cabin of the car, then spend a bit more on a good brand like panasonic or nippon chemicon.
Thanks Bill. I should have clarified that I do buy stuff from element14 etc, but the delivery fee on top of a small batch of components tends to offset any savings.

Post prototype for this and the cruise control circuit we did, I'll source quality components.
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Do put a small metal piece onto the 7805, you can use it to secure the mounting and they do get hot even at quite low current without any heatsink at all.

I just left the prototype board running off a three cell LiPo which is at 12.3v and just sitting there only doing the resistance calculations the 7805 got quite warm to the touch. Considering the car will be 13.8-14.4v, yeah heat sink required.

Come to think of it, my cruise control prototype circuit is using a 7805 without a heat sink for the last month. It's probably also crying out for some relief.
 

Tony_T

Leaving Skid Marks
Location
Hamilton New Zealand
First Name
Tony
Drive
Legnum VR-4 1997
+1 for Panasonic, they were always my go-to if they were available in the ratings I needed for whatever I was doing.
Yes RS Components or Element 14 (previously called Farnell) are the suppliers I always used. Digikey are a bit of an issue because it looks like they have a presence in NZ due to the URL they use but in actual fact they don't and everything comes freighted from the USA at considerable cost and delay, along with the less than favourable exchange rate. Mouser are the same.
Most stuff from Jaycar is unfortunately crap and with the demise of everyone else that once supplied components they are now the only supplier actually in my city and in many other centres here. I very seldom darken their doorway. So it's the same where you are too? Now I'm retired and don't work somewhere that has an account with RS or E14 I get my auto sparkie mate to order stuff for me when I need it as he does have both accounts and is quite happy to do it since I fix some things for him from time to time.

That location looks ideal and fitment there should be easy, just cut through the bare part of the track (once you have confirmed that it is the right one) then soldering to the two pieces will be easy. One of the other terminals on that little grouping will be the +12 volt feed and there should be plenty of earths close by, maybe on that other PCB.
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
That location looks ideal and fitment there should be easy, just cut through the bare part of the track (once you have confirmed that it is the right one) then soldering to the two pieces will be easy. One of the other terminals on that little grouping will be the +12 volt feed and there should be plenty of earths close by, maybe on that other PCB.

Thinking about this a little more, I'd like to make it into a PCB that can be sold to other VR4 owners. I don't really know how comfortable they would be cutting traces on the cluster, but a cut wire intercept behind the kick panel is an easier, plus it means I can include a switch on the board which enables and disables the intercept. Circuit not working? Hit the switch.

It's highly subjective of course, but if I put it to a vote I wonder what the result would be.

EDIT: I've put it to a vote in the Legnum & Galant Owner's club. Will do the same in the OZVR4 page if it lets me.
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Righto today I filled the tank, fitted a T-piece into the fuel return line and then drained out accurate measurements of fuel. Relatively happy with these measurements (ignoring PWM values as I haven't completed these) but a couple of issues.

First, when I "fill" the tank it ends up with a litre or more up in the filler neck between the tank and the fuel cap. The result of that is that the first few litres of fuel consumption don't affect the rheostat resistances at all. Not a huge issue, as we're not greatly concerned about accuracy at this part of the gauge anyway. This did drive me to add a "Confidence" rating for each measurement though, as it also became an issue at the last 10 litres as I'll describe.

So for the last 10 litres, the problem is that when using a T-piece intercept on the return line of the fuel system, it reduces the return flow, which in turn reduces the venturi effect that pulls fuel from the passenger side of the tank over to the driver's side. As a result, the pump kept starving at about 10 litres left because the driver's side of the tank was basically out of fuel.

What I will have to do is re-fill the tank, re-set the UTCOMP trip computer to show 60 litres of fuel and then drive around until it gets down to about 25 litres remaining and start taking measurements of the resistance every litre or so as shown on the UTCOMP fuel gauge. For those that aren't aware, the UTCOMP measures injector pulse width and has been calibrated to the injectors (read the UTCOMP manual to see how this works).

In the interim, I can start with my measurements and estimates below, and see how I go. You never know, I might have nailed it on the first try.

Obviously I still need to tweak the PWM values for most of the pips before I even do that, but it takes about 2-3 minutes per pip for the needle to move that small distance and I've got 12 left so close to an hour's work to finish up the PWM values.

upload_2021-5-22_15-47-36.png
 

Tony_T

Leaving Skid Marks
Location
Hamilton New Zealand
First Name
Tony
Drive
Legnum VR-4 1997
Well you could intercept the wire at the plug that goes into the cluster, likewise tap onto power and ground on the appropriate plugs.
Otherwise as seen in your photo the gauge connections are made by screws so an insulating bush like those used for TO-220 transistor mounting could be fitted on the screw and solder tags fitted each side to make the connections (a longer screw may be needed).

You posted as I was typing. That chart is looking good!
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Well you could intercept the wire at the plug that goes into the cluster, likewise tap onto power and ground on the appropriate plugs.

I put it to a vote in the Legnum & Galant VR4 owner club and 100% of the votes were to do it in the kick panel (as potential customers/users of this solution).
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Screenshot from one of the videos showing the cut wire. Note I only have the fuel tank side connected and the gauge side (PWM) is not connected at this time as it wasn't what I was focusing on.

I use ferrules for wire termination that goes into these kinds of connector blocks. They are very neat and stop the wire from getting damaged.

upload_2021-5-22_16-10-4.png
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Done some more work on estimates for the table. I've written the basic code for all of this but I'm going to add an OLED display to the Arduino to show the current raw ADC 10-bit value and compare it to known fuel consumed based on my UTCOMP. This is going to make it a lot easier and faster to do the validation. Anywhere on this table for the PWM column in italics is a current guestimate that needs to be validated.

I've converted from using derived voltages in my code to using the raw 10-bit ADC values (0-1023) as it's much easier to work with integers in the code. At some point I'll stop mentioned voltages completely.

upload_2021-5-24_12-9-34.png
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Quick update on how I'm going to properly calibrate the bits of the fuel tank which are tricky unless you're actually driving. I've got this little OLED hooked up to the Arduino so I can compare the accurate consumption and remaining fuel from the UTCOMP against the ADC 10-bit values coming from the fuel tank senders:
tkp5cvbKYzMgM0A4gsnWJwkVJkhagxiZnnSVC7UriqqczbHWkE5R905yYWZyN0hi0eiIu8=w1660-h1245-no?authuser=0.jpg
 

Tony_T

Leaving Skid Marks
Location
Hamilton New Zealand
First Name
Tony
Drive
Legnum VR-4 1997
Going well.
Have you checked using a bench power supply how supply voltage dependent the actual gauge is? I'm wondering if the variation from say 12.6 volts with key on but engine not running to something like 14.4 volts or maybe a bit more with the alternator giving its normal output would be enough to spoil some of your calibration. I'm so surprised that the gauge isn't driven from a regulator as it is very common practice in many vehicles for the cluster to contain a regulator giving something like 10 volts for that reason, but you gave the unloaded voltage as 12.72 so ours must not be which introduces another influence that possibly is adding to the lousy stock calibration.
Why did Mitsi do such a good job with so much of the design of these cars and then skimp on something as basic as a fuel gauge?
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Going well.
Have you checked using a bench power supply how supply voltage dependent the actual gauge is?
No I haven't but it shouldn't matter as I'm just PWM switching whatever voltage I'm getting. Should I calibrate the PWM based on 13.8-14.4v range? We'll see, but I'm operating on the assumption it's some form of magnetic fuel gauge with a control coil and a deflect coil. As both coils are fed the same source voltage, the gauge self-corrects for changes in the source.

I'm wondering if the variation from say 12.6 volts with key on but engine not running to something like 14.4 volts or maybe a bit more with the alternator giving its normal output would be enough to spoil some of your calibration. I'm so surprised that the gauge isn't driven from a regulator as it is very common practice in many vehicles for the cluster to contain a regulator giving something like 10 volts for that reason, but you gave the unloaded voltage as 12.72 so ours must not be which introduces another influence that possibly is adding to the lousy stock calibration.
Why did Mitsi do such a good job with so much of the design of these cars and then skimp on something as basic as a fuel gauge?

If you're that curious, pull your dash cluster out and take a look at it; it's literally a 5 minute job and you'll probably spot a lot more than I would as you know what you're looking for. Heck, maybe you'll find that it is an air core gauge of some form and it's magically not getting upset at my PWM switching.
 

Lasiorhinus

Leaving Skid Marks
Lifetime Member
Location
Darwin
First Name
Stephen
Drive
White FL Legnum
Following this with great interest. Just curious though, it seems your calibration comes from filling to full, and then draining. I note you had issues with the lower end of the tank due to lower venturi pressure.

When I made my calibration card, I started with an empty tank, achieved by running the engine until it ran out of fuel, and then adding fuel in calibrated measures, letting the gauge stabilise and take readings.
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Following this with great interest. Just curious though, it seems your calibration comes from filling to full, and then draining. I note you had issues with the lower end of the tank due to lower venturi pressure.

When I made my calibration card, I started with an empty tank, achieved by running the engine until it ran out of fuel, and then adding fuel in calibrated measures, letting the gauge stabilise and take readings.
Hi mate, I'm just running down the current tank slowly when I can during lockdown, about 2 litres or so at a time. Getting there slowly - just hit half a tank.
 

NSNO_RJB

No Idea what i'm doing
Premium Member
Location
Sydney
First Name
Ronan
Drive
1998 VR4 Galant
im assuming you would rather run the tank down than drain it so the UTCOMP stays accurate and callibrated since thats your reference point? only just simmed through the thread so sorry if i missed you explaining it haha
 

Lasiorhinus

Leaving Skid Marks
Lifetime Member
Location
Darwin
First Name
Stephen
Drive
White FL Legnum
Don't drain it after you run to empty. You want "empty" to be the point where there is no longer enough fuel in the tank to get to the engine. Whatever other unusable fuel remains is, effectively, useless to you, so no point counting it.
 

Kaldek

2 AYC Bars
Premium Member
Location
Melbourne
First Name
Ed
Drive
2000 Legnum VR4 Manual, Ford Territory family runabout, BMW K1300R.
Hello folks, sorry for the extended delay on posts here but 2021 was a real shitshow, especially for my workload at work that basically killed all spare brain capacity for personal projects.

Anyway, I've been using and tweaking the setup for a while now and it still needs a couple of pokes for what needle position to set for a given fuel tank capacity as it's reading a tad low still. However, what I have discovered that is very interesting is the fuel level sensor and gauge behaviour between half and a quarter of a tank. I'll be making and uploading a video on YouTube for this to explain it better, but essentially what happens at this tank level is that it takes a long time for the sensor reading to drop due to the "saddle" tank design that provides space for the driveshaft.

At this fuel level, the upper sensor is bottomed out and the lower sensor (where the fuel pump is located) is almost at the top of its travel. As fuel is used and sent back to the tank, the venturi system is constantly pulling fuel from the left-side of the tank to re-fill the right side. It goes a bit like this:

- Pump pulls fuel from driver's side of tank
- Fuel return line returns unused fuel to driver's side of tank
- As fuel returns, venturi effect sucks fuel from passenger side of tank across to driver's side
- If driver's side fuel level gets above the "saddle" level, the fuel flows back across to the passenger side

This loop keeps happening until the amount of fuel is low enough that there is no longer any excess flow back to the passenger side of the tank over the "saddle". What happens from here is as follows:

- Pump pulls fuel from driver's side of tank
- Fuel return line returns unused fuel to driver's side of tank
- As fuel returns, venturi effect sucks fuel from passenger side of tank across to driver's side
- Fuel level in driver's side stays high until passenger side drops below level that venturi effect can pull fuel from that side (i.e. the passenger side of the tank is essentially empty)
- The passenger side low fuel light circuit switch is activated, allowing the low fuel light circuit to be active (note, it does not activate the light, it just allows the light to activate)

And from this point, what happens is that the driver's side fuel level sender will start to drop. Along with that gauge sender is the low fuel light sender. As the fuel level drops enough, this rheostat allows the low fuel light to start to glow. The lower the sender, the brighter the glow of the low fuel light.

What all of this means is that I just need to make sure the fuel gauge is reading close enough to empty that when the low fuel warning light comes on, you aren't having a mental argument about why this would be happening "when the gauge isn't near empty". I could easily intercept and falsify the low fuel light signal as well, but I won't be doing that. If you think about it, many modern cars alert you for low fuel at crazy levels like even when you could drive another 100km. The VR4 is no different here.
 

kc427

Leaving Skid Marks
Lifetime Member
Location
HK
First Name
KC
Drive
VR4
Just start following this.

Ed, saw from your photos on previous posts and saw that you are using Leonard. You can consider using Nano Every, which is cheaper and also much much smaller that can be placed easier.

Also, from your schematic, you use 7805 to supply 5v to the board and as the reference. If using the Nano Every, I guess you can simply supply 12v directly to the Vin of the board, and the board itself has regulated 5v and 3.3v output, so that you can use that regulated 5v to connect to the 100 ohm. In that case, you don't need the 7805 and the cap at all.
 

kc427

Leaving Skid Marks
Lifetime Member
Location
HK
First Name
KC
Drive
VR4
You can see there is 5v and 3.3v output for the Nano Every, and Vin is anything 7-21v.

Pinout-NANOevery_latest.png
 
Top Bottom