Go Back   EcoModder Forum > EcoModding > Instrumentation > OpenGauge / MPGuino FE computer
Register Now
 Register Now

Now available from EcoModder: ScanGauge II fuel economy gauge.  Click for details.  

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 06-01-2008, 05:08 PM   #1 (permalink)
EcoModding Lurker
 
Join Date: May 2008
Location: St. Louis
Posts: 28

silverciv - '01 Honda Civic EX 2dr
90 day: 36.13 mpg (US)
Thanks: 0
Thanked 0 Times in 0 Posts
OBD MPGuino gauge

Anyone interested in developing an OBD Arduino based fuel economy gauge should post here. So far, I have been working on one based around an ELM323 OBD to RS232 adapter. Some previous discussion on this was on the other thread (Any interest in developing an open source fuel economy gauge/computer?)

Currently, I was able to connect to the ELM and send it commands. However, when sending OBD commands (010c), the response is "ELM INIT:...>" without ERROR or OK and no real data is received.

__________________
  Reply With Quote
Old 06-01-2008, 05:46 PM   #2 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,032

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 156
Thanked 263 Times in 206 Posts
I'm definately interested, but I have to wait. Just a couple thoughts in case this takes off w/out me.

There are so many things that you can display from the obd port that this probably would be a good 4x20 LCD candidate.

Since this is a "higher end" version than the injector based gauge, it's probably ok that it costs a little more (i.e. elm chips, bigger LCD, etc).

Also, I *think* all cars are coming out with the CAN bus now, don't know if that is just North America or what. I did see an atmel CAN processor recently (OBD support built in), but do not know how 'duino compatable that will be, if 'duino is even in the cards for the obd effort (would be nice to not have to learn another platform).

Anyway, there is a lot of interest in the obd approach. It can obviously be a useful tool for your average driver. I do hope something comes of it, at least for the hobby crowd who want complete control of the display AND mpg feedback. The scangauge is not terribly expensive though, so building your own obd mpg gauge will probably be even more of a niche than the injector based version.
__________________
WINDMILLS DO NOT WORK THAT WAY!!!

Last edited by dcb; 06-01-2008 at 05:51 PM..
  Reply With Quote
The Following User Says Thank You to dcb For This Useful Post:
dewasha (07-10-2011)
Old 06-05-2008, 04:39 PM   #3 (permalink)
OBDuino coder
 
Magister's Avatar
 
Join Date: Jun 2008
Location: Montréal, QC
Posts: 210

Titine - '07 Hyundai Elantra GL
Thanks: 3
Thanked 10 Times in 8 Posts
Wink

Hi,

New comer here, I wanted an SGII but I find it pricey, then I discovered your project, pretty cool!

I will have to buy a *duino kit to test, with an LCD screen. And I guess an ELM323 for my car. A few months ago I started to look at various obd2 solution including ELM, jeff interface, palm, 486 laptop, etc.

(I am currently working on a digital and analog I/O low level module on an Atmel AT91, an ARM 32bits RISC, so I know the stuff, and if I have time I will work on your code too).

Great project guys, continue!!

EDIT:
I am wondering if we really need an ELM chip, or if we just communicate directly in the OBD-II protocol, like the "Atmel AVR 2004 Design Contest Project" at http://www.circuitcellar.com/AVR2004/first.html
Maybe wait also for the Atmel 328P to have more RAM?

We should bring also the "xarias" guy here for some help.

EDIT2:
Here's how to connect the OBD-II connector directly to an Atmel:
http://prj.perquin.com/obdii/
(see Microcontroller-OBD interface, second picture)
__________________

Last edited by Magister; 06-06-2008 at 03:42 PM..
  Reply With Quote
The Following User Says Thank You to Magister For This Useful Post:
dewasha (07-10-2011)
Old 06-10-2008, 12:09 AM   #4 (permalink)
Liberti
 
LostCause's Avatar
 
Join Date: Feb 2008
Location: California
Posts: 504

Thunderbird - '96 Ford Thunderbird
90 day: 27.75 mpg (US)
Thanks: 0
Thanked 6 Times in 6 Posts
A nice pricepoint might be tough. Anything much above $50 and the SGII starts to make more sense.
  • RS232 Freeduino ~$15
  • 16 x 2 LCD ~$10
  • ELM 323 ~$15
  • Assorted Parts ~$3
  • OBD-II plug ~$7 (5 minimum)
Junkyard, maybe? It does drop down to $3 after the first 200...

If it's possible, I say drop the ELM. The ELM327 will help with the "one size fits all" aspect as it does every interface...but $30...eek.

- LostCause

Last edited by LostCause; 06-10-2008 at 12:33 AM..
  Reply With Quote
Old 06-10-2008, 09:36 AM   #5 (permalink)
OBDuino coder
 
Magister's Avatar
 
Join Date: Jun 2008
Location: Montréal, QC
Posts: 210

Titine - '07 Hyundai Elantra GL
Thanks: 3
Thanked 10 Times in 8 Posts
I doubt you need an ELM323, on AVRFreaks a couple of people did it without an ELM. Search "obd" on their forums, some people even give some C codes to do it. It seems the ELM is slow too.

I'm sure we can drop the ELM.

To init the OBDII you send 0x33 at 5 bauds then you switch to 10400 bauds and send some commands, plug the Atmel directly on the OBDII like this:
(ISO protocol only)


You could also switch to an AT90CAN128 to speak CAN to your car I guess?
__________________

Last edited by Magister; 06-10-2008 at 09:48 AM..
  Reply With Quote
The Following User Says Thank You to Magister For This Useful Post:
dewasha (07-10-2011)
Old 06-10-2008, 11:20 PM   #6 (permalink)
Liberti
 
LostCause's Avatar
 
Join Date: Feb 2008
Location: California
Posts: 504

Thunderbird - '96 Ford Thunderbird
90 day: 27.75 mpg (US)
Thanks: 0
Thanked 6 Times in 6 Posts
Lightner's article, posted above by Magister, is very well written and in depth. He offers schematics to properly handle the vehicle's 12V power supply and an in depth examination of the J1850 VPW protocol. The end of his article claimed circuit cellar (magazine running the story) would cover all the protocols in the future, but I haven't been able to find them.

In any case, I found the calculations necessary to convert OBD-II PID's to MPG. The information is also posted in the main instrumentation forum. All from Bruce Lightner's mind:

The calculation depends on whether your car has a MAF sensor or not.

MAF Sensor:

MPG = (14.7 * 6.17 * 454 * VSS * 0.621371) / (3600 * MAF / 100)
= 710.7 * VSS / MAF

14.7 - grams of air to 1 gram of gasoline - ideal air/fuel ratio
6.17 - pounds per gallon - density of gasoline
4.54 - grams per pound - conversion
VSS - vehicle speed in kilometers per hour
0.621371 - miles per hour/kilometers per hour - conversion
3600 - seconds per hour - conversion
MAF - mass air flow rate in 100 grams per second
100 - to correct MAF to give grams per second

No MAF (Uses MAP and Intake Temp to approximate MAF):

IMAP = RPM * MAP / IAT
MAF = (IMAP/120)*(VE/100)*(ED)*(MM)/(R)

MAP - Manifold Absolute Pressure in kPa
IAT - Intake Air Temperature in Kelvin
R - Specific Gas Constant (8.314 JM/K)
MM - Average molecular mass of air (28.97 g/M)
VE - volumetric efficiency measured in percent
ED - Engine Displacement in liters

This method requires tweaking of the VE for accuracy.

I have no idea if these are the methods the SGII uses. The accuracy will be off due to approximations (AFR ~14.7, etc). All the information is from the brilliant mind of Bruce Lightner.

- LostCause
  Reply With Quote
Old 06-11-2008, 06:18 AM   #7 (permalink)
EcoModding Lurker
 
Join Date: May 2008
Location: Big City
Posts: 9
Thanks: 0
Thanked 3 Times in 2 Posts
Here are a few open source projects on OBDII maybe can get some ideas.

http://www.obddiag.net/
http://www.sterntech.com/index.php
  Reply With Quote
Old 06-11-2008, 09:25 AM   #8 (permalink)
OBDuino coder
 
Magister's Avatar
 
Join Date: Jun 2008
Location: Montréal, QC
Posts: 210

Titine - '07 Hyundai Elantra GL
Thanks: 3
Thanked 10 Times in 8 Posts
Quote:
Originally Posted by RuHaSs View Post
Here are a few open source projects on OBDII maybe can get some ideas.

http://www.obddiag.net/
Use an ELM, I don't know if we want it.

very interesting, and the schematics are available as well as the sources!
__________________
  Reply With Quote
Old 06-19-2008, 01:04 PM   #9 (permalink)
OBDuino coder
 
Magister's Avatar
 
Join Date: Jun 2008
Location: Montréal, QC
Posts: 210

Titine - '07 Hyundai Elantra GL
Thanks: 3
Thanked 10 Times in 8 Posts
Ok it seems we do not need a "jeff interface" or transistors to connect the K line to the TX/RX of the chip, a single Motorola/Freescale chip already exist that does everything: the MCZ33290EF
Quote:
The MC33290 is a serial link bus interface device designed to provide bi–directional half–duplex communication interfacing in automotive diagnostic applications. It is designed to interface between the vehicle’s on–board microcontroller and systems off–board the vehicle via the special ISO K line. The MC33290 is designed to meet the “Diagnostic Systems ISO9141” specification.
It's the chip used in the Blafusel "KL interface serial cable" and also a obd2-lcd device.

To use it, it's very easy, PD0 and PD1 are direct connect to the Atmel chip:

(picture of their PDF available at http://www.blafusel.de/misc/files/obd2_lcd-b.pdf)

So I tried to get one here in Montréal but can not find one, it's a $1.46 chip but as a special order they want to charge me $8 for it, WTF indeed!

If someone bought some at digikey or your local electronics parts store, I will be glad to paypal you $2 to ship one to me in a standard envelop
__________________
  Reply With Quote
Old 06-23-2008, 12:53 PM   #10 (permalink)
OBDuino coder
 
Magister's Avatar
 
Join Date: Jun 2008
Location: Montréal, QC
Posts: 210

Titine - '07 Hyundai Elantra GL
Thanks: 3
Thanked 10 Times in 8 Posts
I ordered:

- a Freeduino serial V2.0 + LCD display at NKC ($17+$10)
- an OBD plug at CarPlugs.com ($5)
- a sample MCZ33290EF from Freescale ($0)

I should be in business, I will find a 510 ohms resistor somewhere here and some push buttons, it's the only component needed.

I even started to write some codes, I started with standard C but why re-invent the wheel to support digital I/O and all, it's in the Wiring/IDE already. So I went back to the standard IDE, and it will be easier to share with other people.

It compiles, obviously it's not tested, copy/paste in IDE

EDIT July 3rd: Maybe I will not update this post anymore, for all information go to the homepage of the project at http://code.google.com/p/opengauge/

Source is available here:

http://code.google.com/p/opengauge/s...no/obduino.pde

CABLE
-----
To keep compatibility with already existing cable, the OBD-II to DB9F cable is wired like this:

Code:
DB9F			OBD-II
1---------------5 (Signal ground)
2---------------4 (Chassis ground)
3-NC
4---------------7 (ISO K line)
5-NC
6---------------10 (J1850 bus-, future use)
7---------------2  (J1850 bus+, future use)
8-NC
9---------------16 (Battery)
Do not plug it into a PC!!! This goes to an interface only!!!

You can make it yourself with an OBD-II plug available at http://www.carplugs.com/ for $5+$3sh.
Use at least AWG24 wires especially for Battery and Chassis ground.

Or buy an already made cable at http://www.obd2allinone.com/ for $10+$5sh

INTERFACE
-------
The cable goes into an interface to adapt the ISO signal for the Arduino input.
It concists of a small IC, a resistor, a DB9M that will be plugged with the cable mentionned above, and a few wires that connect to the Arduino board.
Schematic is like this:

Code:
                             MC33290
                            +-------+
Arduino pin 3 -------------5|TX  ISO|4-----------------+------- DB9M pin 4 (ISO K Line)
                            |       |                  |
Arduino pin 2 -------------6|RX  GND|3--DB9M pin 1     / between MC pin 4 and pin 1
                            |       |                  \ goes a 510 ohms resistor
Arduino 5V pin output -----7|VDD  NC|2--               /
                            |       |                  |
Arduino 5V pin output -----8|CEN VBB|1-----------------+------- DB9M pin 9 (12V Battery)
                            +-------+
The Arduino is powered by the 12V line coming from the cable too
Code:
Arduino 12V input ------------------ DB9M pin 9 (12V Battery)
Arduino GND input ------------------ DB9M pin 2 (Chassis Ground)

__________________

Last edited by Magister; 07-04-2008 at 03:02 PM..
  Reply With Quote
Reply  Post New Thread

Tags
obd2

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
MPGuino release one workspace dcb OpenGauge / MPGuino FE computer 1052 06-04-2014 08:37 PM
Just some quick info on Scangauge vs. MPGuino NoCO2 OpenGauge / MPGuino FE computer 1 10-07-2009 05:35 PM
All New Nissan Models to Feature Fuel Efficiency Gauge MetroMPG General Efficiency Discussion 6 11-18-2008 04:57 PM
Vacuum gauge problems :( DifferentPointofView Instrumentation 3 05-14-2008 11:04 PM
Will Scan Gauge work on mine? bennelson Instrumentation 9 02-19-2008 10:04 PM




Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com