• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

Circuits for Beginners | Basic Circuits | LED Driver | Hobby Circuits | Transistor Circuits

New-Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos

You are here: Home / Arduino Engineering Projects / Ultrasonic Fuel Level Indicator Circuit

Ultrasonic Fuel Level Indicator Circuit

Last Updated on June 15, 2021 by Swagatam 17 Comments

ask questions through 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

In this post we learn 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 we will learn 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.
// ---------- -------------- //

get free help for circuit diagrams

You'll also like:

  • 1.  Arduino PWM Signal Generator Circuit
  • 2.  Infrared Remote Control Safe Lock Circuit
  • 3.  How to Make a Car Power Window Controller Circuit
  • 4.  Playing a Melody Using the Tone() function in Arduino
  • 5.  Mp3 Player Using DF Player – Full Design Details
  • 6.  4 Solid-State Car Alternator Regulator Circuits Explored

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Subscribe for the Latest Posts


 

Reader Interactions

Comments

    Have Questions? Please post your comments below for quick replies! Comments should be related to the above artcile Cancel reply

    Your email address will not be published. Required fields are marked *

  1. Jose says

    March 30, 2022 at 3:57 am

    Great job, but I have a question. What is the maximum distance it can detect? I have a fuel oil tank and at least it has to detect me 155cms, I suppose that this sensor is not viable? with the same circuit can I use another? Thanks.

    Reply
    • Swagatam says

      March 30, 2022 at 10:39 am

      I think 155 cms is quite feasible using this circuit. You can try it and check the response!

      Reply
      • Jose says

        April 2, 2022 at 3:04 am

        Thanks!

        Reply
  2. Jukka says

    January 11, 2022 at 3:31 am

    Hi.
    I have freetime house with 12v solar power and controlling diesel heater on/off and temperature checking simply with Arduino/GSM.
    How connect traditional resistive (10-180ohm) fuel gauge to Arduino input for checking fuel level in tank?

    Reply
  3. JP says

    June 15, 2021 at 6:55 am

    Question –

    I have reservation about ANYTHING electronic in a fuel tank. So my questions are listed:

    How do you keep spark from generating on ultrasonic sensors as the sensor deteriorates from age?

    Fuel of any type will corrode most things – how do you keep the sensor, sensor wires and mounting from going bad?

    When fuel hits the air saturation temperature how do you keep the circuit cool enough to keep the extra heat from igniting the fuel vapors in the air especially on empty tanks?

    Reply
    • Swagatam says

      June 15, 2021 at 9:48 am

      As you can see in the diagram, no part of the circuit is inside the fuel tank, even the sensors are outside. Moreover, since the entire circuit works with a low voltage DC, question of any sparking does not arise.

      Reply
  4. Beardly says

    November 11, 2020 at 1:42 pm

    Hello Sir,
    I’m very happy to find your website, it is a fantastic cache of information and is great for novices as well as more experienced technicians. I have some background in electronics, but it has been a long time since I’ve really used it, and I could use some help.
    My inquiry is about the Ultrasonic Fuel Level Gauge, and I have a slight twist on the concept. I have a transceiver, DS1603L V1.0, that operates at 2Mhz, and it is capable of measuring the fluid level from below, affixed to the bottom of a metal fuel tank, with a detection range of a meter or so. It has a uart serial output, and I need to convert it to an analog voltage output for a standard 12v fuel gauge on my motorcycle. I bought it from Ebay, but they’re available on Amazon or AliExpress also.
    An Arduino should be perfect for this, but I have no experience with these yet. Would you be interested in a little experiment and showing us how this might be done?

    Reply
    • Swagatam says

      November 11, 2020 at 9:28 pm

      Thank you Beardly, unfortunately I too do not have an expertise in the field of Arduino, so I won’t be able to provide any help in this particular subject, although I wish I could!

      Reply
  5. Russell says

    September 28, 2020 at 7:19 pm

    Is there some form of signal smoothing, to try and eliminate signal variations due to fuel sloshing in the tank?

    Reply
    • Swagatam says

      September 28, 2020 at 8:35 pm

      I don’t think that would affect the reading, because Arduino being a digital device will respond ony to the genuine peaks of the signal, and reject the lower undefined ones.

      Still you can try connecting a 1uF capacitor across the ECHO pin and the ground pin.

      Reply
  6. Stephen Buadee says

    May 15, 2020 at 1:36 pm

    I really appreciate your invention, but instead of the led indicators as the output signal can’t you upgrade it and use 16 x 2 LCD screen

    Reply
    • Swagatam says

      May 15, 2020 at 4:25 pm

      You can upgrade it by reading the instructions as given in the following article:

      https://www.homemade-circuits.com/learning-basic-arduino-programming-tutorial-for-the-newcomers/

      Reply
  7. Larry Douglas (KC7JJ) says

    July 21, 2019 at 11:02 pm

    Thank you for the Arduino code. I purchased a few of the ultrasonic modules to play with but haven’t had time until now (just retired) to work with them. You’ve given me a ‘kickstart’ and I appreciate it.

    Reply
    • Swagatam says

      July 22, 2019 at 9:36 am

      That sounds great, Glad I could help, keep up the good work!!

      Reply
  8. Aravind says

    June 26, 2019 at 8:49 pm

    Hi,
    Tahnks for the project.
    Can you share the pcb design file for this project?

    Reply
    • Swagatam says

      June 27, 2019 at 8:15 am

      Hi, thanks, there’s no PCB for this project, because all the parts are in the form of modules, which needs to be joined with the wires.

      Reply
      • Ron says

        October 12, 2020 at 2:49 pm

        Sir what will be the design if i simply want the circuit to measure a liquid volume using an ultrasonic sensor? I don’t have to use LED or buzzer and just a dc power supply? Hope you can help me. Thanks alot

        Reply

Primary Sidebar



Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Amplifiers (59)
  • Arduino Engineering Projects (83)
  • Audio Projects (94)
  • Battery Chargers (83)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (32)
  • DIY LED Projects (89)
  • Electronic Components (97)
  • Electronic Devices and Circuit Theory (35)
  • Electronics Tutorial (109)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (12)
  • GSM Projects (9)
  • Health Related (19)
  • Heater Controllers (28)
  • Home Electrical Circuits (100)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (64)
  • Mini Projects (156)
  • Motor Controller (66)
  • MPPT (7)
  • Oscillator Circuits (24)
  • PIR (Passive Infrared) (8)
  • Power Electronics (33)
  • Power Supply Circuits (74)
  • Radio Circuits (9)
  • Remote Control (47)
  • Security and Alarm (61)
  • Sensors and Detectors (118)
  • SG3525 IC (5)
  • Simple Circuits (74)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (14)
  • Water Level Controller (45)


Circuit Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator


You can also Chat with me here:

Facebook
Twitter
YouTube
Instagram
My Facebook-Page
Quora



© 2022 · Swagatam Innovations

We use cookies on our website to give you the best experience.
Cookie settingsAccept All
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Please visit the Privacy Policy Page for more info.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT