Go Down

Topic: Reversed potentiometer - VW fuel gauge simulation (Read 1 time) previous topic - next topic

Albercik

Hello All,

I use Arduino for a while now mostly for fun :) What I did was that I've created a project that uses Fiat's Panda instrument cluster for showing data from telemetry server of Euro Truck Simulator 2.

The cluster is fully controlled by CAN network.

However - now I got greedy and started new project based on VW Passat 3C0 (B6) cluster.

Here thing gets complicated. This cluster doesn't support CAN-driven fuel level.

What I know for now is that the cluster has two inputs from fuel level sensor. One for low level, second for full. Between both of them there should be constant resistance of 520 Ohm. Full tank gives (in theory) 520 Ohm on one pin, and 0 Ohm on the second. The less fuel is in the tank - the propotion of resistance changes from 520 to 0 and from 0 to 520. The thir pin in fuel level sensor is connected to ground.

Now - what I want to achieve is to simulate the resistance change on both pins using an Arduino UNO/Mega/Leonardo (have all three of them).

I've been reading of digital potentiometers, but it seems that it's not quite what I'm looking for, as they work in exactly opposite way.

So that's why I'm here - mayby you guys will have some idea on how to solve it?

One thing I've been thinking of was to add two 520Ohm resistors between each cluster pin and connect them to the GND. The third end of the wire - connect to Arduino and write some value to the pin. But I'm not sure if it will work at all. What do you think?

Thank you in advance
Tom

JohnRob

I can't quite envision the sensor interface as you've explained it.   Typical automotive level sensors are on two pins and vary from some low number like 5 ohms or 40 ohms to some high number 500 ohms or 550 ohms.

Whether the resistance rises with increase in fuel level or drops is a choice by the vehicle Mfg.  I don't recall the VW level sender direction off the top of my head.

You can likely simulate the change in resistance by supplying a DC voltage to the input.  This will work to control the indication but it will not be able to compensate for the change in supply voltage to the cluster.

You should also know that many auto mfg tailor the resistance transfer function to compensate for tank shape, so it most likely not be linear.  i.e. at 50% fuel you will likely not get 50% of the resistance.


Please do not PM me with thread based messages.  If your thoughts are worth responding,  the group should benefit from your insight.

Albercik

Tha k you for the replay.

The VW's sensor has three pins assigned. One is constant ground. Between the second and the third - there's a constant resistance of 510 Ohms.

Let's leave the real values of resistance on both pins and let's assume it's working full range.

On one pin (full state) there's a 510 Ohms to GND when tank is full.
On the other (empty state) - it's 0 Ohms to GND.

The less fuel is in the tank - the more resistance values are swapping, but they're constantly giving a 510 Ohms total. So for half tank should be 255 Ohms on both wires. And it is - I've checked it.

I don't quite get the part of supplying a DC to pins. If I'll connect few resistors between those wires and ground - the gauge shows values as desired.

That's the easy part. The problem is that I'd like to be able to control the fuel level gauge using Arduino and no - I'm not gonna use a divider and motor ;)

FantomT

Seems nobody produce 500 Ohm digital potentiometers, the lowest 1k.
What is the voltage applied to pot?

Paul__B

It is common to misunderstand the function of a "digital potentiometer".

These are intended for use as volume controls on audio equipment.  With few exceptions, they are not intended for use at relatively high voltages - such as an automotive 12 V system or - correspondingly - to carry significant current such as for an automotive gauge.

The VW's sensor has three pins assigned. One is constant ground. Between the second and the third - there's a constant resistance of 510 Ohms.
Curious, but not entirely implausible.  How do you know that the wiper is grounded?

If indeed it is definitely grounded, then the gauge is operating in a differential mode where you have two electromagnets pulling in alternate directions.  This may relate to the ability of the gauge to retain the current petrol reading when the ignition is turned off.  More commonly, one of the electromagnets is connected to the sender and the other is simply connected to ignition voltage; again when neither is powered, the needle which has a viscous damper, will not move.

You simply have to provide two control voltages and determine the appropriate relationship for the desired indication.  You can use PWM from one pin with an inverter to provide the opposing signal, and RC filters with op-amps (actually, audio amplifiers such as the LM386 may be better for driving sufficient current) to drive the gauge.

JohnRob

#5
Nov 03, 2018, 04:48 am Last Edit: Nov 03, 2018, 04:59 am by JohnRob Reason: add inline graphic
As I understand your description the level sender looks like this:




Where A to B = 500 ohms

and the wiper (W) varies with fuel level.

This must be the cluster for a recent model year car as all of the older cars were only 2 wires.

There's how I think it is wired:

A = 5V from the cluster
B = Ground at the cluster.
W = some filtering then into an A/D converter in the cluster.

The A/D is measuring the voltage between W to B.  It is using the internal 5V as a reference.  This makes W a percentage of the 5V.  The effect is to cancel out small changes in the 5V from the %age measurement.

What this means is you can put a voltage into W and simulate the voltage that the level sender resistor would send to the cluster.  I would use a 1K Ohm resister in series with any externally applied voltage while testing.

Before you actually try this use some pairs of resistors that add up to approx 500 ohms and verify the voltage on W is what I suggested it be.

Please do not PM me with thread based messages.  If your thoughts are worth responding,  the group should benefit from your insight.

rtek1000

Hello,

I already did something with fuel tank float, and the model I was using had no linear value.

It was more for a logarithmic scale, maybe the best way to find the resistance value, either by reading directly into the tank, leaving the tank with the known fuel level and noting the resistive values.

I had to do eight readings, so I could better understand the scale.

Basically, to read the resistance of the fuel tank float, a constant current source can be used, so to do reverse mode, you can make a variable load, it may be possible to make use of PWM, with transistor in open collector and a capacitive filter to help stabilize the reading.
Please avoid private messages, your question may be someone's answer in the future!

Albercik

rtek1000 - I don't want to read the potentiometer from my car :) I already know how it's working (more or less).

What I'm trying to achieve is to show the fuel level on VWs cluster with values gathered from game (so no physical potentiometer will be used).


At this moment I've measured that on the cluster's pins there's 2,3V voltage. So... Maybe, it's not such a bad idea to use analog pins to write values to it?

rtek1000

#8
Nov 04, 2018, 04:37 pm Last Edit: Nov 04, 2018, 04:38 pm by rtek1000
At this moment I've measured that on the cluster's pins there's 2,3V voltage. So... Maybe, it's not such a bad idea to use analog pins to write values to it?
Hello,

It may be a good idea to use a 10k resistor in series and a 5v1 zener diode to protect the input if unexpected peaks occur, perhaps in future maintenance of electrical wiring. A 100nF capacitor can also be interesting in parallel with the zener diode.

Please avoid private messages, your question may be someone's answer in the future!

JohnRob

I think @rtek1000's idea is sound.  However be careful of effects of low input impedance into the cluster.  Some clusters have input impedance much higher than the 500 ohms of the sensor but lower than the 10K cited.   If this is the case just reduce your 10k resistor and increase the capacitor.

You may also observe slow movement of the fuel gauge to input commands.  This is normal as the fuel level algorithm is one of the most complex in the vehicle, simply to filter out the effects of fuel slosh.

BTW I used to work for a company that mfg fuel tanks, pumps and fuel level senders.   I'm curious, do you know the model year the cluster came from?


John
Please do not PM me with thread based messages.  If your thoughts are worth responding,  the group should benefit from your insight.

Albercik

Ok Guys. I've figured it out and it's working (almost).

I've used a digital potientiometer: X9C102S (1 kOhm, 100 steps).

And here's my setup:
RW pin is connected directly to GND.
RH and RL pins are connected to GND via 470 Ohm resistors and directly to cluster.

INC, CS and UP/DN are connected to the Arduino and simple program moves the wiper from 0 Ohm to 1K and back to 0 Ohm. The gauge is going from up to down and also I can read the value in litres using a VCDS diagnostic interface.

In the first paragraph I've wrote "it's working (almost)". Well almost - because I have now completely no idea on how to set the wiper in desired position. The only option I can think of is iterate over 100 steps down just to be sure it's really down and then increment by the percentage up to the desired position.

Any better thoughts?

JohnRob

My only caution would be to verify  the cluster will operate with a 1K pot instead of the original 500 Ohm.

I would expect the cluster to use the 500 ohm existence as a diagnostic.
Please do not PM me with thread based messages.  If your thoughts are worth responding,  the group should benefit from your insight.

Albercik

#12
Nov 07, 2018, 09:39 pm Last Edit: Nov 08, 2018, 12:09 am by Albercik
My only caution would be to verify  the cluster will operate with a 1K pot instead of the original 500 Ohm.

I would expect the cluster to use the 500 ohm existence as a diagnostic.
Thanks. That's why I've gave those two 470 Ohm resistors from both cluster to gnd so the cluster sees almost correct resistance.

Another problem i non-linearity... :( Uh, my mother told me to learn math in school... :(

That's how it works:
https://youtu.be/tzhW0iHJBTg

Go Up