CARVIEW |
MPGuino
From EcoModder
MPGuino Page
Contents |
Assemble the Electronics
Preassembled units now available: https://opengauge.org/mpguino/
If you are using the kit refer to https://spiffie.org/kits/mpguino/assemble.shtml Other wise follow the Schematics.
Here are the schematics. This should be enough for most of you. There are two assemblies that are possible to build. The Arduino or the IDuino.
Notes:
- The only inputs are leads for the VSS and the injector, and a 12vdc supply, that is it.
- The Analog pins in this schematic show 0-5 are used as digital I/O, therefore, Analog pin 0 is Digital pin 14 then count up from there.
- After assembly, use the Mpguino_tests to verify your interface wiring.
Arduino Assembly Schematic
IDuino Assembly Schematic
comment3,
Table of Car Settings
If you have mpguino data for your car, add a line for it here (by year/make/model)
Car Year Make Model | Engine | Transmission | VSS (count/mile) | usec/gal | Notes |
---|---|---|---|---|---|
1989 Chevy Celebrity | 3.1 | 4 spd auto | 4002†† | 0251500000 | |
1989 Pontiac 6000 | 2.8 | 4 spd auto | 8000 | 0251500000 | |
1989 Pontiac Grand Prix | 3.1 | 4 spd auto | 4000 | TBD | |
1990 Mitsubishi Eclipse GST | 2.0 litre | 5 speed | 16364 | 126180393 | |
1990 Toyota Camry LE | 2.0 Liter (3S-FE) | Automatic | 8396* | 1584108048* | |
1991 Geo Metro Xfi | 1.0l | 5 Spd. | 8231 | 0488554960 | |
1992 Mazda B2600i | 2.6L | 5 spd Man | 8390 | 0208212230 | |
1992 Plymouth Acclaim | 3.0L | 3 spd auto | 6000 | ? | |
1992 Pontiac Trans Sport | 3800 | 4 spd auto | 8005 | 0178435000 | |
1991-3† Toyota Previa | 2.4 2TZ-FE | 4 spd auto OD | 7885* | 0250463822* | |
1993 Toyota Tercel | 1.5L 3E-E | 4 spd manual | 8210* | 0407042608* | |
1994 Suzuki Swift GA Sedan | 1.3L DOHC | 5MT | 7880* | 0468436463* | |
1994 Chevy Astro Van | 4.3L Vin 'Z' | 4spd auto | 4002 | 0055314688* | |
1995 Acura Integra LS 2DR | 1.8L DOHC | 5MT | 8188 | 0201012289* | |
199X Jeep Wrangler** | 4.0 Liter | Manual | ???? | ???? | |
1997 Saturn SL2,SC2,SW2,S2 | 1.9 | 10000 | 0289967320 | ||
1998 Metro | 8208 | 0500000000 | |||
1999 Ford Escort ZX2 | 2.0L ZETEC | 5MT | 16000* | 0284210526* | |
2003 Nissan Xterra XE | 3.3L | Automatic | 4100 | 179218375 | |
2005 Subaru Impreza Outback Sport, 2.5RS | 2.5L N/A | 5MT | 8000 | 183165000* | |
2007-8 Honda Fit | 1.5L | Automatic | 8295 | 0312000000 | |
1997 Audi A6 Quattro | 2.8L | Automatic | 13406 | 200500000 | 1,2 |
(*)Calibration still under way. (**)The infamous 1996 Jeep Wrangler was never produced. Jeep did not manufacture a Wrangler for that Model Year. It was cut off in 1995 and resumed in 1997. 1986-1995 Wrangler YJ's had Square Headlights, and in 1997, they went back to round headlights, if that helps the owner distinguish which model year they have. (†)My reasearch shows all gen 1 Previas have the same VSS pulse but injectors may be different on supercharged models. (††)Vehicle is getting pulses from cruise control circuit. 8000 PPM may be expected if tapping into speedometer circuit.
Notes:
1. Audi (97 A6) speedometer has K=6703 on bezel, that's pulses per mile, MPGuino counts VSS rising and falling = 13406.
2. Audi (97 A6) uSec per gallon based on fuel flow signal from injector.
Useful Links
Excel spreadsheet to figure microseconds/gallon from Lbs/hr or cc/min (thanks wagonman76) [1]
Injector Selection Guide Calculator. If you know your engine's horsepower, and the number of injectors, it will give you a best guess [2]
Injector list with flow rates: [3]
Online repair manuals including electrical diagrams[4]
VSS values for many models '86-'95 (Rostra Precision Controls)[5]
VSS values for many models '96-'08 (Rostra Precision Controls)[6]
Screens and Functions
1. "Custom":
| MG Instant MPG | S Instant Speed |
| GH Instant GPH | C Current MPG |
1. "Instant/Current":
| IM Instant MPG | S Instant Speed |
| CM Current MPG | D Current Miles |
2. "Instant/Tank":
| IM Instant MPG | S Instant Speed |
| TM Tank MPG | D Tank Miles |
3. "BIG Instant":
| Instant MPG |
4. "BIG Current":
| Current MPG |
5. "BIG Tank:":
| Tank MPG |
6. "Current":
| MH Current MPH | MG Current MPG |
| MI Current Miles | GA Current Gallons |
7. "Tank":
| MH Tank MPH | MG Tank MPG |
| MI Tank Miles | GA Tank Gallons |
8. "EOC mi/Idle gal":
| CE Current EOC Miles | G Current Idle Gallons |
| TE Tank EOC Miles | G Tank Idle Gallons |
9. "CPU Monitor":
| C% Max %CPU utilization | T Tank run time |
| Free Memory (bytes) |
There is also a setup screen that displays the first time the program is run and by pressing all three buttons at once. It walks you through the following setup variables. Use left and right buttons to select the digit you wish to change or the OK or Cancel (XX) items. Use middle button to rotate the current digit or select OK or XX if that is where the cursor is. Selecting OK will save the currently displayed value to the current variable and advance to the next variable. Selecting XX will just advance to the next variable.
Contrast - This comes up first on a brand new run and changes on the screen are immediate so if you can't see anything try pressing middle button a few times.
VSS Pulses/Mile - use this to adjust displayed speed/miles. If the speed/miles displayed on the mpguino is low then decrease this number by the percentage that it is off and vice versa for high readings. Most asian cars will be a multiple of 8204 and GM will be 10000, we are hoping users will contribute model specific data here.
MicroSec/Gallon - use this to adjust displayed fuel consumption. You may want to readjust this initially to get a ballpark MPG reading (after VSS Pulses/Mile is deemed accurate), then calibrate it with a couple fillups. If the mpguino displayed MPG is high or the displayed tank gallons is low at fillup then reduce MicroSec/Gallon by the percentage that the gallons are low or the displayed mpg is high. Like the vss pulses, this would benefit from user contributions about what values work for what specific cars.
Pulses/2 revs - not currently used, but a single injector on a 4 cylinder sequential system will make 1 squirt in 2 revolutions. Hope to be able to base RPM on this at some point.
Timout(microSec) - defaults to 7 minutes. If there are no injector or speed signals from the car and no buttons are pressed in that time then the display backlight turns off. When activity resumes the display will turn back on and the current trip will reset and the tank trip will be restored to the point of last activity.
Tank Gal * 1000 - not currently used, but defaults to 13300 or 13.3 gallons.
Injector DelayuS - Represents the mechanical delay of the injector in microseconds. Advanced topic.
Buttons: Current button assignments as follows, left: cycle through screeens in reverse middle: cycle through pre-defined brightness settings right: cycle through screeens forward left+middle: tank reset right+middle: current reset left+middle+right: go to setup screen
Installation notes: For Identifying where to tap into the fuel injector: 1. turn on the ignition, leave engine off. 2. Unplug an injector. 3. With a voltmeter, measure the voltage on each injector connection. One should be 12 volts and the other should be more like 0. You will want to tap into the one that is at 0 volts.
For finding the VSS hookup, there are several approaches, but at the bottom of Technical Support is a tool that might help you identify the VSS wire location and color. Also here is another online source of ECU pinouts, I'm sure there are more: ECU Pin-out Diagrams :: Innovate Motorsports Application Notes
IMPORTANT, you must be very deliberate when hooking up the mpguino to your cars battery power. There have been several cases where people had to reflash their atmegas and it is noted in the datasheet that the flash memory can be corrupted if the power requirements are interrupted. So line up those pins and get it hooked up the first shot.
On my saturn I tapped into an injector ground lead, and used ground and battery voltage and speedo (possibly vss) signal from the ecu plugs.
Troubleshooting/FAQ
Will unplugging the ECU of my vehicle mess anything up?
No, granted you make sure you restore the original connections/plugs.
Do I need to disconnect the negative terminal of my battery before connecting the MPGuino to my vehicle?
It is generally a wise idea to do so when working with any vehicle wiring or power, as is the case with this project.
What if my LCD text is messed up or frozen?
First, try power cycling the unit. Unplug the power source, wait 20 seconds, then plug it back in. This wait period is important. If you plug it back in too soon you may freeze the bootloader in a loop and you will have to reload the program: [7] Copy and paste the code into the Arduino 0011 Alpha program which you can download from: [8], Then "upload to I/O board" on your MPGuino using a USB cable. The correct baud rate for upload is 19200, on the spiffie kit MPGuino.
"Make sure the jumper is correctly placed for the power source that you are using. You can also try simultaneously pressing the left and right buttons in order to reinitialize the LCD.
When connecting the injector lead to the MPGuino, do I need a signal from each injector?
No, you only need one injector signal. Make sure it is the 0V side of the injector that receives the ECU signal.
Can I use any LCD, or am I stuck with the one in the parts list?
You may use another LCD, but the connections and source may have to be changed in order for the LCD to function properly. It is best to stick with either the green LCD or the blue LCD. A number of users prefer the Green LCD as it has less glare in daylight, but others like the looks of the blue one.
What power source should I use for my MPGuino?
You should tap into battery. In other words, you don't want switched power (i.e., power that is only on when the key is turned). A couple of places to start would be the power and ground leads of the ECU or the non-switched power of your stereo head unit. Consult wiring diagrams or documentation for more details for your specific vehicle.
What are good starting values for VSS pulses per mile and injector uSeconds/gallon?
For the injector numbers, please look at this post. The injector number can be fine-tuned after comparing the gallons displayed on the MPGuino with the actual gallons used to fill up. Repeat for a few fillups to get a more accurate reading. Multiply or divide the usec/gallon by the factor you are off in order to fine-tune the number. For the VSS, start with a multiple of 8204 for foreign cars and 10000 for GM vehicles. In order to get a more exact number, you need to calibrate it based on a known distance and multiply (or divide) by the factor that you are off. Repeat until you are satisfied with the accuracy.
Why is analog pin 0 labeled as digital pin 14?
They are one in the same. digital pin 14 is analog 0, digital pin 15 is analog 1, and so on.
Can this be used on a carbureted engine?
See this post or this thread for more information.
SW Release notes
Here are the latest release notes as of this writing. Get the latest SW from opengauge.googlecode.com
02/02/2009 updates for v0.75
added the instant gph fix per fx57. See https://ecomodder.com/forum/showthread.php/instant-gph-jitter-fix-6861.html for details.
10/01/2008 updates for v0.74
added a small serial transmitter function. The guino now outputs the following data over the serial port at 9600 baud every half second: instantmpg,instantmph,instant.injHius,instant.injP ulses,instant.vssPulses
So "realtime" laptop/cellphone integration should be a snap if your guino has a usb/rs232 connection or you can build one and you can gather the data on the laptop/cellphone. This also has applications for remote displays.
I also added a #define usedefaults so that you can build the guino without a lcd if you intend to only use it with a laptop/cellphone. It will simply skip the setup screen/loading of eprom values.
Since all the interesting data is already going over the serial port now, I removed the debug ifdef branching.
9/20/2008 updates for v0.73
added large comment about only running on arduino 0011 to top of program
fixed strange instant bignum eoc display
added VSS Delay ms setup parm (default to 2, can set to 0 but distance accuracy may suffer)
added "move to next field" in editor, press left and right simultaneously to move to OK, XX, first digit.
replaced RPM with GPH on custom screen, more universal.
Updated eprom loader/saver. Keeps track of number of parameters in eprom so a new version can default new setup parameters.
updated addEvent to just call the event if time parameter is 0
9/10/2008 updates for v0.72
to get to setup, use left and right buttons now. No middle button there, so less accidental resetting of current or tank trip.
Added eoc miles/Idle gallons screen after tank data. Tracked for current and tank. Layout: Current EOC Miles, Current idle Gallons Tank EOC Miles, Tank idle Gallons
removed raw screens
default contrast set for green display 95
Default to metro values, 500000000 us/Gallon, 8208 vss pulses/mile, 3 pulses/2 revolutions
instantmpg returns 999999 in eoc now
used ishi's formatter, and jmilk's brightness suggestion to get it to fit.
sketch 14104 bytes, 303 bytes ram free, cpu %51
9/8/2008 updates for v0.71
1. Settled on 1/2 second average for vss. Metro is reasonably smooth now.
2. Added Custom screen as first screen with following layout. INSTANT MPG, MPH RPM, CURRENT MPG Tweak doDisplayCustom function to put different values if you like.
3. Added rpm (you have to get the pulses per 2 revolutions parm right)
4. Added instant gph function (not displayed by default)
Notes, instant mph is a small bit wobbly on the signal generator and rpm also seems to read a bit high. But it is definitely an improvement.
I also had to ifdef out tons of stuff when in debug mode just to get the Serial library to fit. So bignumbers and parameter editor won't work in debug mode as-is.
sketch size: 13814 bytes, free mem 325, CPU% 52.42. We are for all practical purposes at the limit without a major re-write or some serious optimization and retest work, or an atmega328, or?
8/9/2008 updates for v0.70
More experiments with vss processing. Instant mph is very smooth on saturn but still jumps a bit on the metro. Distance reading on metro appears reasonably accurate (102.6 miles on odo, 102.18 on mpguino using 8208 vsspulses/mile). So the guino is doing a pretty good job of counting the vss pulses, it is a little erratic in timing the pulses though.
want to add EOC miles to the trip next, don't know if it will fit sketch size: 12884
8/1/2008 updates for v0.69
Added event handler and added debouncing on vss. Still trying to clean up reed switch vss signal via software with no luck. will make separate post for vss issue.
Added instantaneous mph (mpg is next), this looks at the time between vss peaks to determine the speed instead of the number of pulses in the last half second, which was jumpy at slow speeds. We are getting really really tight on space. That might also be an issue when 0012 comes out (don't know when).
8/1/2008 updates for v0.68
Removed all dependencies on timer0 so we should be arduino 0012 compatible. This also establishes an ISR under our control for scheduling events. Disabled Timer0 so use millis2(), delay2(), etc.
Knocked off a few hundred bytes by converting LCD to a namespace instead of a class.
7/10/2008 updates for v0.67
Incorporated LCD timings from Yoshi, removed pin 15 code and power up detection code.
moved source code to google/svn Revision 32: /trunk
other happenings: did a test with the scope regarding the voltage drop at peak pulse. I had the guino set a pin high and low within the interrupts receiving high and low and the pulse widths were the same except the generated one was perfectly square. So that is a good thing. Will need to test exactly what voltage level is acceptable.
The power supply on the scope died I think I just need a new TL431C or NTE999 though. I didn't get a chance to witness the vss bounce, the scope died during the attempt.
I am planning on moving all timing critical code to timer 2 with an event handler. I need real interrupt style debouncing for the vss and might as well use it as an event scheduler for debouncing the buttons as well as whatever else. This move will also allow for arduino0012 compatability.
6/27/2008 updates for v0.66
ADDED AN ONBOARD VARIABLE EDITOR!!! VARIABLES STORED IN EEPROM!! Now you can upgrade and not lose your settings and make adjustments in the car. Refer to post 1[/url] for screens and edit usage.
Updated screens descriptions in post 1
Checked source into sourceforge.net, linked post 1 to sourceforge (ran out of room again and wiki didn't like the extension .pde).
Sketch size 11734, 448 bytes free
6/26/2008 updates for v0.65
Added 7 minute activity timeout. It saves the state of the persistent trips (just tank for now) at the point of last activity and after 7 minutes of no injector pulses/vss pulses/or button presses, it turns off the LED backlight and sets up current to be reset and tank to be restored when activity resumes.
Despazed the buttons and Screen labels so they display for a second and accidental double button presses are minimized.
Running out of excuses (and room) to no do the user input/eprom setup screen thing Sketch size 10502 bytes.
6/23/2008 updates for v0.64
Fixed instant/tank screen (was displaying instant/current on that screen).
Improved LCD reinit on reprogram/reset. Can (usually) tell if LCD needs reinitializing. Press left and right buttons to force an LCD init if necessary. Want to free pin 15 for future tasks if it works well enough.
Added a bit of default verbiage to debug mode.
Working on a portable scope deal.
6/20/2008 updates for v0.63
Wrote 64bit arithmetic routines, yay no more messing with "ifs" when it should be math!
Noticed double vss count didn't make it in .62, fixed.
Subtracting 500uS from each injector pulse.
Added cli/sei around top of loop trip copy.
Made big font a smidgeon bolder.
Code updated, sketch size 9812, CPU 54%, free mem 602
Views
Personal tools
- This page was last modified 15:42, 20 February 2009.
- This page has been accessed 16,825 times.
- Privacy policy
- About EcoModder
- Disclaimers