• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Arduino Projects / Ultrasonic Fuel Level Indicator Circuit
warning message: electricity is dangerous, proceed with caution
fuel installation

Ultrasonic Fuel Level Indicator Circuit

Last Updated on December 5, 2024 by Swagatam 47 Comments

An electronic device or circuit which detects and indicates the various fuel levels in a fuel tank without a physical contact, through ultrasonic waves, is called an ultrasonic fuel level sensor

Table of Contents
  • Ultrasonic Fuel Sensor Transmitter
  • How it Works
  • How to Mount the Sensors
  • Ultrasonic Fuel Sensor Receiver
  • Circuit Diagram
  • Program Code
  • Useful Calculations

In this post I have explained how to build a simple fuel tank level indicator circuit using Arduino and ultrasonic sensors.

In every vehicle the fuel tank is probably the most important part of the entire system, since the vehicle's operation critically depends on the presence of the tank fuel.

This also means that monitoring the fuel level in the tank becomes an essential factor for the owner or the driver of the vehicle.

Although, most vehicles are already equipped with an advanced digital fuel sensor indicator device, building your own circuit can be a lot of fun and satisfaction.

Warning: This project is only for experimental purpose. It must be done under expert supervision, if actual fuel is used for the tank fluid.

In this article I have explained how to build an LED based fuel indicator circuit using GSM wireless ultrasonic sensors and Arduino.

Ultrasonic Fuel Sensor Transmitter

To build the transmitter circuit, you will need the following modules:

  1. Arduino NANO - 1no
  2. Ultrasonic sensor module HC-SR04 - 1no
  3. nRF24L01 wireless Tx/Rx module - 1no

After programming the Arduino, the modules will have to wired as shown in the following diagram:

Fuel sensor, level indicator transmitter circuit Arduino

The white table at the top left shows how the pinouts of the nRF24L01 module needs to be connected with the Arduino board.

How it Works

As we can see, there are a pair of ultrasonic sensors in the module. One senor sends the ultrasonic frequency or the wave towards the fuel surface. The waves collide with the fuel surface and reflect back towards the module. The reflected ultrasonic waves are captured by the second sensor unit, and sent to the Arduino.

The Arduino compares the reflected ultrasonic time with the reference time of the tank "full height" and creates an estimation of the instantaneous height or the level of the fuel.

The information is then encoded and forwarded it to the nRF24L01 wireless module. The nRF24L01 module finally converts the code into RF signal and transmits it into the atmosphere for the receiver unit to capture the signal.

How to Mount the Sensors

Once assembled, the ultrasonic sensor will need to be installed on the fuel tank in the following manner:

The ultrasonic sensor will need to be installed by inserting the sensing heads through perfectly dimensioned holes, and sealed with appropriate sealing agent.

We can see the tank is specified with two measures, one is the full height, and the other is the maximum or the optimal fuel height inside the tank.

You will have to note these two measures as these will be required to be entered in the program code for the Arduino.

Ultrasonic Fuel Sensor Receiver

For making the fuel sensor receiver you will require the following materials:

  1. Arduino NANO - 1no
  2. Ultrasonic sensor module HC-SR04 - 1no
  3. nRF24L01 wireless Tx/Rx module - 1no
  4. LEDs as shown in the following diagram - 4nos
  5. Piezo buzzer - 1no
  6. 330 Ohm 1/4 watt resistors - 4nos

Circuit Diagram

After programming the various modules may be connected in the following manner:

fuel sensor receiver circuit using Arduino

Here, the nRF24L01 wireless works like a receiver. The antenna captures the RF content transmitted by the transmitter circuit, and sends it to the Arduino. As per the program code, the Arduino analyzes the varying ultrasonic time, and translates it into an incrementing digital output.

This digital output which corresponds with the instantaneous height or the level of the fuel is fed into an LED array. The LEDs in the array respond and illuminate sequentially enabling a direct visual indication of the fuel level to the owner.

The green LEDs indicate a healthy condition of the fuel content. The yellow LED indicates that the vehicle needs a refueling quickly, while the red LED indicates a critical situation, regarding the fuel about to finish. The buzzer now starts buzzing creating the necessary warning alarm.

Program Code

The complete program code for the transmitter and the receiver can be found in the following link:

https://github.com/Swagatam1975/Arduino-Code-for-Fuel-Sensor

You'll need to Change the two example values in the code with the values that you measured for your fuel tank:

// ------- CHANGE THIS -------//
float water_hold_capacity = 1.0; // Enter in Meters.
float full_height = 1.3; // Enter in Meters.
// ---------- -------------- //

Useful Calculations

HC-SR04 Ultrasonic Sensor Distance Calculation

This sensor works by sending sound pulses and measuring the time taken for the echo to return.

Formula for distance:

Distance = (Speed of Sound * Time) / 2

  • Speed of sound at 25°C: 343 m/s = 0.0343 cm/µs
  • Time (t) is measured in microseconds by the Arduino.

Example calculation:

If time (t) = 1000 µs,

Distance = (0.0343 * 1000) / 2 = 17.15 cm

Resistor for LED Current Limiting

To calculate the resistor value for an LED:

R = (Vs - Vf) / If

Where:

  • Vs = Supply voltage (e.g., 5V)
  • Vf = Forward voltage of the LED (e.g. 2V for red LEDs)
  • If = Forward current of the LED (e.g. 20 mA = 0.02 A)

Example calculation:

R = (5 - 2) / 0.02 = 150 Ω

Using a 330 Ω resistor limits the current further ensuring that the LED lasts longer.

Piezo Buzzer Frequency

To generate a tone the frequency is related to the time period:

Frequency = 1 / Period

Example:

To generate a tone at 1 kHz,

Period = 1 / 1000 = 0.001 seconds = 1 ms

Total Power Consumption of LEDs

To calculate the total power consumption of 4 LEDs we use the following formula:

Power = Vs * Total Current

If each LED uses 20 mA (0.02 A):

Total Current = 4 * 0.02 A = 0.08 A

Power = 5V * 0.08 A = 0.4 W

nRF24L01 Power Requirements

The nRF24L01 module requires 3.3V to operate and its current consumption is around 12-15 mA.

You must ensure that the Arduino Nano's 3.3V pin can supply sufficient current.

You'll also like:

  • 1.  Arduino Tachometer Circuit for Precise Readings
  • 2.  LED Lamp Circuit for Motorbike Headlamp
  • 3.  Cell Phone Call Alert Security Circuit
  • 4.  Car Blown Brake Light Indicator Circuit to Detect Broken Bulb Filament Tail Light
  • 5.  Rain Triggered Instant Start Windshield Wiper Timer Circuit
  • 6.  Automotive Sensor Monitor Circuit Diagram

Filed Under: Arduino Projects, Automobile Electronics Tagged With: Fuel, Indicator, Level, Ultrasonic

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!

Previous Post: « Digital-to-Analog (DAC), Analog-to-Digital (ADC) Converter Circuits Explained
Next Post: How Transformers Work »
Subscribe
Notify of
guest
guest
47 Comments
Inline Feedbacks
View all comments

Primary Sidebar

circuit simulator image

Subscribe to get New Circuits in your Email

Categories

  • Arduino Projects (90)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (84)
  • Datasheets and Components (105)
  • Electronics Theory (140)
  • Free Energy (38)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (15)
  • Inverter Circuits (89)
  • Lamps and Lights (142)
  • Meters and Testers (71)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (28)
  • Pets and Pests (15)
  • Power Supply Circuits (89)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (103)
  • SMPS and Converters (31)
  • Solar Controller Circuits (60)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (38)
  • Water Controller (36)

Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • Recent Comments

    • Swagatam on Simple Buck Converter Circuits using Transistors
    • David on Simple Buck Converter Circuits using Transistors
    • Swagatam on Clap Switch Circuits with Relay ON/OFF: [Tested]
    • Mark on Clap Switch Circuits with Relay ON/OFF: [Tested]
    • Swagatam on Boost Converter Calculator

    © 2025 · Swagatam Innovations