Fuel Used Indicator with Reset

Discussion in 'Automotive Electronics' started by Headlinesport, Feb 16, 2018.

  1. Headlinesport

    Thread Starter New Member

    Feb 16, 2018
    8
    1
    Hi
    I have a requirement to accurately measure how much fuel I've used in an endurance race car.
    The data logger I have does not accept a frequency input, so I need to convert our flow meter from pulse to voltage so this can be
    fed into the logger.
    The flow meter has a power free reed switch that pulses @ 1 pulse per 0.005 litre.
    The data logger has an input that I can use that is 2-12 volt dc.
    The requirement is to have the ability to measure 100litres of fuel.
    Therefore 20,000 pulses = 100l and for this to be converted to a voltage of between 2-12v so:
    100 pulses = 0.5l = 2.05v
    200 pulses = 1.0l = 2.1v
    1,000 pulses = 5l = 2.5v
    10,000 pulses = 50l = 7v
    20,000 pulses = 100l = 12v

    The other requirement to have is to be able to reset the pulses/voltage back to 0 pulses / 2v so when the car is refueled, I can hit a button
    and start again from 0 litres.

    I would also like the current voltage to be no-volatile so should the car be switched off/loose power for a period of time, the current flow is not reset.

    Seen some ideas using an LM331 chip, but have no idea how to implement?

    Any idea?

    Thanks
     
  2. crutschow

    Expert

    Mar 14, 2008
    19,481
    5,426
    For accuracy and memory you can using a counter, and a D/A converter.
    The counter counts the pulses, giving a total count, which is fed to the D/A converter to generate a voltage proportional to the count.
    An op amp can add the 2V offset to the signal.
    You can have a push-button the will reset the counter to zero count.

    For 20,000 counts you need at least a 15-bit counter.

    What is the accuracy/resolution of the data logger?
    What is its output?
    That will determine the number of bits required for the D/A converter.
     
  3. debe

    Senior Member

    Sep 21, 2010
    1,091
    236
    If it is a fuel injected car, then it wont give what the engine is using as the fuel rail has a pressure regulator that feeds exess fuel back to the tank. Fuel injected cars usual have a system that recognises Injector pulse width, & fuel tank level. to give instant & total fuel consumed. Even that system is not totally accurate.
     
  4. Headlinesport

    Thread Starter New Member

    Feb 16, 2018
    8
    1
    I'll contact the data logger company to check to see what steps the 2-12v input resolution is.

    For the output, this will be fed into a dash in the car, but the logger also does live telemetry that is uploaded - hence the pitwall people can also monitor the fuel used.

    Here is a link to the logger used: http://www.race-technology.com/wiki/index.php/RTLive/Connections

    Here is a link to the flow meter: https://www.bellflowsystems.co.uk/v...-1-50-max-80-litre-hr--1.html?category_id=754

    @debe - the car is fuel injection (VW Golf) but it does not have a fuel return to the tank - noted your comments about ecu accuracy hence why we are looking at measuring the flow (low pressure) from tank to engine before the high pressure pump.

    @crutschow - what counter and d/a would i be looking at and how would I join it together?

    Thanks all!
     
    debe likes this.
  5. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,423
    1,520
    Your data logger affords 8 Analog In channels (A1 through A8). You have 4 each 1 through 5 volt channels and 4 each 2 through 12 volt channels. They are all 16 bit channels so you have 2^16 = 65,536 quantization levels. Your flow sensor outputs 1 pulse per 0.005 Liter or 200 pulses / Liter.

    What you want or need is commonly called a flow rate / totalizer meter having an analog output. and one that is powered from 12 volt automotive power. I mention rate / totalizer as most can be setup to measure a flow rate as in Liters per min or hr or totalize. They come with an analog out or it might be an option. They are also normally able to be scaled also. Just as an example and only an example the Omega DPF 701 of the 700 series. I say example because I do not believe they offer a 12 VDC version and because there should be many lower priced units out there. You also do not need a controller function. The meter can be scaled as well as the output scaled. For example see page 23 of the link, Totalizer Example.

    "You are totalizing pulses from a flowmeter which generates 25 pulses per gallon. To show the total value in gallons: * Set the meter to the totalizer mode. * Use divide (IN /SC) by 25 as a scale factor * Store set up information in nonvolatile memory".

    Change to read:

    You are totalizing pulses from a flowmeter which generates 200 pulses per Liter. To show the total value in gallons: * Set the meter to the totalizer mode. * Use divide (IN /SC) by 25 as a scale factor * Store set up information in nonvolatile memory.

    You can also scale the optional output, for example 0 to 100 Liters output voltage, this would go easier if you could use a 1 to 5 volt input rather than a 2 to 12 volt input unless you can find a rate / totalizer meter which offers up to 12 VDC analog out.

    Ron
     
  6. wayneh

    Expert

    Sep 9, 2010
    14,663
    5,191
    This feels a little like adapting a square peg to fit a round hole. A counter/totalizer will give a nice, precise output as precise as the sensor is capable of. You could scale it to whatever output you like, all in the digital domain. I understand that the logger wants an analog voltage, but to me that seems like a shortcoming of the logger. How about the telemetry system, can it handle a digital signal?

    I'm only suggesting a little step back to think about the overall strategy. Take it with a grain salt.
     
  7. crutschow

    Expert

    Mar 14, 2008
    19,481
    5,426
    It would require soldering/wiring about 5 small IC's and other electronic parts on a small proto/vector type board.
    Are you familiar with doing that, or know someone who is?
    If so I can look up some parts to do the task.

    Otherwise I recommend buying an off-the-shelf unit, such as Ron recommended in post #5 or a data logger that can accept pulse inputs.
     
  8. Headlinesport

    Thread Starter New Member

    Feb 16, 2018
    8
    1
    Hello all

    Thanks for all the suggestions. The reason we have picked this particular data logger is because it offers live telemetry between car and pit at a very reasonable price (£400). I'm not aware of anything else close to this. We plan to pair this with a digital dash.

    I like the idea of the totalizer however, these are almost as expensive as the logger and if we get the electronics right between the flow meter and logger, we will be able to send this to the digital dash, so will not have the need for it.

    @crutschow - I can assemble boards OK, just no idea what I need, so any help would be really appreciated.

    Thanks
     
  9. crutschow

    Expert

    Mar 14, 2008
    19,481
    5,426
    Okay.
    The problem is that modern ICs come in small packages with close leads designed to be surface-mount soldered on a PCB.
    For example, this 16-bit DAC is an $8 device can work to convert the pulse count to a voltage.
    But it comes in this package, which is a 5mm (0.2") square package with 0.5mm (20 mil) lead spacing.
    Here's a breakout board that would allow the use of that DAC.
    Do you think you can solder such a small device to that?

    What is the resolution you really need for the fuel flow?
    A lower resolution could simply the task.
    For example, 12-bits would still give a resolution of 0.025l (25ml) of fuel.
     
    Last edited: Feb 25, 2018
  10. Headlinesport

    Thread Starter New Member

    Feb 16, 2018
    8
    1
    @crutschow - I've had a response back from the data-logger manufacturer regarding the spec of the inputs:

    These are 12 bit resolution, so around 3Mv.
    They will not measure to zero volts.
    The spec has been improved to 0.2v-5v and 0.4v-12v.


    So the resolution you suggested looks to be possible - we wouldn't need to go lower than 2 decimal places per litre of fuel.

    Thanks
     
  11. Headlinesport

    Thread Starter New Member

    Feb 16, 2018
    8
    1
    @crutschow - what would I need to achieve this please?
     
  12. crutschow

    Expert

    Mar 14, 2008
    19,481
    5,426
    12-bits gives a resolution of about 0.025 liters in measuring 100 litres total.

    So my first take is that it will require two CD4089 binary rate multipliers, which can be set to reduce the count rate by a factor of 52/256 (52 output counts for every 256 input counts), giving a count total of 4062 (4096 is 12 bits) for a 100 litre input count of 20,000.
    This total will be accumulated in two CD4024, 7-bit counters.
    The counters will be read by a 12-bit parallel-input DAC, such as a 7245, to give a voltage output proportional to the accumulated count.
    An op amp may be required at the DAC output to tailor the voltage to the requirements of the data logger input.

    All these devices are available in through-hole DIP packages so are reasonably easy to wire on a breadboard.

    Sound like that will do what you want?
     
    Last edited: Mar 9, 2018
  13. crutschow

    Expert

    Mar 14, 2008
    19,481
    5,426
    On second thought I think it would be okay to divide the pulses by an even 5 with a single counter chip, which would give 4000 output counts for 20,000 input counts.
    That will require one less chip and simplify the circuitry with only a slight loss in dynamic range.
    The full 4096 count would then equal 102.4 litres instead of the nominal 100.
     
  14. Headlinesport

    Thread Starter New Member

    Feb 16, 2018
    8
    1
    Hello @crutschow

    That sounds great. Breadboard solution would cool - anything to make it simpler! Please send me the details to wire the item together.

    Could this also retain the count if voltage is lost?

    Thanks
     
  15. crutschow

    Expert

    Mar 14, 2008
    19,481
    5,426
    I can put together a schematic and basic parts list, but you'll need to do the rest as far as the breadboard construction. ;)

    I'll add a 9V battery backup to retain the count.

    Question: Does the DAC output signal have to be offset so that 0V output (zero gas) equals 0.2V for the data logger 5V input?
    0.2V is approximately the first 4 liters of fuel used.
     
    Last edited: Mar 13, 2018
  16. Headlinesport

    Thread Starter New Member

    Feb 16, 2018
    8
    1
    Sorry for delay getting back to you. The reply from the company said this regarding the inputs:

    They will not measure to zero volts.
    The spec has been improved to 0.2v-5v and 0.4v-12v


    So I assume what you said is correct.
     
  17. crutschow

    Expert

    Mar 14, 2008
    19,481
    5,426
    My question was directed to you, actually.
    Do you need to measure the first 4 liters of fuel with accuracy, starting with 0 liters equalling 0.2V, or is it okay to just know that you've used 4 liters when the data logger detects more than 0.2V?
     
  18. Headlinesport

    Thread Starter New Member

    Feb 16, 2018
    8
    1
    I guess it would be best to measure/display the first four litres if possible?
     
  19. Hymie

    Member

    Mar 30, 2018
    452
    95
    I see Headlinesport has been left hanging on this enquiry.

    I offer this solution as a starting point.

    The component values chosen are to give a change of voltage of 500uV/input pulse – and are based on a pulse input of 10V for 100ms.
    Obviously component values can be altered to accommodate a different pulse voltage/duration.

    I admit that extreme component values are required, which may make the circuit impractical in the real world.

    The circuit is a simple integrator circuit based on an op-amp with +/-15 volt rails.
    Given the circuit impedance – the op-amp will need to be a fet input type.

    The voltage change per input pulse is given by the formula:-

    V = I x t/C

    Where I is 10V/20M ohm = 0.5uA; t = 0.1s; C = 100uF

    Therefore V = 0.5uA x 0.1s/100uF = 500uV.

    Other than the high impedance causing problems, the self-discharging of capacitor C1 could add to the errors.

    Not shown is the 2V offset required – which could easily be added by the inclusion of another op-amp stage.

    Given the low power draw of the circuit, it could be permanently energised without draining the vehicle battery.

    Before headlinesport breadboards the circuit to see if it works – I would welcome comments that might improve the circuit – or shoot it down, advising headlinesport not to waste his time building it.

    Integrator pulse circuit.jpg
     
  20. crutschow

    Expert

    Mar 14, 2008
    19,481
    5,426
    It's very difficult (if not impossible) to get an analog integrator to accurately integrate a voltage and hold the value for the time-frame involved in a race. Offsets and leakage will likely kill you.
    Headlinesport also wants to hold the value for a period of time after the race, making the problem even more difficult.

    Below is my take on a digital circuit that should do what he wants.
    It uses a CD4017 CMOS counter to divide the count by 5 and then two CD4024 counters configured as a 12-bit accumulator (integrator) for the pulses, and finally a 12-bit A/D converter output to generate an analog voltage from the accumulated pulses for the input to the data logger.
    It has a 6V battery back-up to retain the count indefinitely.
    The push-button switch SW resets the count to 164d at the D/A input, equivalent to 0.2V at its output.
    The maximum count of 4096 gives a 5V output.
    The counter thus can count 4096 - 164 = 3932 pulses from the CD4017 output, or 5 * 3942 = 19,660 counts from the flow meter.
    Thus full count equals 19,660 / .005 = 98.3 litres, close to the 100 litre total count desired.
    upload_2018-4-14_20-20-15.png
     
    Last edited: Apr 14, 2018
Loading...