1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Fuel sender 0-5v help

Discussion in 'Automotive Electronics' started by skuzzle, Apr 11, 2012.

  1. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0
    Hi guys,
    I use a megasquirt ECU permanantly hooked up to a linux system with touchscreen. I'm in the process of binning the dials completely and using just the screen.

    I'm slightly stuck at the fuel gauge stage.

    The ECU has a spare input which accepts 0-5v. It also has a 5v reference output easily available.

    The fuel level sender is a potentiometer (with just 2 connections) of just a little over 0 - 118 ohms (tested on my meter)

    What im after is how do i use what i have to create a nice 0-5v output from this.

    Many thanks in advance, and if i suss it out i'll post back with how... I guess it will be simple, but i've only ever followed circuit diagrams before, never had to figure these things myself.
     
  2. Grossel

    Grossel Member

    Joined:
    Sep 16, 2008
    Messages:
    925
    Likes:
    22
    Location:
    Norway
    Hi.

    You can easilly build a variable resistance grid, you only need a regular resistor and a voltage supply that is higher than 5V.

    I still recomend using a pot with 3 legs if possible, because the voltage output from a 2 leg variable resistor (in resistor grid) will not be linear with the pot. Also, with a thre leg pot, you can use exact 5V input, and that will also be the maximum output.

    If energy economic is important in your system, then a 3lp will draw less current.
     
  3. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0
    problem is i have to use the sender already in the tank which is a 2 pin pot which goes from 0 to 118 ohms.
    I can give 5 volts to this easily from the ECU, but 118 ohms doesnt drop anywhere near to 0v , so what do i do about multiplying what the pot is doing.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0

    View attachment 63262

    I think this is something like what im trying to achieve except the pot on this is 5k (r3) i think. What would i need to do to use the 118 ohm pot.
    Is there a voltage divide or something i can do here ?
     
  6. Grossel

    Grossel Member

    Joined:
    Sep 16, 2008
    Messages:
    925
    Likes:
    22
    Location:
    Norway
    Do you know the pot's maximum and minimum values?

    Anyway, as I see it, you need to get in hand a voltage supply that can provide more than 5 volts AND less than zeero (to use opamps properly). The best situation is that if that voltage supply is electrically isolated (right term to use?) from your ECU, exept for the voltage (0-5V) terminals for measurement.
    Otherwise, you need to make a circuit that can pump up the voltage to >5V and <0V. It's not very difficult to achieve. You need an oscillator with low impedance output and a couple of clamping circuits to get the higher/lower voltage out.


    [edit]

    You might get an opamp that have full range inputs combined with rail to rail output. I don't have that part's name, but unless you can find it, you need to have a wider voltage span than 0-5V to supply the opamp.

    And since this is a fuel gauge, I guess that having a non-linear measurement is a bad thing (gauge will fall much faster when the tank volume getting closer to zeero).
    And of course, having the exact max and min values for the pot is critical to achieva e correct measurement and further calculations of resistor grid around the opamp.


    [edit #2]
    My thaughts have been for a wacation, apparently. If your spare input is fairly accurate, then you can easilly construct an almost-linear gauge by meassuring voltage near 5V (or near 0V).

    What is the resolution of the spare input?
     
    Last edited: Apr 11, 2012
  7. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0
    the pot i have (fuel level sender in a mazda MX5 / Miata) is 10ohm to 118ohm, tested with my meter, so accurate to a point.
    The vref i have is 5v from the ecu. I need the signal back to the ecu to be 5v when tank is full (10ohm) 0v when empty (118ohm) or there abouts. 1 - 5v is fine, as long as i have enough scope for the gauge in my ecu software to show me roughly my fuel level between full and empty.

    I know nothing really about electronics so i do need it spelling out to me im afraid, but so far the lm10 is looking like something that may be usable, but from an educated guess, my pot would sit in place of r3 on that circuit, except my pot is not 5k, it is less, so no good, unless you guys know otherwise.

    Cheers
     
  8. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0
    i can have 12v to play with if i need it, but i can not put more than 5v into the ecu input.
     
  9. Grossel

    Grossel Member

    Joined:
    Sep 16, 2008
    Messages:
    925
    Likes:
    22
    Location:
    Norway
    Two important questions remains. . .

    Now you have provided almost enoug data for making an usable project.

    But I want to know two more things before we go further:
    * Are you capable to program the ECU so that the input reading can be t.ex 1-2V instead of full range 1-5V? (if yes, you can probably skip any opamps).
    * What directions are the measurements? 10Ω=empty and 118Ω=full, or oposite?
     
  10. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0
    10ohm = full
    118 = empty

    The ECU software will give me a gauge read in adc, 1023 is full 0 is empty.
    an ADC of 1023 is 5v.

    2.5v ADC = 512 and at 0v the ADC is 0

    The gauge in the software can be setup with min and max values, so i can work lets say 512 to 650 adc which will give me 2.5v to 3.2v for example, but with not as much resolution.
    This probably is not an issue really.

    Am i right in thinking ive just solved it.. 5v into the pot.. then the other leg into the ecu input. program the gauge as whatever the max and min adc is.. as long as i have a resolution of around 20 or more i should get a decent fuel gauge :)
     
  11. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0
    just tested that theory of mine. it doesnt work. i get about a drop of 1adc at 118 ohms. So thats no use.
     
  12. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0
    ok so a little more looking and i can make a voltage divider using 2 resistors. if i pick a 10ohm and use my 10 - 118 pot them i should get 2.5 to about 4.5 volts.
    This is enough for a resolution of over 400 and more than plenty.

    Just need to suss that out now !
     
  13. skuzzle

    skuzzle New Member

    Joined:
    Apr 11, 2012
    Messages:
    9
    Likes:
    0
    ok, for those that need to know in the future, i solved this pretty quick.

    Heres the megasquirt circuit that needs building to give me a nice amount of resolution. Not quite 0-5v, but 0 to 2.5 which is enough
    View attachment 63264

    Thats me happy
     
  14. Grossel

    Grossel Member

    Joined:
    Sep 16, 2008
    Messages:
    925
    Likes:
    22
    Location:
    Norway
    Well, you've obvious missing the seckond resistor. You need that to get a readable voltage at all.
    Yet you'll suffer from having a non-linear reading (as is a bad thing).

    I've made a simple resistor divider that should work (but you'll still suffer from non-linear readings).
     
  15. BillM

    BillM New Member

    Joined:
    Jan 15, 2012
    Messages:
    8
    Likes:
    0
    Location:
    Western WA
    Have been doing something similar with a temperature sender. Learned the basics of LT Spice and used it to simulate a circuit.The attachments are modified from my project to perhaps suit yours. The inverting amplifier will output a .25 to about 3 volts as the fuel sender changes resistance.
    The voltage source V2 is the voltage across your sender when connected to a 120 ohm resistance. The output could be scaled by the divider at the output. The LM324 is a quad op amp; There is a LM358 which is a dual version. You could use the second amp as a buffer on the output. Maybe more complicated than what you hoped for but probably a better choice than the LM10.
     
  16. debe

    debe Active Member

    Joined:
    Mar 26, 2011
    Messages:
    549
    Likes:
    32
    Location:
    South Australia
    ONLINE
    I wouldnt get too excited about fuel gauge linearity, as most fuel tanks are not a regular shape.
     
  17. Crestronwizard

    Crestronwizard New Member

    Joined:
    Aug 1, 2014
    Messages:
    1
    Likes:
    0
    I am trying to do this now. I know this is more than 2 years old. The link no longer works in this post. Can anyone share the easy solution? Thanks
     
  18. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,320
    Likes:
    1,231
    Location:
    Cardiff, Wales
    Assuming the 5V output can source at least 50mA the simplest solution IMO is just to connnect the stable 5V to a 120Ω resistor in series with the sender, then use the ECU to measure the voltage across the sender. For a 10-120Ω sender this voltage will vary non-linearly from 0.4V to 2.5V. A lookup table would then give fuel volume as a function of measured voltage.
     
  19. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,133
    Likes:
    565
    Location:
    AZ 86334
    Here is a simple circuit that converts a sender resistance change from 10Ω - 120Ω to 0.5V - 5.0V. The voltage out vs resistance is quite linear. It is simple to rescale the output voltage to correspond to other sender resistance changes, or other reference voltages, if needed. An LM358 would work for the opamp. Not shown is something to clean up the supply voltage...
     

    Attached Files:

    • d176.jpg
      d176.jpg
      File size:
      234.9 KB
      Views:
      949
    Last edited: Aug 2, 2014
  20. vhimto

    vhimto New Member

    Joined:
    Sep 25, 2014
    Messages:
    2
    Likes:
    0
    hi mike can u post a more schematic circuit so that a new guy to electronics will understand.
    maybe list the components needed,am intersted in making one.
     
  21. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,133
    Likes:
    565
    Location:
    AZ 86334
    What I posted is a schematic. You are asking for a pictorial diagram which shows physical parts. I dont have time for that.

    You can do it. Start by printing out the data sheet for a LM358 op amp. It will show you pin numbers, etc. Get a piece of perf. board. Make a xerox of the bare board. Start placing components such as to minimize wire lengths.....
     

Share This Page