|
|
07-08-2007, 11:16 AM
|
#1
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
diy mpg gauge
Update, skip ahead to a working model:
http://www.gassavers.org/showthread....32#post6473232
It seems a simple enough task, take a vehicle speed sensor "reading" and divide it by the injector duty cycle and put it on a meter. In fact my el-cheapo tach/dwell meter has both circuits in it (and a meter) and could be made to reflect vehicle speed (perhaps with an op amp on the vss) or injector duty cycle (which probably isn't much more than an inductor). Throw in some pots for calibration and an op amp to combine the signals and...
So has anyone come up with a simple mpg gauge circuit for the masses? I suppose digital would be better (i.e. keep track of every duty cycle for every vss pulse and add a "trip" type function to it), but I kind of like the "gomi"-ness of dissecting my old tach/dwell meter and making an mpg gauge out of it
Thoughts?
P.S. Scangauge is in my wifes hands and I don't have another $160, that's why I'm considering this  , though something for the DIY sector would be useful.
Last edited by skewbe : 07-22-2007 at 03:48 AM.
|
|
|
07-08-2007, 12:06 PM
|
#2
|
|
...
Join Date: May 2007
Location: Ya shur, Mini soda!
Posts: 506
|
Came across a link on pg 4 & 5 has the circuit diagrams(originally posted by retrorocket) . It appears to use a sunpro tach . Add a vaccum gauge along with some fabbing skill you *might* save a few dollars .
__________________
|
|
|
07-08-2007, 12:32 PM
|
#3
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
Yah, that would be an obd approach, I was thinking analog stuff (and about $5 in parts added to my extremely simplistic sunpro dwell/tach). Mebbe those days are gone?
|
|
|
07-08-2007, 12:43 PM
|
#4
|
|
...
Join Date: May 2007
Location: Ya shur, Mini soda!
Posts: 506
|
Didn't SVOboy(I think it was anyway) do a fuel gauge with a dwell tach ? I'd be willing to bet that the same thing *can* be done the way you described . You just need to take the time to get the calibrations down .
__________________
|
|
|
07-08-2007, 02:22 PM
|
#5
|
|
Team GasMisers5!
Join Date: Nov 2006
Location: NZ (was Scotland, UK)
Posts: 501
|
The cheapest way to do it would be to...
(1) Get an Atmel processor, and programming kit from ebay. Get the flash-reprogrammable processor, so you can experiment.
(2) Find some code + circuit diagram for wiring it to a calculator screen (8-digit LCD)
(3) Connect it to the Auto power supply (using the info in that PDF). Use code to simply read the injector pulse duration, and the vehicle speed sensor reading.
(4) Have one or two buttons on it. You could make a simple user interface, so you can 'reset' the 'TANK' when you refill, and reset the 'journey' each time you make a journey. Display instant MPG on the left of the calc display, and tank/journey MPG on the right hand side!
This is the basic idea behind the SuperMID, except that a lot more work has gone into it, in particular in interfacing it to a much more complicated display.
__________________
 
Team GasMisers5 - #1 for first three rounds of the original GS Fuel Economy Challenge
Miles displaced by e-bike since 1 Jan 2008: 62.6 ( 0 kWh used)
Hypomiler
|
|
|
07-08-2007, 08:43 PM
|
#6
|
|
|V3|2D
Join Date: Mar 2006
Location: southern nj
Posts: 1,516
|
Quote:
Originally Posted by landspeed
The cheapest way to do it would be to...
(1) Get an Atmel processor, and programming kit from ebay. Get the flash-reprogrammable processor, so you can experiment.
(2) Find some code + circuit diagram for wiring it to a calculator screen (8-digit LCD)
(3) Connect it to the Auto power supply (using the info in that PDF). Use code to simply read the injector pulse duration, and the vehicle speed sensor reading.
(4) Have one or two buttons on it. You could make a simple user interface, so you can 'reset' the 'TANK' when you refill, and reset the 'journey' each time you make a journey. Display instant MPG on the left of the calc display, and tank/journey MPG on the right hand side!
This is the basic idea behind the SuperMID, except that a lot more work has gone into it, in particular in interfacing it to a much more complicated display.
|
so how much do you think that will run??? if its less than $50 i might just have to try it...
__________________
don't waste your time or time will waste you
|
|
|
07-09-2007, 12:17 AM
|
#7
|
|
Member
Join Date: Jul 2007
Posts: 150
|
Looking at the Mnfocus linky, I'd say the design could be simplified for a laptop:
There's 1 signal line from the ODB-2 picked up. Just pass it on to a laptop's serial port and have a program scan that serial port and do the computation, logging, and display.
That way it's ALL SOFTWARE, with $2 worth of parts. May need a pull down 12V->5V resistor bridge, or at worst an op-amp to decouple it all.
Just need a guy who knows how to code with visual basic or visual C a serial port reader...
If you wanna do it digital, replace their analog display with a cheap LCD bar display.
Last edited by sonyhome : 07-09-2007 at 12:23 AM.
|
|
|
07-09-2007, 01:24 AM
|
#8
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
Yah, the laptop->obd route is a well traveled path. Problem is obdii is a hodgepodge of protocols, and laptops aren't exactly cheap.
Also, I'm not ready to sort out PICs and deal with programmer compatabilities,specs,etc.
However, there may still be a dirt cheap option for iso, an old blackberry 957 perhaps (or mebbe a serial based palm) and something to convert 5v<->12v. In that way it is relatively easy to program/reprogram and comes with a display,input system, and a serial port based on the windows iso stuff:
http://www.andywhittaker.com/ECU/OBD...9/Default.aspx
BUT, it ony works with iso vehicles.
Here is another laptop idea, tap into the vss and injector pulses via the line-in right and left channels on the sound card and sort it out from there. They are basicaly A/D converters.
Last edited by skewbe : 07-09-2007 at 01:27 AM.
|
|
|
07-09-2007, 06:21 AM
|
#10
|
|
Team GasMisers5!
Join Date: Nov 2006
Location: NZ (was Scotland, UK)
Posts: 501
|
Quote:
Originally Posted by thisisntjared
so how much do you think that will run??? if its less than $50 i might just have to try it...
|
No idea, but, I know I could get the raw materials for $50 if I look around on ebay + other places. LCD screens seem quite expensive, but, if you find somewhere that sells simple calculator ones, it should be pretty cheap.
__________________
 
Team GasMisers5 - #1 for first three rounds of the original GS Fuel Economy Challenge
Miles displaced by e-bike since 1 Jan 2008: 62.6 ( 0 kWh used)
Hypomiler
|
|
|
07-09-2007, 06:25 AM
|
#11
|
|
Team GasMisers5!
Join Date: Nov 2006
Location: NZ (was Scotland, UK)
Posts: 501
|
Quote:
Originally Posted by skewbe
Yah, the laptop->
Here is another laptop idea, tap into the vss and injector pulses via the line-in right and left channels on the sound card and sort it out from there. They are basicaly A/D converters.
|
I've thought of this and looked it up - you would need to make circuits to protect the laptop soundcard, especially as injector pulses can hit +50/+100v due to inductive effects when the power supply is cut off (at the end of the injector pulse).
I found somewhere, a USB device that had about 16 A-D convertors and D-A convertors too. It was about $150 though. Shortly after this I found the SuperMID on this site (in fact, it was research into homebrew MPG gauges that led me to this site!)
__________________
 
Team GasMisers5 - #1 for first three rounds of the original GS Fuel Economy Challenge
Miles displaced by e-bike since 1 Jan 2008: 62.6 ( 0 kWh used)
Hypomiler
|
|
|
07-09-2007, 08:07 AM
|
#12
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
Quote:
Originally Posted by landspeed
I've thought of this and looked it up - you would need to make circuits to protect the laptop soundcard, especially as injector pulses can hit +50/+100v due to inductive effects when the power supply is cut off (at the end of the injector pulse).
|
Yah, worth mentioning, don't want people frying their line in ports.
I would think taking the signal from a pair of diodes in parallel, which are in series with a largish value resistor which leads to , oh nevermind, let me draw a picture  Were talking pennies worth of parts to limit (clamp) the voltage to .7 volts.
I've got some old assembler routines I wrote for high resolution recording in dos (windows recording always make skips), I can dredge those up, mebbe a linux port would be in order.
I think we have enough info for a laptop based mpg/mph/trip/and rpm program, once you tell it some info about your car like:
1. how many vss pulses per wheel rotation
2. how many injectors
3. how many cylinders (if it is tbi)
but dang if a laptop isn't a lot of luggage for an mpg gauge 
Last edited by skewbe : 07-09-2007 at 08:22 AM.
|
|
|
07-09-2007, 08:29 AM
|
#13
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
Quote:
Originally Posted by sonyhome
Most people have laptops nowadays, and all have serial ports.
If there's an explanation of what to monitor on the ODB-2, then a simple program can be made, which then will be ported etc.
|
Yah, it isn't that simple. there are many OBDII protocols, only iso (asian cars)can be handled by the laptops serial uart chip with only the scantiest of circuitry, and less and less laptops have such a serial port available. The other protocols take $100 adapters (and you might as well get a scangauge/supermid at that point).
I'm looking for cheap and simple, that can be adapted to any electronic fi car (regardless of obd status) using surplus parts/etc.
Last edited by skewbe : 07-09-2007 at 08:37 AM.
|
|
|
07-09-2007, 10:35 AM
|
#14
|
|
Gasmiser
Join Date: Jan 2007
Location: mid michigan
Posts: 378
|
Quote:
|
I'm looking for cheap and simple, that can be adapted to any electronic fi car (regardless of obd status) using surplus parts/etc.
|
I was just talking with the guys at work about doing something similar to that. Goal was As long as the vehicle has a vss and efi the gauge will work. Just have to do some calibrations for fuel use. I just want a DIY route for my 94 metro since it is all DIY so far  + I'm cheap. The scangauge I bought should offer enough to be worthwhile on my newer gas hogs  .
__________________
Best tank= 81.23 mpg on july 1st 2008
SAVE SOME GAS, SAVE THE WORLD!
|
|
|
07-09-2007, 11:10 AM
|
#15
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
a vss is easy to fabricate if the car doesn't have one, basically zip-tie a small magnet to a drive shaft or axle and bracket up a coil to pick it up.
Some cars will have one for a cruise control even if it isn't an obd car.
|
|
|
07-10-2007, 03:13 PM
|
#16
|
|
New Member
Join Date: Jul 2007
Location: Port Saint Lucie, FL
Posts: 6
|
I'd love to see what you come up with, as i would like to make one for my 94 VX...
|
|
|
07-10-2007, 03:37 PM
|
#17
|
|
Member
Join Date: Jul 2007
Posts: 150
|
Let's recap, assuming you don't want to tap the ODB2 codes (would work for all cars!):
For MPG you need actual distance and gas consumption (duh!)
- distance: count wheel axle rotations
Count rotations R with a magnet or an optical reader
Calibration: multiply count by the circumference Ctire of the tire in inches. That's easy to get with a chalk mark on the tire.
D = R * Ctire /63360
- gas consumption: collect duty cycle of injectors
Can we track it by monitoring the duration of the electromagnetic pulse on the injector electric wires somehow? Maybe with a pickup from the speaker of
an old walkman headset taped to an injector wire? Else tap the wire directly to measure voltage shifts.
Calibration: Need the max volume of gas Vmax the injector can feed divided by the max duty cycle DCmax. Those parameters are probably known by the racers.
V = Vmax * DC/DCmax
|
|
|
07-10-2007, 04:03 PM
|
#18
|
|
The Right Lane Rollers!
Join Date: Mar 2007
Posts: 1,274
|
In a way, you're making it too tough. You really just work off a couple of assumptions. 1- injector pulse width is proportional to fuel flow 2- number of pulses from the vehicle speed thingy is proportional to speed. And then, you just lay a constant on top of it.
Instant MPG = A constant * speed / flow
Less elegant than your idea, though. :-)
__________________
|
|
|
07-10-2007, 04:36 PM
|
#19
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
Quote:
Originally Posted by sonyhome
...assuming you don't want to tap the ODB2 codes (would work for all cars!):
|
that is incorrect, not all cars by a long shot. It won't work on pre-96, didn't even work on my 97 until I swapped ECU's (car worked fine though), it didn't work on my neighbors car. It's ugly too as it is several protocals under one name, some needing more circuitry than others. Check it out.
Having a layer of ECU and whatnot between the mpg gauge and the actual sensors also means a lot more can (and will) go wrong, in my experience.
Note, however, my metro uses ISO (I'm using an OBDII specific term here, so be careful), and you can use a standard serial port (found on older laptops and even old blackberries/palm pilots) with ISO for a few transistors, i.e.: http://prj.perquin.com/obdii/ So there may be an old palm pilot gorilla glued to my dashboard in the not too distant future anyway 
Last edited by skewbe : 07-10-2007 at 04:39 PM.
|
|
|
07-10-2007, 10:38 PM
|
#20
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
revisiting the analog stuff
so rethinking the analog stuff and reusing a tach dwell as a mpg gauge, I found this reference about using op amps to divide.
http://www.national.com/an/AN/AN-30.pdf
So we would use the rpm circuit to create a voltage proportional to the speed (like the rpm circuit does already to drive the meter, only it is connected to an amplified vss signal), and take the dwell circuit to create another voltage (like the dwell circuit does to drive the meter, only it is hooked up to an injector instead of a coil) and divide the speed voltage (E1) by the injector duty cycle voltage (E2) using op amps in a logarithmic mode with a fudge multiplier (calibrator) on E3. Easy cheesey, right?

|
|
|
07-15-2007, 04:27 PM
|
#22
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
status
I'm realizing that this isn't quite a comprehensive DIY article yet, I'll have to clean it up when I get something working.
Status, instant mpg isn't nearly as good as a short term average, so I'm shying away from the analog/tach dwell approach.
I was going to persue obdII/ISO after assembling a real trivial circuit. BUT the scangauge stopped working on the saturn (AGAIN?!?) so I need a non obd solution for that car as the scangauge is back in the metro.
So currently I'm trying to load up Visual C++ 6.0 on an old win 98 laptop that has a line-in jack and will try and modify some simple windows based oscilloscope source I found to keep track of how long the injectors have been open and how many clicks we've travelled. It may miss a few beats under windows, but it should be close enough (and provide a reasonable platform for keeping other useful apps on, i.e. some maps and whatnot)
|
|
|
07-15-2007, 06:04 PM
|
#23
|
|
|V3|2D
Join Date: Mar 2006
Location: southern nj
Posts: 1,516
|
Quote:
Originally Posted by skewbe
Status, instant mpg isn't nearly as good as a short term average, so I'm shying away from the analog/tach dwell approach.
|
i agree, as long as it is accurate.
keep us updated on the progress  
__________________
don't waste your time or time will waste you
|
|
|
07-15-2007, 09:02 PM
|
#24
|
|
I should be WORKING now
Join Date: Dec 2005
Location: Eastern Ontario
Posts: 4,791
|
Forgive my ignorance, but would a Basic Stamp be a good platform for a DIY FE gauge? Anyone know about these?
|
|
|
07-15-2007, 09:27 PM
|
#25
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
A more hardcore embedded person would do it with a handful of counters and a PIC (i.e. basic stamp) and have a standalone device. But the problem becomes the fact that they have to put more complicated circuts together and purchase a special programmer to load the BASIC (or C++ or assembler or whatever) program onto the chip and learn how to operate the programmer, or someone has to sell chips to the "Do It yourselfers".
I see a lot of utility in having a full fledged computer handy though, play mp3 files, talk to your lan from your driveway, run maps/whatever. All my portable computers can run on 12 volts directly (no accident). I've even got a ramline 510 touchscreen (used to be in a cop car) that needs to find a second life which would be ideal for this. But the ramline is a PITA to develop on (as are embedded chips), which may be my real motivation for this approach 
|
|
|
07-15-2007, 09:50 PM
|
#26
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
Ooh yah, and a with a well positioned display you can plug in a $20 web cam that is pointing backwards and shave off those mirrors 
|
|
|
07-16-2007, 12:51 AM
|
#27
|
|
Member
Join Date: Jul 2007
Posts: 150
|
LOL!
So back to an OBD solution then, instead of tapping the injector's duty cycle directly?
Too bad for my '93 OBD-1...
This ALDLcable store sells cables using these schematics except it's voltage adaptation uses a cig. lighter, instead of hacking the DTR line (pin 4 of the serial port):
They sell a $10 OBD2-Serial cable:
OBD2-serial cable
They also list a bunch of freeware used to monitor OBD data.
Othe OBD-1 links:
http://cable.invisibill.net (schematics, used on datamaster, freescan, winaldl)
Last edited by sonyhome : 07-16-2007 at 01:49 AM.
|
|
|
07-16-2007, 05:08 AM
|
#28
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
Quote:
Originally Posted by sonyhome
LOL!
So back to an OBD solution then, instead of tapping the injector's duty cycle directly?
Too bad for my '93 OBD-1...
|
I'm NOT currently planning on doing OBD, it won't help me as my saturn is not happy with OBD MPG attempts, for whatever reason, and I'd like to get something out of my efforts.
I'm planning on the audio approach on a laptop for ease of implementation and more universal application. Any any car with electronic FI should work. One just need a laptop with a Line-In to run the mpg program on and a simple circuit to limit the voltage going in.
|
|
|
07-21-2007, 02:28 AM
|
#29
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
1998 geo metro TBI injector pulse analysis:
44100/8 bit/mono recording using a diode clamp interface and a 10k resistor on a 133mhz laptop with integral sound card via line in left channel . Car in neutral in driveway. Probe connected to yellow wire between fuel injector resistor and fuel injector.
3 samples, 1 low rpm, 1 accalerating to higher rpm, 1 high rpm. Images stretched horizontally for easier duty cycle visualization/comparison.

steadyish @ ~1200
period 1714 bytes
pulse width 119 bytes
duty cycle 0.0694

just starting to ramp up on the way to 2000rpm in neutral
period 1273 bytes
pulse width 137 bytes
duty cycle 0.1076

steadyish @ ~2000rpm
period 833 bytes
pulse width 73 bytes
duty cycle 0.0876
(duty cycle increased for higher rpm and throttle setting.
sanity checks:
(3 pulses/2 revolutions)*2000 rpm=3000 injector pulses/minute = 50 pulses/second
44100/833 = 52.94 pulses/second. Enh, close enough for a single wave analysis.
accelerating had the largest duty cycle (most time spent squirting fuel)
hi rpm has a proportionally larger duty cycle than low rpm.
833 byte sized samples @ 2000 rpm equates to a potential 99.75% accuracy at 4000rpm
Note: this signal doesn't look very clamped to me, maybe 10k is too much or my diodes fried. Agc is having fun with the signal too.
Last edited by skewbe : 07-21-2007 at 07:36 AM.
|
|
|
07-21-2007, 07:59 AM
|
#30
|
|
Senior Member
Join Date: Jan 2007
Posts: 1,103
|
Here's the actual recording
for the above images. It was a raw wav, so I could pipe it through a program for development, but it is here converted to mpeg 3 compression for space considerations. Recorded with windows sound recorder and subsequently compressed with sound recorder.
if you run it in windows media player, set the visualizations to "scope" by:
views->visualizations->bars and waves->scope
OOPS, this is the recording of the wrong channel!! The other side records a bit cleaner.  I sure hope there isn't this much crosstalk when the other channel is plugged into the VSS.
Last edited by skewbe : 11-25-2007 at 08:25 AM.
|
|
|
|