element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Fuel level sensor to protect me from myself. First Arduino project
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 11 replies
  • Answers 3 answers
  • Subscribers 393 subscribers
  • Views 884 views
  • Users 0 members are here
  • frontpage
Related

Fuel level sensor to protect me from myself. First Arduino project

Former Member
Former Member over 9 years ago

Im looking for guidance with my first project.

 

Background for this project.

 

I have a 100gal diesel transfer tank in my truck. From this tank i have a small 12v pump connected to the fuel tank of my truck, i use this pump to fill my truck on long trips, or if i get into areas where i cant get to a filling station. The problem I have and the reason for this project is the pump is SLOW. That in itself isnt the problem, the problem is that i sometimes forget to turn it off, and yes i have forgot about it long enough to dump 70+ gallons of fuel on the highway ( expensive mistake)

 

Scope of this project;

 

I would like to use the fuel sender in the truck tank to turn off/interrupt power to the coil of the relay controlling the pump at a set level ie. 7/8 full. This way I can turn on the switch and if i forget to turn it off i will no longer over fill the truck.

 

Since this is my first attempt working with arduino im not really sure where to start.

 

Tomorrow morning I'll be taking some measurments of the fuel sender although im pretty sure it is resistance based.

 

So i guess the first thing i need help with is interfacing with the sending unit without adversly affecting the guage on the dash.

 

 

After this part of the project is complete Id like to also monitor the sending unit in the transfer tank so when that tank is empty ( or at some set point ie. 1/4 tank) also turn off/interrupt power to the coil of the relay controlling the pump so as not to burn the pump out from running dry.

  • Sign in to reply
  • Cancel

Top Replies

  • mcb1
    mcb1 over 9 years ago in reply to Former Member +2 suggested
    jamesb128 James A simple voltage comparator circuit using an OpAmp will give you all you need. It's late and bed calls but maybe if jw0752 is still up he will have the circuit and have proved it before…
  • mcb1
    mcb1 over 9 years ago +1 suggested
    jamesb128 Welcome to the world of electronics, and Arduino. Before you start you're going to have a couple of problems. 1. The sender and guage are 12v (or 24v) which is incompatible with the 5v of the…
  • Former Member
    Former Member over 9 years ago in reply to mcb1 +1
    Hi mark thanks for your reply. Im certainly not tied to using an arduino or any other microcontroller for that matter. Only reason i chose to use one is well i have it and i was looking for a starter project…
Parents
  • mcb1
    0 mcb1 over 9 years ago

    jamesb128

    Welcome to the world of electronics, and Arduino.

     

    Before you start you're going to have a couple of problems.

    1. The sender and guage are 12v (or 24v) which is incompatible with the 5v of the Arduino.

    2. The extended wiring is quite likely to be subjected to interference unless you are very careful.

     

    I suggest the old fashioned method of using some basic electronics and a couple of relays.

    The voltage across your existing fuel guage is compared with a set voltage, and the output drives a relay that allows power to go to the pump.

    When the voltage across the sender rises (as the tank fills), it reaches the set point and the relay interrupts the power, thereby stopping the pump.

     

    The simplest method I know of monitoring your second tank level is another sender and guage from a donor vehicle.

    These are rugged and can be secured into the tank from the top, like your existing vehicle.

    You can duplicate the electronics and use this to also provide power to the relay when the tank is above the set point.

     

     

    I'm all for microcontrollers but sometimes a simple bit of old fashioned electronics goes a long way.

    In the meantime measuring the voltage across the sender at your desired "full" point will help with whichever methd you choose.

     

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • mcb1
    0 mcb1 over 9 years ago

    jamesb128

    Welcome to the world of electronics, and Arduino.

     

    Before you start you're going to have a couple of problems.

    1. The sender and guage are 12v (or 24v) which is incompatible with the 5v of the Arduino.

    2. The extended wiring is quite likely to be subjected to interference unless you are very careful.

     

    I suggest the old fashioned method of using some basic electronics and a couple of relays.

    The voltage across your existing fuel guage is compared with a set voltage, and the output drives a relay that allows power to go to the pump.

    When the voltage across the sender rises (as the tank fills), it reaches the set point and the relay interrupts the power, thereby stopping the pump.

     

    The simplest method I know of monitoring your second tank level is another sender and guage from a donor vehicle.

    These are rugged and can be secured into the tank from the top, like your existing vehicle.

    You can duplicate the electronics and use this to also provide power to the relay when the tank is above the set point.

     

     

    I'm all for microcontrollers but sometimes a simple bit of old fashioned electronics goes a long way.

    In the meantime measuring the voltage across the sender at your desired "full" point will help with whichever methd you choose.

     

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • Former Member
    0 Former Member over 9 years ago in reply to mcb1

    Hi mark thanks for your reply.

     

    Im certainly not tied to using an arduino or any other microcontroller for that matter. Only reason i chose to use one is well i have it and i was looking for a starter project and i figured why not start with this project. What basic electronics did you have in mind? Please keep in mind that im learning. As for the second tank (Transfer tank) i already have a sending unit and guage for that tank as well.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 9 years ago in reply to Former Member

    jamesb128

    James

    A simple voltage comparator circuit using an OpAmp will give you all you need.

    It's late and bed calls but maybe if jw0752 is still up he will have the circuit and have proved it before I can get up.

    Otherwise I should be able to find something later tomorrow. (ie 24hrs from now)

     

    In order to make this work (not matter what system) you'll need to measure the voltage across the senders at the two levels you want it to shutoff at. (7/8ths full and 1/4 empty.)

    Most fuel guages are powered by a regulator in the dash so they receive 8v or there-abouts to keep them stable. You'll probably want to do the same for your transfer tank guage.

     

    I encourage you to try many of the examples that come with the Arduino IDE and get used to buttons and controlling outputs.

    I prefer to pull the input down to ground which then sets you up for these sorts of interfaces.

     

    I get the pupils to try two buttons and two leds.

    After they turn each led on with each buttn, change the software so the first button turns on the first led, second button turns off the first and turns on the second led.

    Reset to return to both leds off. It's an exercise in understanding what you have and the end goal.

     

    Your learning can then be transferred to your next (or this) project.

     

     

    Mark

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • mcb1
    0 mcb1 over 9 years ago in reply to mcb1

    jamesb128

    James

    I haven't forgotten you, I've been incapacitated with an ear infection.

     

    Give me a little more time.

     

    Cheers

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 9 years ago in reply to mcb1

    Very sry to hear that Mark.

     

    I've done a little research on my own with using OpAmps as comparators to educate myself so that I may have a somewhat intelligent conversation with you. Here is a design I came up with, and I'd like your thoughts. Im sure i've overthought it terribly but hey it's my first OpAmp circuit. I created this using Mousers MultiSim Blue so the voltages you see are just virtual probes. I left out the voltage regulation circuit for the Ref Voltage to keep it clean and on point.

     

    I have yet to ascertain the actual voltage from the vehicle fuel sending unit. its difficult to get to. So tomorrow i'm going to see if I can get the reading I need from the instrument cluster itself. i'll change the

    values for the voltage divider accordingly when I get that info.

     

     

     

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • D_Hersey
    0 D_Hersey over 9 years ago in reply to Former Member

    This is a fine circuit for a beginner.  If you want a little hysteresis to avoid sending thin pulses to the pump, you can use two comparators  and a (F/F) flip/flop.  Similar to the internals of a 555.  Good job!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 9 years ago in reply to Former Member

    Thanks for the thoughts.

     

    After I wrote the first comment there was another IC that came to mind (but I couldn't remember the number).

    LM339 is designed as a comparator and the good news is it works from 3-32v DC, so no funny voltage dividers required.

     

    Your circuit is pretty close.

    A small amount of feedback to create Hysteresis will help, and something to drive the relay.

    A small capacitor across the input to damper the fluctuations.

     

     

    I have something that needs redrawing but I'm struggling to find a sender and gauge to be able to verify it.

    So it may have to be the concept rather than the final design.

     

    i'm going to see if I can get the reading I need from the instrument cluster itself

    The other guage and sender will be useful. If I recall the senders are usually wirewound and not very high in resistance.

    As I drew it it seemed that the gauge was closer to being a current meter, than a voltage gauge.

     

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 9 years ago in reply to mcb1

    Okay

    I gave up on trying to use my normal schematic package ... it sucks

     

    Here is the old fashioned version. No guarantees but it should give you a good start point.

    I think I've got the logic correct, and I've assumed the sender goes low in resistance when the tank is full.

     

    image

     

    This is the turn OFF at 7/8th full version.

    The LM339 has 4 comparators and they suggest tying the unused inputs to ground.

     

    Using another 1/4 of the LM339 you should be able to duplicate to make the "Turn off at 1/4" but you need to swap the inputs so that the preset part is on the +ve input and the sender part is on the -ve input.

    You can add the relay output in series.

     

    The capacitor across the sender should help smooth the fluctuations but will need to be sized according to the sender resistance. I suspect a 1000uF might be needed.

    The 1M and 1K for a feedback to stop it oscillating when it's close to the trigger point. I suspect the pump and tube will also give some additional hysterisis so it may not be required.

     

    In theory a couple of LED's (with resistors) at each point in the voltage feed will show the switch is ON, the receiving tank is READY and the supplying tank is OKAY.

    You may want to change how the power is fed so that the switch is the final part, that way you can have a LED to prompt you to switch it ON.

    You have enough spare inputs to create a third section to prompt you when the tank is below 1/4 ....

     

     

    Cheers

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube