![]() |
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 (http://ecomodder.com/forum/showthrea...ge-1428-9.html)
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. |
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. |
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) |
A nice pricepoint might be tough. Anything much above $50 and the SGII starts to make more sense.
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 |
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) http://prj.perquin.com/obdii/obdii_avr.gif You could also switch to an AT90CAN128 to speak CAN to your car I guess? |
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 |
Here are a few open source projects on OBDII maybe can get some ideas.
http://www.obddiag.net/ http://www.sterntech.com/index.php |
Quote:
very interesting, and the schematics are available as well as the sources! |
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:
To use it, it's very easy, PD0 and PD1 are direct connect to the Atmel chip: http://lemondedefred.googlepages.com/33290.gif (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 :) |
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 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 Code:
Arduino 12V input ------------------ DB9M pin 9 (12V Battery) |
All times are GMT -4. The time now is 04:48 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com