I have a project to build an instantaneous fuel consumption meter for my car. I'm quite a new in PIC programming and PICbasic so I would be very pleased if you have any hints or opinions about my project.
I’m planning to use 16f628a, 20x2 lcd and few buttons. I have melab’s LAB-X3 proto board for code testing.
For the consumption calculation I need vehicle speed, engine rpm, injector open time and injectors flow rate @ 3bar.
-speed signal form speedometer hall sensor, it outputs 16 pulses per tyre rotation
-engine rpm from 58 teeth vr sensor or alternatively from rev counter signal
-injector pulse width from injectors
I think that the consumption is calculated with following formulas:
Fuel consumption (liters/sec) = RPM * injector open time * injector flow
and
Fuel consumption (liters/100km) = (RPM * injector open time * injector flow) / speed * 100000
e.g.
Fuel consumption (liters/100km) = (( 1500 rpm / 60 ) * ( 8 ms / 1000 ) * ( ( 190 cc/min ) / 1000 )) / ((( 30 km/h) / 3.6) * 100000) = ~7.6 liter/100km
I think that it might be enough to measure 500 -1000ms each signal and after that calculate the results and print the results to display.
I have searched the forum about pulse counting and pulse width measurement. Something like this is maybe suitable for injector pulse width measurement:
http://www.melabs.com/resources/samp.../pbp/ccpx2.bas
Do you have any tips for counting the other pulses and handling all the three signals almost at the same time?
The attachment is a excel file for demonstrating the calculations.
-Vili
Bookmarks