Now that I have a very accurately calibrated UTCOMP in the car, I have some interesting pictures to show you.
I noticed that the top half of the gauge for accuracy wasn't too far off. At 23 litres consumed, the gauge was slightly above the halfway mark - close to being accurate. But at ~29 litres consumed, it has dropped by a quarter of a tank reading. Six litres for a quarter of a tank!! My target calibration is one needle "notch" per every three litres, whereas here between halfway and one quarter, it has moved almost five notches. That should normally require a consumption of 15 litres - more than double what was actually consumed to make the needle drop this far.
The UTCOMP gauge works automatically - you just fill up the fuel tank and tell the UTCOMP that you have filled it. It's in the manual.Hi ed, which wire to tap on dash for utcomp fuel sensor? i like it. is utcomp read the remaining gas on tank accurately?
Project on hold while I get my head around switching the ground side of the circuit using a transistor controlled by the Arduino.
Firstly the 'low fuel' warning runs from a float switch alongside the fuel gauge variable resistor, it's a totally separate circuit and just switches to ground when the fuel is below its threshold. I have not seen two senders in series.
Second the fuel gauge sender variable resistor has one end grounded and just a single wire out of the tank to drive the gauge so will not work with your circuits above where you need access to both ends of the resistor. You could switch the positions of your 220 ohm resistor and the variable to overcome that, but you'd need to rewrite your code since the voltage at your analogue input will go down with increasing fuel level not up as your current circuit does. 220 ohms may not give a satisfactory range either, some experimentation will be needed and remember the lower you make that resistor the more current will be drawn from your 5 volt supply so it will need to be adequate.
I agree that avoiding PWM is a good idea because the pulses will cause radio interference for sure unless you fit harmonic filtering on the lead to the gauge and any capacitor(s) used for such filtering will cause additional load on your MOSFET, however power MOSFETs are not really suited for linear applications so you'd need to include a feedback loop to stabilise it (put your 3.3 ohm resistor in the source rather than the drain and feed the voltage across it back into another analogue input, this may still be useful for a PWM solution).
Another thing to be aware of is that you need to provide transient protection on the power feed to your chip. In automotive applications where DC motors are being switched on and off (especially the starter motor) it is not unknown for spikes of some 200 volts to exist on the nominal 12 volt supply, that would be instant death for your chip.
No need to shut up, this is actually helpful.I think the bad non-linearity really results from the very unusual shape of the tank itself and with the inevitable variation of individual senders I'd expect your board will need calibration in the code for every combination of tank and sender so probably not a generally marketable product.
Why not leave the sender unit as original with the end earthed? You can surely rework the code for falling voltage with increasing fuel level, otherwise use an LM358 op amp to invert the signal (and amplify if wished); they're very small and inexpensive and being double you could use the second section to amplify feedback so allowing a lower resistor in the MOSFET source.
Anyway I'll shut up and let you get on with it.
you can make a variable resistance from a MOSFET operating in linear mode if you do have a current sense resistor in its source and feed that voltage across the resistor back to maintain it
again an LM358 op amp could be useful since the voltage across the resistor would be small and you could make the op-amp / MOSFET combination simply a buffer driven by an analogue output from your chip, this would also overcome the approx. 2.5 volts gate threshold voltage (logic level MOSFET) so your chip's output could start at close to zero volts