Continue to Site

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.

  • 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.

Miles per gallon gauge

Status
Not open for further replies.
i use assembly language but there is also pic basic out there somwhere..
you can also use C to program Pics..
an assembly program is a lot smaller and more precise than a basic program to do the same operation..
 
Hi valve-n-head, DirtyLude, ante, williB,

You're quite correct,
I had overlooked the 'excess return fuel line',
this of course means that fuel pump delivery is actually much
more than fuel consumption. Sorry about that.

I think this mention from DirtyLude actually nails it pretty well,

DirtyLude:
If you're thinking about an entirely passive solution, you can
pretty much forget about it. It would be real simple with a
microcontroller. Read the on time of the injector and average it
over the number of kilometres traveled,
taken from the speed sensor.


If i understand it right,
then the distance reference could come from a sensor on any
suitable part of the transmission, and the fuel reference could
come from the 'on time' of an injector.

I'm not sure at all how a microcontroller would be set up to give
fuel consumption, but programming one to do that would certainly
be easier than building some sort of calculating board of chips.
(a microcontroller is very similar to a computer, it can use
memory and do most things that a computer can do)

Best of luck with your project, John :)
 
mpg device

this has been done before on a model aircraft belive it or not and using a pic. all that was fitted was a mini turbine, which gave a certain amount of revolutions per litre of fluid passing through it, simple, one on the fuel feed in and one on the return fuel feed, work out the difference. stick a magnet on your propshaft and a hall effect trigger to get a pulse to work out the mileage covered. that way you will see the fuel used over your distance traveled. i will be doing this on my kit car shortly

cheers
 
On my BMW M3, it not only has the avg. MPG but it also calculates the realtime MPG with a sweeping gauge. Anyone know the how that works?

Doug
 
douglee25 said:
On my BMW M3, it not only has the avg. MPG but it also calculates the realtime MPG with a sweeping gauge. Anyone know the how that works?

Doug
It takes the only 2 inputs needed; current injector duty cycle and current speed, and does a simple calculation to determine immediate MPG. It might even just use a simple lookup table. X duty cycle at Y speed = MPG. Now all you do is average that out over time to get your average MPG.
 
The pulse width is the most practical way to do it if you do not have OBD2. I believe there are off the shelf products to read mpg from OBD2 if you have it.

You do not need 2 inputs for the pulse width thing. The injector signal's frequency shows both RPM and duty cycle.

It is imperfect in that you have no information on how the injector fires, no calibration. In the real world the solenoid takes a finite time to turn on and off the fuel stream. This will mean the flow at say 25% duty will be different at different RPM since the turn-on and turn-off times become a larger percentage of the pulse when you have narrower pulses.

And don't bother with BASIC stuff. Microchip provides a very effective C compiler which is as easy to learn as BASIC.
 
Oznog said:
The pulse width is the most practical way to do it if you do not have OBD2. I believe there are off the shelf products to read mpg from OBD2 if you have it.
Mileage is not in the OBDII specification. If there is a reader that calculates MPG, it will calculate it this same way, just by reading the data from the ECU, rather than getting it directly from the sensors.

You do not need 2 inputs for the pulse width thing. The injector signal's frequency shows both RPM and duty cycle.
RPM has no bearing on MPG (except for your note below), only duty cycle and speed. Speed refers to the distance the car travels, not the engine speed. So you still need two inputs to get MPG.

It is imperfect in that you have no information on how the injector fires, no calibration. In the real world the solenoid takes a finite time to turn on and off the fuel stream. This will mean the flow at say 25% duty will be different at different RPM since the turn-on and turn-off times become a larger percentage of the pulse when you have narrower pulses.
This is a good point. Though, it seems like a pretty simple matter to remove the rampup time from each on pulse in the period.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top