*reproduced here with permission*
DIY MPG GAUGE using your laptop and a simple circuit. Now anyone who has a
laptop or tablet in their car can monitor MPG for pennies
*tank will persist when window is closed
Using this circuit, with right and left switched

Zoom in on recording of line in (44100 8 bit stereo) for anylizing the waveform
(vss* on top, injector on bottom) and general futzing in response. I don't think
the diodes are doing much on the vss side

*Yellow line is default threshold for the vss,
*Cyan "..." injector
*I adapted the code to the latest wave form (inj pulse was on other channel
and right side up?!?)
*vss is the misnamed Vehicle Speed Sensor. It really only measures distance.The
computer watching the vss still has to keep track of time to figure out the
velocity.
Speaking of code, here it is in it's entirety, 6 drama filled pages to chew
on in one file called Mpg.java
So, believe it or not, it's all there. I think its a solid proof of concept
anyway. Every car will be different, and there's plenty else that can be done
to it: RPM column, invert signal/swap channel from mpg.properties file. A a
collection of presets for different cars... But I, personally, am gonna try
and do other stuff for a while
Update, a nice install guide specific for a metro can be found here on teamswift.net