MPGuino

From Combustory
Revision as of 12:52, 15 August 2008 by Combustor (Talk | contribs)
Jump to: navigation, search

Arduino Communications Page


Any questions or comments, send them to - combustor@combustory.com

Contents

Summary

This is an impressive use of the Arduino platform. One that will actually pay for itself too. A small group of folks banded together and created an open platform called http://www.openguage.com where you will not really find much information concerning this device, but there is lots of information in a forum at http://www.ecomodder.com, where you will find tons of useful and fun ways on improving gas mileage for any car. To explain what these folks did for the average working Joe, who can't quite afford a car newer than 1995, is just amazing.

They came up with a way to build a reasonably low-cost device that will gauge your MPG, even for cars that do not have an OBD-II interface in there car. At the moment it is restricted to use in cars with fuel injection, but given enough time they may even find a way to gauge cars with carburetors. To cut to the chase, this device uses inputs from the Vehicle Speed Sensor(VSS) and one fuel injector control wire, both of which are easily found in just about all fuel injected cars, minus mechanical fuel injection, which only Mercedes seemed to make reliably albeit expensively. So, sorry all those 300E owners, you can't play with this toy right now.

The device sports an LCD screen with several features. (Note: Describe features here)

Functional Description of the Solution

To further detail the solution, the VSS provides a pulse input related to the speed and distance traveled, meaning from this sensor you know how fast the car is going from the pulse frequency and how far the car has traveled by counting the actual number of pulses. Pulses per mile vary from car to car and based on the forum I saw a range in the 4,000 - 10,000 pulses per mile. The injector control wire provides the fuel flow mass. By making the relation of the known flow rate of an injector and the amount of time that the injector is turned on, you can calculate the the actual fuel mass flow rate your car is using.

On the electronics side they used the Arduino platform as the microprocessor and threw in some supporting components to prevent small fires that create anger and horrible smells. I hate the smell of fried electronics, unfortunately I know it too well. The microprocessor polls the sensors in the micro-second realm, and writes the results to the LCD in the 1/2-1 sec. realm. This gives the user a near real time view of the actual data.

There really is not much at the high level design function, but as they say, "The Devil is in the Details".

Theory of Operation

Fuel Injectors


VSS - Vehicle speed sensor


Requirements and Knowledge

  • Basic soldering and electronic building skill
  • The following parts list for the Arduino assembly
    • 2 5.1v zener diodes
    • 1 2n3906 PNP Transistor
    • 1 220 ohm resistor
    • 2 100k resistors
    • 3 tactile switches
    • 1 freeduino arduino clone (any arduino can probably be made to work) i.e. an iduino: http://spiffie.org/kits/iduino/ or a Freeduino
    • 1 LCD (others might work as well, check pinout and chipset, etc). 16x2 LCD Module While Characters Blue Backlight Or a green one from sparkfun or mouser (a number of folks like the green ones better)
    • Sufficient Perfboard
    • A case to hold it all together
  • Additional parts for the iDuino assembly
    • 1 7805 Voltage Regulator
    • 1 1n4004 diode
    • 330 uf cap
    • 1 .1uf cap.
  • You will need to find the wires for the VSS on the vehicle computer or control unit.
  • If you're lucky you won't need much troubleshooting skills

Assemble the Electronics

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. The LCD screen is at the top of the schematic and note the only two output leads for the VSS and the injector.

Arduino Assembly Schematic

MPGuino Schematic.GIF


Arduino Assembly Schematic

IDuino Schematic.GIF


SW Release notes

Here are the latest release notes as of this writing. Get the latest SW from http://opengauge.googlecode.com/svn/trunk/mpguino/mpguino.pde


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

Personal tools
Sponsers
Your Ad Here
Your Ad Here