# Fuel Tank Level

**URL:** <https://discourse.nodered.org/t/fuel-tank-level/70661>\
**Category:** General\
**Created:** [15 November 2022 16:52 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661 "2022-11-15T16:52:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://discourse.nodered.org/u/pierrot)\
**Post date:** [15 November 2022 16:52 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/1 "2022-11-15T16:52:34Z")

</div>

Hello all  
anyone can help with his experience in installing fuel level sensor for a fuel tank ?  
there is the contactless level sensor but dont know if it will work with rpi - node red

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [15 November 2022 17:12 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/2 "2022-11-15T17:12:28Z")

</div>

What sensor are you using?

---

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://discourse.nodered.org/u/pierrot)\
**Post date:** [15 November 2022 17:13 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/3 "2022-11-15T17:13:29Z")

</div>

i am asking what kind of sensor should be used

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [15 November 2022 17:21 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/4 "2022-11-15T17:21:38Z")

</div>

My apologies, I misread your post.

---

<div class="post-metadata">

**Author:** ![madhouse](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@madhouse](https://discourse.nodered.org/u/madhouse)\
**Post date:** [15 November 2022 17:38 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/5 "2022-11-15T17:38:52Z")

</div>

That's a difficult question to answer because it's not so much what sensor can be used with the fuel tank, it's what sensor can your computer read? There are tens, if not hundreds of thousands of sensors you can pick from. If you're using just a Raspberry Pi, you have a few digital options. If you're using an ADC HAT with a Raspberry Pi, you have even more options because now you can read analog. If you have a universal input module that can read voltage, current or 4/20 signals and send the signal over something like RS232, MODBUS or ethernet, you have even more options of using industry standard sensors. That's the real question is what kind of sensor are you able to connect to?

If you're really trying to keep it cheap, you may want to invest in a Pi Pico for its analog inputs and use a basic analog rheostat based level sensor. If you want it simple, look for a contactless level sensor that has digital outputs for something like the Pi or Arduino. If you want programming simplicity, [this sensor](https://www.instrumart.com/products/46072/apg-mnu-is-modbus-ultrasonic-level-sensor?gclid=CjwKCAiAjs2bBhACEiwALTBWZRuD8RvGehq62rPSIXftV95-nWOLw1N7bKaCL_ISijcUDP9iXvzFrBoCr1gQAvD_BwE) wires to the serial port through RS485 protocol to read the sensor over MODBUS which has nodes in Node-Red. There's several sensors like that as well. You could also get a reader that reads analog and transmits the data over serial.

Starting with the sensor is a very difficult place to start. It's much easier to start with the interface as that will narrow your field you can look at significantly. Once you have that field narrowed down, start thinking of what type of sensor you want to use like float based or contactless. Then narrow it down even more.

Make sense?

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [15 November 2022 17:46 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/6 "2022-11-15T17:46:24Z")

</div>

I am assuming you mean a fuel storage tank for a house - **not a vehicle.**

You could also use an ultrasonic sensor, like the HC-SR04 to measure distance to the surface of the fluid.

> **[Ultrasonic Distance Sensor (HC-SR04)](https://thepihut.com/products/ultrasonic-distance-sensor-hcsr04?variant=1054704288&currency=GBP&utm_medium=product_sync&utm_source=google&utm_content=sag_organic&utm_campaign=sag_organic&gclid=CjwKCAiAjs2bBhACEiwALTBWZfVmobKgm8W1xe1-yyTFHYWEbWS8cOcKBTD4gYNVh59mjVlzkfyGKRoC-rkQAvD_BwE)**
>
> The HC-SR04 Ultrasonic Range Sensor uses non-contact ultrasound sonar to measure the distance to an object - they're great for any obstacle avoiding systems on Raspberry Pi robots or rovers!The HC-SR04 consists of two ultrasonic transmitters...

Then knowing the depth of the tank and its shape, you could work out the volume of liquid.

I think @BartButenaers has been working on a node to do the calculations.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [15 November 2022 17:49 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/7 "2022-11-15T17:49:34Z")

</div>

> [@dynamicdave](#):
>
> Then knowing the depth of the tank and its shape, you could work out the volume of liquid.

And there's a node for doing just that:

> **[node-red-contrib-tank-volume](https://flows.nodered.org/node/node-red-contrib-tank-volume)**
>
> A Node-RED node to calculate the volume of different tank types

---

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://discourse.nodered.org/u/pierrot)\
**Post date:** [15 November 2022 18:48 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/8 "2022-11-15T18:48:35Z")

</div>

yes i used this sensor before with water tank but with time it was damaged . so it will not work well with fuel tank

---

<div class="post-metadata">

**Author:** ![vanPir](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@vanPir](https://discourse.nodered.org/u/vanPir)\
**Post date:** [15 November 2022 18:49 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/9 "2022-11-15T18:49:26Z")

</div>

In my van I have a water tank over my wheel arch. So I needed something to determine the remaining water for a non-linear tank. I am using a standard 0-10psi pressure sensor. The sensor is attached to a brass pipe, leaving only the bottom cross section open. If water is filled-up/drained the air column gets compressed. This pressure I am reading. The output is an 0.5 to 4.5V signal. You put this signal into an ADS1115 analogue/digital converter. The ADS connects via I2C to your RPi and has a 16-Bit resolution. From here you can have the readings in Node Red. There is a ADS1115 Node (which I am using) put a function node behind it and to your voodoo. (Pressure sensor rd. 15USD, ADS1115 rd 5USD).

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [15 November 2022 18:56 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/10 "2022-11-15T18:56:50Z")

</div>

I did some experiments some time ago with this one:

> **[3.21US $ |Waterproof Ultrasonic Sensor Module Jsn-sr04t Jsn-sr04t-3.0 Jsn...](https://www.aliexpress.us/item/2255800116569104.html?gatewayAdapt=nld2usa4itemAdapt&_randl_shipto=US)**
>
> Smarter Shopping, Better Living! Aliexpress.com

I haven't installed it yet inside the fuel tank, so cannot tell you whether it has accurate measurements (e.g. by reflections inside the tank).

You might search this forum for other discussions about the same topic. For example in [this](https://discourse.nodered.org/t/announce-node-red-contrib-tank-volume-beta/47101) discussion you can find some ideas from other users about their level sensors.

Bart

---

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://discourse.nodered.org/u/pierrot)\
**Post date:** [15 November 2022 19:04 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/11 "2022-11-15T19:04:46Z")

</div>

yes it makes sense too much .  
if i want to use the Non-Contact Ultrasonic Fuel Level Sensor UL212-F , what equipment's should be installed with in order to connect it via my rpi .  
have you used that sensor before ?

---

<div class="post-metadata">

**Author:** ![Rgrove](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rgrove](https://discourse.nodered.org/u/Rgrove)\
**Post date:** [15 November 2022 19:17 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/12 "2022-11-15T19:17:30Z")

</div>

I'm using a JSNSR04T in the top bung of a household heating oil tank. Over a year and working fine so far.  
I used PVC pipe fittings to mount the sensor and loosely seal it in to the tank, then a porthole connector to maintain the seal while getting connections through.

One day I'll be wealthy enough to fill the tank and calibrate the sensor for full... 😁

---

<div class="post-metadata">

**Author:** ![madhouse](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@madhouse](https://discourse.nodered.org/u/madhouse)\
**Post date:** [15 November 2022 19:32 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/13 "2022-11-15T19:32:15Z")

</div>

According to the documentation I could find, that sensor is an resistance-mimicking sensor that is meant to replace typical automotive sensors. In order to use it, you would need something like an ADC setup with some added circuitry to read the voltage difference or have some kind of current sensor to read using the ADC. Nothing on the Pi will natively support that connection.

---

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://discourse.nodered.org/u/pierrot)\
**Post date:** [15 November 2022 19:32 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/14 "2022-11-15T19:32:43Z")

</div>

do you have any pictures of the installation and how did it is mounted ?

---

<div class="post-metadata">

**Author:** ![pierrot](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pierrot](https://discourse.nodered.org/u/pierrot)\
**Post date:** [15 November 2022 19:36 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/15 "2022-11-15T19:36:32Z")

</div>

because i want to see the level remotely and there is rpi in the site connected to internet with node red installed thats why i am asking about sensors and what could be the perfect solution

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [15 November 2022 19:41 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/16 "2022-11-15T19:41:03Z")

</div>

> [@Rgrove](#):
>
> I'm using a JSNSR04T

That looks very interesting!

---

<div class="post-metadata">

**Author:** ![Rgrove](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rgrove](https://discourse.nodered.org/u/Rgrove)\
**Post date:** [15 November 2022 19:46 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/17 "2022-11-15T19:46:36Z")

</div>

Well, I can try to remember tonight when I get home, but off the top of my head, I don't actually remember how I set it up. In thinking it through, I have the data signal going to an Arduino or ESP8266, then that feeds MQTT and picked up by NodeRed. I believe mine has a high/low output, with time/duration of one being the measurement. IE, longer high output means longer distance, which in turn, means tank level.

---

<div class="post-metadata">

**Author:** ![madhouse](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@madhouse](https://discourse.nodered.org/u/madhouse)\
**Post date:** [15 November 2022 19:47 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/18 "2022-11-15T19:47:54Z")

</div>

Yep. I'm going to make a vote for Rgrove's solution. That's probably going to be your easiest and quickest implementation without using an ADC and a 0-5V sensor or something similar. I found one in a few seconds on [Amazon](https://www.amazon.com/Waterproof-Ultrasonic-JSN-SR04T-Integrated-Transducer/dp/B07FQCNXPP) for sale. And it's a lot cheaper than the one you were already looking at.

---

<div class="post-metadata">

**Author:** ![madhouse](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@madhouse](https://discourse.nodered.org/u/madhouse)\
**Post date:** [15 November 2022 19:50 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/19 "2022-11-15T19:50:52Z")

</div>

> [@Rgrove](#):
>
> In thinking it through, I have the data signal going to an Arduino or ESP8266, then that feeds MQTT and picked up by NodeRed.

Depending on how the implementation works, you shouldn't need any extra hardware. You may just be able to interface directly to the sensor in Node-Red using an appropriate node set to make it work. But with it interfacing directly to a Pi, the most you would need is a script external to Node-Red piping values either into a file or onto some kind of hook like MQTT or HTTP for Node-Red to pick up. It shouldn't be difficult at all.

---

<div class="post-metadata">

**Author:** ![Hubertus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hubertus/32/10077_2.png) [@Hubertus](https://discourse.nodered.org/u/Hubertus)\
**Post date:** [15 November 2022 20:15 UTC](https://discourse.nodered.org/t/fuel-tank-level/70661/20 "2022-11-15T20:15:28Z")

</div>

Hi, i use FullUp [https://fullup.io/](https://fullup.io/) and i use the following flow - please change your e-mail, password and tank-id. The token ist stored in global.json - change it if it is nessesarry

```auto
[
   {
      "id":"611eaa48.5fc3c4",
      "type":"inject",
      "z":"f411c63.c69fc38",
      "name":"FullUp Access Token erzeugen / 24 Std.",
      "repeat":"86400",
      "crontab":"",
      "once":true,
      "onceDelay":"30",
      "topic":"FullUp Access Token erzeugen",
      "payload":"",
      "payloadType":"date",
      "x":280,
      "y":120,
      "wires":[
         [
            "3d104579.bc7a2a"
         ]
      ]
   },
   {
      "id":"7a0b52bb.fe6ecc",
      "type":"inject",
      "z":"f411c63.c69fc38",
      "name":"FullUp Abfrage Regentonne / 10 Min.",
      "props":[
         {
            "p":"payload"
         },
         {
            "p":"topic",
            "vt":"str"
         }
      ],
      "repeat":"600",
      "crontab":"",
      "once":true,
      "onceDelay":"60",
      "topic":"FullUp Abfrage Regentonne",
      "payload":"",
      "payloadType":"date",
      "x":270,
      "y":280,
      "wires":[
         [
            "46515ef4.dabf"
         ]
      ]
   },
   {
      "id":"46515ef4.dabf",
      "type":"function",
      "z":"f411c63.c69fc38",
      "name":"Abfrage Regentonne",
      "func":"var FullUp=global.get('FullUp') || {};\n\n//msg.payload = \"data to get\";\n//msg.headers = {};\n//msg.headers['Authorization'] = FullUp.token;\n//msg.headers['Content-Type'] = \"Application/json\";\n\n// Tank-ID der Regentonne\nmsg.payload = 'your-tank-id';\n//msg.payload['language'] = 'de';\n\n\nmsg.headers ={};\nmsg.headers={\n 'Accept':'application/json, text/plain, */*',\n 'Authorization': 'bearer '+FullUp.token,\n 'DNT': '1',\n 'Origin':'https://app.fullup.be',\n 'Referer':'https://app.fullup.be/'\n};\n\nreturn msg;\n\n\n",
      "outputs":1,
      "noerr":0,
      "initialize":"",
      "finalize":"",
      "x":600,
      "y":280,
      "wires":[
         [
            "464a9a41.ee1254",
            "1191807d.f98a9"
         ]
      ],
      "info":"\"success\": true,\r\n \"result\": [\r\n \"your-tank-id\",\r\n \"your-tank-id\"\r\n]\r\n}"
   },
   {
      "id":"3d104579.bc7a2a",
      "type":"function",
      "z":"f411c63.c69fc38",
      "name":"Abfrage FullUp Access Token",
      "func":"msg.payload = \"data to post\";\nmsg.payload = {};\nmsg.payload['password'] = 'your-password';\nmsg.payload['email'] = 'your-access-email';\nmsg.payload['language'] = 'de';\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "initialize":"",
      "finalize":"",
      "x":620,
      "y":120,
      "wires":[
         [
            "3e53fc03.6d7944",
            "1191807d.f98a9"
         ]
      ]
   },
   {
      "id":"3e53fc03.6d7944",
      "type":"http request",
      "z":"f411c63.c69fc38",
      "name":"Neuer FullUp Access Token",
      "method":"POST",
      "ret":"obj",
      "paytoqs":"ignore",
      "url":"https://api.fullup.be/auth/generate",
      "tls":"",
      "persist":false,
      "proxy":"",
      "authType":"",
      "x":920,
      "y":120,
      "wires":[
         [
            "7f7ff4fd.45aafc"
         ]
      ]
   },
   {
      "id":"464a9a41.ee1254",
      "type":"http request",
      "z":"f411c63.c69fc38",
      "name":"Fullup Tanks abfragen",
      "method":"GET",
      "ret":"obj",
      "paytoqs":"ignore",
      "url":"https://api.fullup.be/tanks_public/{{{payload}}}",
      "tls":"",
      "persist":false,
      "proxy":"",
      "authType":"",
      "x":900,
      "y":280,
      "wires":[
         [
            "1191807d.f98a9",
            "cb4043fc.aec76",
            "d2aa37cd3b7a8cde"
         ]
      ],
      "info":"_public/:your-tank-id\your-tank-id"
   },
   {
      "id":"7f7ff4fd.45aafc",
      "type":"function",
      "z":"f411c63.c69fc38",
      "name":"FullUp Token speichern",
      "func":"var FullUp=global.get('FullUp') || {};\n\nif (msg.statusCode === 200) {\n\n FullUp.token = msg.payload.result.token;\n FullUp.refresh_token = msg.payload.result.refresh_token;\n FullUp.token_expiration_date = msg.payload.result.token_expiration_date;\n FullUp.refresh_token_expiration_date = msg.payload.result.refresh_token_expiration_date;\n\n global.set('FullUp',FullUp);\n}\n\nreturn msg;",
      "outputs":1,
      "noerr":0,
      "initialize":"",
      "finalize":"",
      "x":1210,
      "y":120,
      "wires":[
         [
            "1191807d.f98a9"
         ]
      ]
   },
   {
      "id":"cb4043fc.aec76",
      "type":"function",
      "z":"f411c63.c69fc38",
      "name":"Move Volume to msg.payload",
      "func":"var tmsg = {payload:msg.payload.result.current_temperature};\nmsg.payload = msg.payload.result.current_volume;\ntmsg.topic = \"Regentonne_Temperatur\";\nmsg.topic = \"Regentonne_Liter\";\nreturn [msg,tmsg];\n\n",
      "outputs":2,
      "noerr":0,
      "initialize":"",
      "finalize":"",
      "libs":[
         
      ],
      "x":1230,
      "y":280,
      "wires":[
         [
            "30497b55.7c32b4",
            "7a40312.01b3ed"
         ],
         [
            "bae9b305.a0976",
            "7a40312.01b3ed"
         ]
      ]
   },
   {
      "id":"30497b55.7c32b4",
      "type":"ui_gauge",
      "z":"f411c63.c69fc38",
      "name":"Wasser",
      "group":"af6bf752.d0f218",
      "order":1,
      "width":3,
      "height":3,
      "gtype":"wave",
      "title":"Wasser",
      "label":"Liter",
      "format":"{{value}}",
      "min":0,
      "max":"350",
      "colors":[
         "#00b500",
         "#e6e600",
         "#ca3838"
      ],
      "seg1":"",
      "seg2":"",
      "className":"",
      "x":1520,
      "y":280,
      "wires":[
         
      ]
   },
   {
      "id":"bae9b305.a0976",
      "type":"ui_gauge",
      "z":"f411c63.c69fc38",
      "name":"Temperatur",
      "group":"af6bf752.d0f218",
      "order":2,
      "width":3,
      "height":2,
      "gtype":"gage",
      "title":"Temperatur",
      "label":"°C",
      "format":"{{value | number:1}}",
      "min":"-20",
      "max":"50",
      "colors":[
         "#3553d5",
         "#1aa835",
         "#d0121b"
      ],
      "seg1":"",
      "seg2":"",
      "x":1530,
      "y":320,
      "wires":[
         
      ]
   },
   {
      "id":"af6bf752.d0f218",
      "type":"ui_group",
      "name":"Regentonne",
      "tab":"244dc147.b1cd1e",
      "order":2,
      "disp":true,
      "width":"6",
      "collapse":false
   },
   {
      "id":"244dc147.b1cd1e",
      "type":"ui_tab",
      "name":"Garten",
      "icon":"fa-tree",
      "order":20,
      "disabled":false,
      "hidden":false,
      "info":"mdi"
   }
]

```

[Next page](https://discourse.nodered.org/t/fuel-tank-level/70661.md?page=2)
