Built to order

Digital Fuel Gauge using Ultrasonic Sensor and Arduino

This project builds a digital fuel gauge that measures fuel level in a model tank with a waterproof JSN-SR04T ultrasonic sensor and an Arduino Uno, converting echo time into litres shown on a 16x2 LCD with a bar graph and a low-fuel buzzer. The sensor sits above the liquid and never touches fuel, and the student demo uses water in a model tank, never real petrol. Tank calibration with two known volumes turns raw distance into litres. Suitable for B.E./B.Tech final-year projects in Electronics, Electrical and E&TC.

Electronics / E&TC Arduino UnoJSN-SR04T waterproof ultrasonic sensor16x2 LCD displayPiezo buzzerArduino IDE · C/C++ firmware5 V DC power supplyBreadboard jumper wiresModel tank water demoHardware
Digital Fuel Gauge using Ultrasonic Sensor and Arduino — project thumbnail preview
More project photos (2)

The problem

A digital fuel gauge using an ultrasonic sensor and Arduino measures how much liquid sits in a tank without any part touching the liquid, which is the problem with the float-arm gauges fitted in most vehicles: the moving arm wears, sticks and drifts, and the dashboard needle gives only a rough idea of what remains. This project replaces that float with a waterproof JSN-SR04T ultrasonic sensor mounted above the liquid, an Arduino Uno that converts echo time into distance and then into litres, and a 16x2 LCD that shows the level as litres, a bar graph and a low-fuel buzzer alert. The demo runs on a model tank filled with water, never real petrol, so the principle can be shown safely in a college lab. Choosing the waterproof sensor is the central engineering decision: the common HC-SR04 module is not waterproof and must never be mounted inside a fuel tank, while the sealed JSN-SR04T probe is made for wet environments.

SYSTEM FLOW

4 components 3 connections

Live flow
Drag to explore
100%
storageFuel Tank

Model tank; the liquid surface reflects the ultrasonic pulse.

Follow the working sequence

How it works

The digital fuel gauge works as a chain of four conversions: sound into distance, distance into litres, litres into a display, and a low level into an alert. The JSN-SR04T probe above the tank sends a short 40 kHz ultrasonic pulse downward and listens for the echo bouncing off the liquid surface. The Arduino measures the echo travel time and converts it to distance with the relation distance = echo time x speed of sound / 2, halving because the sound travels down and back. That distance is mapped to litres using the two calibration points recorded for the empty and full tank, so the reading reflects the actual tank rather than a guessed formula. Finally the Arduino writes litres and a bar graph to the 16x2 LCD and sounds the buzzer when the level drops below the set threshold.

  1. The JSN-SR04T waterproof probe is mounted at least 25 cm above the highest liquid level in the model tank, facing straight down at the surface.
  2. The probe sends a 40 kHz ultrasonic pulse and the Arduino measures how long the echo takes to return from the liquid surface.
  3. The Arduino converts echo time to distance using distance = echo time x speed of sound / 2, with the speed of sound taken as approximately 343 m/s at room temperature.
  4. The distance is mapped to litres using the two-point calibration (empty distance and full distance) recorded with known volumes of water.
  5. The 16x2 LCD displays the level in litres with a bar graph, and the firmware averages several echoes so ripples do not make the reading jump.
  6. When the level falls below the configurable low-fuel threshold (approximately 20% of capacity), the buzzer sounds until the tank is refilled.

Fuel sensing comparison

Method Principle Touches fuel Moving parts Main accuracy driver
Ultrasonic (JSN-SR04T) Echo time to liquid surface No None Tank calibration and temperature
Float-arm gauge Arm angle as float rises and falls Yes Yes, arm and pivot Mechanical wear and sticking
Capacitive sensing Capacitance change with liquid level Yes, probe in liquid None Liquid properties and probe fouling

Tech stack:

  • Arduino Uno (ATmega328P)
  • JSN-SR04T waterproof ultrasonic sensor
  • 16x2 character LCD
  • Arduino IDE · C/C++ firmware
  • Breadboard · jumper wires
  • 5 V DC power supply
  • Piezo buzzer
  • Model tank · water demo setup
Parameter Value
Controller Arduino Uno (ATmega328P)
Level sensor JSN-SR04T waterproof ultrasonic probe
Sensor frequency 40 kHz (datasheet value)
Sensor range Approximately 25–450 cm (JSN-SR04T datasheet value)
Minimum mounting height 25 cm above highest liquid level (blind zone, datasheet value)
Display 16x2 character LCD (litres + bar graph)
Level accuracy Design target approximately ±5 mm after buyer-run two-point calibration (not a measured claim)
Tank capacity Design target approximately 5–10 L model tank (buyer's tank size may vary)
Low-fuel threshold Configurable, approximately 20% of tank capacity
Power supply 5 V DC via USB or adapter
Connectivity None required — fully offline instrument
Demo liquid Water in a model tank only, never real petrol

Project features

The digital fuel gauge is built around four capabilities that work together: waterproof ultrasonic level sensing that never touches the liquid, a two-point tank calibration that turns raw distance into honest litres, a clear LCD readout with a bar graph, and a low-fuel buzzer that warns before the tank runs dry. A fifth capability, echo averaging, steadies the reading when the liquid surface ripples, and a sixth, dead-zone aware mounting, keeps the sensor in its valid measuring range at every level. The whole instrument is a static tank device with no motors, no chassis and no movement of any kind: it measures, calibrates and displays, which is precisely what separates it from navigation builds that happen to use the same sensor and controller. It runs offline on a simple 5 V supply with no internet and no float to wear out.

  • [Waterproof ultrasonic level sensing] A sealed JSN-SR04T probe mounted above the liquid measures the distance to the surface with 40 kHz sound pulses, so no sensor part ever contacts fuel or water.
  • [Litres readout with bar graph] The 16x2 LCD shows the level in litres alongside a bar graph, so the reading is useful at a glance during a demonstration.
  • [Two-point tank calibration] Empty and full distances are recorded once with known volumes, and the firmware maps every later distance to litres between those two points.
  • [Low-fuel buzzer alert] A buzzer sounds when the level falls below a configurable threshold (approximately 20% of tank capacity), giving an audible warning before the tank empties.
  • [Echo averaging for steady readings] The firmware averages several echoes and rejects stray readings, so ripples on the liquid surface do not make the display jump.
  • [Dead-zone aware mounting] The sensor is mounted at least 25 cm above the highest liquid level, respecting the JSN-SR04T blind zone so readings stay valid across the full tank.
  • [Safe model-tank demonstration] The demo uses a model tank filled with water, never real petrol, with the sensor mounted above the liquid at all times.

What is included

  • Working digital fuel gauge prototype (Arduino, JSN-SR04T probe, LCD, buzzer, model tank)
  • Arduino firmware with calibration and averaging logic
  • Circuit and wiring documentation with connection table
  • Two-point tank calibration procedure with worked example
  • Project report PDF (background, ultrasonic theory, methodology, calibration, results)
  • PPT presentation for final review
  • Viva Q&A preparation document (ultrasonic ranging, calibration, sensor selection)

Limitations & prerequisites

  • Accuracy depends on the buyer's own two-point calibration; no litre accuracy is claimed before calibration is run on the actual tank.
  • The JSN-SR04T has a 25 cm blind zone, so the sensor must stay at least 25 cm above the liquid and very shallow tanks cannot be measured.
  • Readings shift with air temperature because the speed of sound changes; the build assumes steady room temperature and does not include temperature compensation.
  • Ripples, foam or a sloped liquid surface can scatter the echo and make readings unsteady; the demo uses still water.
  • The demo uses water in a model tank only — it is not a certified automotive fuel gauge and must never be fitted to a real petrol tank.
  • The common HC-SR04 module is not waterproof and is not used in this build; substituting it would risk sensor damage and wrong readings.
  • The gauge measures level only; it does not detect fuel quality, contamination or leaks.

Frequently Asked Questions

Why use the JSN-SR04T instead of the common HC-SR04?

The JSN-SR04T is a sealed, waterproof probe designed for wet environments, while the HC-SR04 is an open module that must never be mounted inside a fuel tank or exposed to liquid. The HC-SR04 is specified at 40 kHz, a 2–400 cm range and approximately ±3 mm accuracy (datasheet values), but those numbers do not make it safe near fuel. This build uses the waterproof probe only.

Is this project suitable for a final-year project?

Yes — for Electronics, E&TC and Electrical programs. It demonstrates ultrasonic ranging, sensor selection, tank calibration, embedded display design and alert logic in one compact build, and the calibration procedure gives the student genuine measured results to present and defend in the viva.

Does the demonstration use real petrol?

No. The student demo always uses water in a model tank, never real petrol, and the sensor is mounted above the liquid so it never contacts fuel. This keeps the demonstration safe for a college lab while still proving the full measurement chain from echo to litres.

How accurate is the litre reading?

The litre reading is only as good as the tank calibration, which is why the design target of approximately ±5 mm in level is stated after a buyer-run two-point calibration, not as a measured claim. The student records empty and full distances with known volumes, then reports the accuracy they actually measured on their own tank.

Can the gauge be customized?

Yes. Common additions are a larger or differently shaped tank with its own calibration, a GSM alert when fuel runs low, a bigger display, or logging of level over time. Any addition is quoted separately and is not part of the base build unless agreed in advance.

Does it need internet or a phone to work?

No. The gauge is a fully offline instrument: the Arduino, sensor, LCD and buzzer run on a 5 V supply with no Wi-Fi, no cloud service and no phone app. That makes it reliable for lab demonstrations and simple to explain in a viva.

Components & software requirements
  • Arduino Uno (ATmega328P)
  • JSN-SR04T waterproof ultrasonic sensor
  • 16x2 character LCD
  • Arduino IDE · C/C++ firmware
  • Breadboard · jumper wires
  • 5 V DC power supply
  • Piezo buzzer
  • Model tank · water demo setup
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Get a quotation