Dec 252010
 

Intrucat am vazut o cerere foarte mare de montaje care sa prezinte parametri automobilelor , public aici ceva proiecte gasite pe net si care pot fi contruite cu un buget foarte mic

Introduction

The OBDuino is an in-car real-time display of various information, like speed, RPM, instant fuel consumption or average trip fuel consumption as well as others PIDs supported by the car.

Details

The name OBDuino comes from OBD which means On Board Diagnostics and from the development board which is an Arduino (or a clone).Technical info: It is based on an Atmel AVR ATMEGA168P chip that contains 16K of flash, 1K of RAM and 512bytes of EEPROM, an LCD display, 3 buttons, a few $ of electronics components.

The OBDuino connects to the car on its OBD-II plug which is, in general, under the dash. A lot of signals are on this plug as well as battery voltage and ground. Using a standard OBD-II to DB9F cable brings us what we need.

The interface to the car is made with either a Freescale MC33290 for ISO only, a Microchip 2515 for CAN only, or an ELM327 (a third-party pre-programmed PIC) that talks PWM/VPW/ISO/CAN but it is more expensive and can require more hardware work if you want to use all protocols.

OBDuino can display 4 informations at a time, and there is virtual screens to have access to others PIDs. By default there is 3 screens available so it makes 12 PIDs available quickly.

Main Hardware

The Arduino or a clone can be purchased assembled, in a kit, or you can even etch it yourself. Take the flavour you want for serial or USB depending on your PC/laptop configuration (you need the port to program the chip). All the clone should work the same, except the very small one that use 3.3V and 8MHz and even there, it should work too with some adaptation. It costs about $15-$33 depending of your choice.

To play with, you can start with a „big” board like an Arduino Diecimila or a Freeduino SB, and to integrate in the car you can use a Boarduino or an iDuino by after.

The LCD screen used is a 2 rows x 16 characters using a standard HD44780 or compatible chipset, they can be found on eBay for $4, and they exist in almost every colours as well as STN, FSTN and even OLED (although more expensive).

The 3 buttons are momentary push button switches, take the one you want. You also need a 220 ohms resistor and a PNP 2N3906 transistor or equivalent like an NTE159 to drive the LCD brightness, as it can take up to 200mA on some LCD and the pin used to drive brightness is limited to about 20mA. radio-shack has them, or online electronic parts seller like Digikey or Mouser.

With this you have the main hardware and now need the car interface.

Interfaces

The code can use multiple interface (although one at a time), you will need to make the interface specific for your car, see Interface. If your car is sold in north-america and is a 2008+ it uses CAN so you can built the interface using Microchip MCP2515 and MCP2551.

Interface connect to the Arduino on a few pins, depending on your choice, the LCD will be connected differently, see Diagram.

Menu Configuration

Role of the three buttons

realtime display menu display
LEFT rotate screen decrease, select NO
MIDDLE go into menu apply and go to next item
RIGHT rotate brightness increase, select YES
MIDDLE+RIGHT trip reset
MIDDLE+LEFT tank trip reset

Reset trip data (NO/YES)

When you press middle and right button, a screen appear: Select if you want to reset the data and press middle button to ack.

Reset tank data (NO/YES)

When you press middle and left button, a screen appear: Select if you want to reset the data and press middle button to ack.

Configuration menu (accessed by middle button)

LCD Contrast (0-100)

Set the LCD contrast from 0 to 100 in step 10

Use Metric units (NO/YES)

NO=rods and hogshead, YES=SI

Fuel/hour speed (0-255)

Speed from which the display go from L/100 or MPG, to L/h or GPH

Tank size (n.m)

Size of your tank in litres or gallon

Volume Efficiency (0-100%) (MAP only)

For vehicles with a MAP only we have to emulate the MAF. This percentage will needs adjustment after you have checked manually a few tank to approximate better the fuel consumption.

Engine Displacement (0.0-10.0) (MAP only)

For vehicles with a MAP only we have to emulate the MAF. This is the size of the engine, e.g. 2.0 for a 2Liter one.

Configure PIDs (NO/YES)

Choose if you want to configure the PIDs in the various screen.

Scr ‘n’ Corner ‘m’ (0x00-0xFF)

(if you have selected YES at the previous item) Select the PID you want to be displayed on screen ‘n’ in the corner ‘m’. A good list of PIDs is on Wikipedia here Some specials PIDs you can access (either by decreasing below 0 or by going far up):

  • 0xF0 – no display, meaning this corner will be blank, can be useful if another PID result is more than 8 characters
  • 0xF1 – Instant fuel consumption
  • 0xF2 – Average fuel consumption of the tank (since last tank reset)
  • 0xF3 – Fuel used in the current tank
  • 0xF4 – Distance done on the current tank
  • 0xF5 – Remaining distance that can be done on the current tank
  • 0xF6 – Average fuel consumption of the trip (since last trip reset)
  • 0xF7 – Fuel used for the current trip
  • 0xF8 – Distance of the current trip
  • 0xF9 – Battery voltage
  • 0xFA – CAN status, for CAN protocol only, display TX and RX errors

Some pictures of the main hardware

A clone board called the freeduino, some headers were missing when I took pictures:

The LCD screen with its wires attached, note the transistor and the resistor, covered by (not yet heated) shrink tube, on the right side:

Example of the Freeduino and LCD attached:

CAN Diagram

Here’s the proposed diagram of the Arduino board, the LCD screen, and the CAN interface.

Hardware for CAN

You need:

  1. a duino clone board, serial or USB, your choice
  2. an HD44780 compatible LCD screen 2×16
  3. a transistor 2N3906 or NTE159 or equiv
  4. three small push buttons
  5. a 220 ohms resistor
  6. the CAN interface

ISO Diagram

Here’s the proposed diagram of the Arduino board, the LCD screen, and the ISO interface.

Hardware for ISO

You need:

  1. a duino clone board, serial or USB, your choice
  2. an HD44780 compatible LCD screen 2×16
  3. a transistor 2N3906 or NTE159
  4. three small push buttons
  5. a 220 ohms resistor
  6. a Freescale MC33290 ic
  7. a 510 ohms resistor
  8. a DB9 male

Freeduino, LCD, ISO interface:

OBDuino OBD2 cable and Interfaces

Introduction

You cannot directly connect pins from the OBD-II plug to the Arduino board. You need a small interface that convert the signal.

Whatever the interface needed, you also need a cable that will bring you the signals from the OBD-II plug to your OBDuino.

For all cases: The Arduino is powered by the 12V line coming from the cable too so you need to bring some wires from the DB9M to the Arduino like this:

Arduino 12V input ------------------ DB9M pin 9 (12V Battery)
Arduino GND input ------------------ DB9M pin 2 (Chassis Ground)

Some cars have only one ground so you may have to use DB9M pin 1 instead of pin 2 to power the board or just solder pin 1 and 2 together

Cable

To keep compatibility with already existing cable, the OBDuino Interface pinout for the OBD-II to DB9F cable is wired like this:

DB9F                    OBD-II
1---------------5  (Signal ground)
2---------------4  (Chassis ground)
3---------------6  (CAN High)
4---------------7  (ISO K line)
5---------------14 (CAN Low)
6---------------10 (J1850 bus-)
7---------------2  (J1850 bus+)
8---------------15 (ISO L Line)
9---------------16 (Battery)

Do not plug it into a PC!!! This goes to an interface only!!!

Example of my home made cable:

A nice place to get OBD-II plugs and already made cable is Senso which are located in Canada.

You can also find plugs at http://www.carplugs.com/ or http://www.obd2allinone.com/sc/details.asp?item=obd2cable and others.

CAN only cable

A proposed CAN only cable, smaller and thinner, can be wired like this:

RJ-10                   OBD-II
1 (black) ------5  (Signal ground)
2 (red)---------14 (CAN Low)
3 (green)-------6  (CAN High)
4 (yellow)------16 (Battery)

source http://www.controllerareanetwork.com/CANcables.htm

Interfaces

Interface for ISO

This interface converts the ISO signals for the Arduino inputs. It consists of a small IC (Freescale MCZ33290EF), a 510 ohms resistor, a DB9M that will be plugged with the cable mentioned above, and few wires that connect to the Arduino board.

The MC33290 is a small chip, you can solder some wires on it for better handling. 

Schematic is like this:

                             MC33290
                            +-------+
Arduino pin 1 -------------5|TX  ISO|4-----------------+------- DB9M pin 4 (ISO K Line)
                            |       |                  |
Arduino pin 0 -------------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)
                            +-------+

Interface front:

Interface back:

Interface with ELM

CAN protocol is not easy to program so as a phase 1 I am using an ELM327 for this. This chip integrates all protocol so it could be used for ISO/VPW/PWM as well, but it’s a $32+s/h chip that add to the duino and LCD, plus a few components.

Note that for PWM/VPW it should be possible to use an ELM320 or ELM323 respectively, which is cheaper than the ELM327 and would require almost no change to the code, but you would still need to do some hadware, schematics are avalaible on some web site.

Diagram of the interface (adaptation of the generic diagram found in the PDF of the ELM327):

On the diagram, note that CAN-L (OBD2 pin 14) go to a DB9M pin 5 and CAN-H (OBD2 pin 6) go to a DB9M pin 3. +5V comes from the Arduino board.

Interface for CAN

Microchip offers solution for CAN bus, mainly their MCP2551 for the physical layer (as on the ELM327 diagram above) and their MCP2515 for the protocol. The advantage is that it costs only a few $. To manipulate CAN message, I use a free library made by Fabian Greif called libcan, his library also supports manipulation of the MCP2515 through SPI with an AVR, it’s a little bit technical but let’s say it helps me a lot as I do not have to re-invent the wheel!

Si in sfarsit si codurile

http://code.google.com/p/opengauge/source/browse/#svn%2Ftrunk%2Fobduino

http://code.google.com/p/opengauge/source/browse/#svn%2Ftrunk%2Fobduino32K

Participa si tu la dicutii pe forum !

 Posted by at 23:40