Tank sensor

teensy_ino

Active member
Hello forum,

I would like to read a tank sensor with the Teensy 3.5.
The sensor is 2-pole and outputs 40 Ohm (+/-1) when the tank is full and 283 Ohm (+/-6) when the tank is empty.

It is powered by a fixed, stabilized 10 V.

As far as I know, I need another resistor in series with the tank sensor.
How big should it be to be able to use the maximum resolution on the Teensy on the one hand, and not to exceed the 3.3 V on the Teensy input on the other?

Is another series resistor then required on the Teensy input to limit the current?
What is the maximum current that can flow into the digital/analog inputs?
 
You have neglected to say which sensor you have. Can you post a link to its datasheet or product page?
 
You have neglected to say which sensor you have. Can you post a link to its datasheet or product page?
Yes, makes it a bit hard. There are 2 configurations that would work

Going on what I know learned with a sensor like this is that it is basically a 2 pin variable resistor. If the resistor is fed by 10v, then ( hopefully ) you are looking at a voltage divider setup.

One pin is connected to 10v supply and the other pin goes to an analog pin. You then need a 20hm resister from the same pin to GND ( as this forms the other half of the voltage divider cct ). This gives a voltage from .2v - 3.3v. Then its an easy matter of mapping the analog read value to your gauge. You must ensure the 10v supply and the teensy share the same GND or you will get weird results

BUT...it depends on the level sensor, does the sensor use its housing as a GND, because if it does, the then the resistance out is already via the voltage divider that is part of the sensor. Think 3 pin variable resistor where one pin is 10v, the center pin/wipe/arm is the output of the sensor, and the 3rd pin is GND.

I would use this calculator to help with values
 
Hello everyone,

thanks for your answers!
Unfortunately I can't provide a data sheet or a product page - the vehicle is over 40 years old.

The only information that could be found is that of the fuel sender itself.
It is a variable resistor that is driven by a float.
The sensor does NOT use its housing as GND!

I have now heard several very different opinions on the size of the fuel sender resistor in various forums.

These now range from 20 ohms to 2 KOhm.

What is the correct design to be able to use the maximum resolution on the Teensy?
Would the input circuit shown in Tankgeber02.jpg be correct for the Teensy?


What is the maximum current that can flow on the analogue/digital input of the Teensy 3.5?
 

Attachments

  • Tankgeber mit Daten.gif
    Tankgeber mit Daten.gif
    21.4 KB · Views: 21
  • Tankgeber 02.jpg
    Tankgeber 02.jpg
    12.7 KB · Views: 16
OK.

One pin is connected to 10v supply and the other pin goes to an analog pin. You then need a 20hm resister from the same pin to GND ( as this forms the other half of the voltage divider cct ). This gives a voltage from .2v - 3.3v. Then its an easy matter of mapping the analog read value to your gauge. You must ensure the 10v supply and the teensy share the same GND or you will get weird results

Put R1 above R2 ...Basically swap them..

Change R2 to 20 Ohm if you are using 10v

These tank sensors are very common, they get fed anything from 5v to 24v DC

If you need to change the voltage then you only need to change R2

You need to use the LOWEST Resistance value of the sensor to work out R2. This is important

Dont worry about the max resistance of the sensor, it wont really matter. In fact, the greater the resistance range, the better the resolution

Its very simple voltage division.

Current flow wont be a problem as the pin is only reading voltage and its input impedance is way to high to worry about
 
Hello everyone,
Thanks for the info!
Then in the extreme case at an input voltage Ue = 10V, with R2 = 20 Ohm, R1 Tank sensor = 40 Ohm, 167mA would flow... quite a
lot in my opinion.
With R1 = 283 Ohm, 33mA still flows.

In another forum, I was suggested 600 Ohm for R2, for example:
Tank sensor R1 = 283 Ohm, Vout = 3.2V / 11.3mA
Tank sensor R1 = 40 Ohm, Vout = 625mV / 15.6mA

If 576 Ohm (E96) were used for R2, the result would be 3.29V / 11.6mA
Voltage divider calculator

It is therefore still not clear which resistance value is the best choice for the series resistor of the tank sensor!?
What is the correct design?
 
Last edited:
Here is a spreadsheet which will allow you to change series resistor and see effects.
Choose a resistor value which matches a voltage that you would like to see.
NOTE: This spreadsheet will disappear in 7 days time.
Since this is on a vehicle you should put some protection in to protect the Teensy input from voltage spikes.
Vehicle electrics are notorious for voltage spikes/excursions.
 
Thanks for the link!
The online calculators also give the same result.

So the 20 ohms for R2 mentioned above in thread 5 aren't correct after all?

What is the correct value - what is correct now?
 
No, obviously not. Us the spreadsheet, changing the value of the series resistor in cell B1.
The voltages for full and empty will be calculated and shown in Column E.
The minimum safe resistor would be 575 Ohms. This gives an empty voltage of 3.298 Volts. However if it was me I would choose a higher value resistor (giving a lower voltage) to allow for system variations. A value of 680Ohms would give an empty voltage of 2.939V.
 
Thanks for the link!
The online calculators also give the same result.

So the 20 ohms for R2 mentioned above in thread 5 aren't correct after all?

What is the correct value - what is correct now?
You did not reverse R1 & R2. Make the tank sensor R1 and R2 the resistor to GND.

20 Ohms is the correct value for this setup and 600 is the correct value for the other setup.

The results will be inverted when you compare them, Setup 2 would use less current. This has nothing to do with the pin current rating

As I mentioned earlier, there are 2 configurations you can use
 
Back
Top