Archive for January 15th, 2009

In search of an ECU emulator

Having to be in close proximity of your car all the time, within a metre of the ECU is not very practical for me so I’ve two options: Find a Software Emulator that will emulate the ELM327 interface or else set up a physical ECU standalone out side of the car.

The idea of setting up a standalone ECU was interesting and doing some research into the MEMs ECU system of my MG I figured out the input and output pins of the ECU.

Rover/MG ECU I/P & O/Ps

Rover/MG ECU I/P & O/Ps

Looking on Ebay I didn’t see many offers for ECU’s that are modern enough to support OBDII protocol so done a little searching for emulators.

I came across this site: http://www.geocities.com/darkyp/eng/ecuemulator.html. ECU Emulator (ECUEmu) is a handy piece of software that simulates or more emulates the actions of the ELM327 chip and the Jeff interface. I came across Jeff’s interface previously but opted out for the ELM327 as it supported much more. The ECU emulator requires that you have two computers, each with serial port. ECUEmu attaches to one and you can use hyperterminal at the other end to get the ELM327 > prompt.  I attempted to create a virtual emulated port pair using com0com but unfortunately it didn’t seem to work with ECUEmu. Fortunately though I have 2 usb->serial adaptors for the laptop and a null modem cable so I done a loop back between the two. Laptop->USB->Serial->nullmodem->Serial->USB->Laptop. I set up ECUEmu on one side and used the default settings for hyperterminal on the other (9600, 8N1). I got a prompt. Next to test it, I set the value of the engine RPM to 1A1Ch  and done a look up using hyper terminal by typing in hex 010C (Mode 01 with PID code of 0C. Click here for more details). The returned value then was 2 bytes, 1A1C. The 1A1C is the value we set above and to convert this to a real value you use the conversion formula: ((A*256)+B)/4. Here A is the decimal equivalent of the first byte 1A h (26) and B is the decimal equivalent of the other byte 1C  (28)  so we get ((26*256) + 28/4) = 1671 so our value for RPM is 1671rpm at least it should be!. To confirm I opened up a OBD Program and connected it to the com port associated with the other end of the null modem cable. The results I obtained from it did indeed match so success!

ECU Emulator Output and Hyperterminal

ECU Emulator Output and Hyperterminal

So there I have it, an obtained RPM value from the ECU Emulator. This should save a lot of trouble and not having to be next to a car all the time.  However by the looks of the program it only supports OBD Mode 0, these values such as RPM, Speed etc. I’ve to figure out how to test Diagnostic Trouble Codes (DTCs) as well. This may require me to set up a proper ECU later on and simulate something like a miss fire, how I’ll do that I’ve no idea.

Modes of OBD

There are 10 modes specified by SAE J1979 OBD standard:

  • $01. Show current data
  • $02. Show freeze frame data
  • $03. Show stored Diagnostic Trouble Codes
  • $04. Clear Diagnostic Trouble Codes and stored values
  • $05. Test results, oxygen sensor monitoring (non CAN only)
  • $06. Test results, other component/system monitoring (Test results, oxygen sensor monitoring for CAN only)
  • $07. Show pending Diagnostic Trouble Codes (detected during current or last driving cycle)
  • $08. Control operation of on-board component/system
  • $09. Request vehicle information
  • $0A. Permanent DTC’s (Cleared DTC’s)

(Taken from Wikipedia)

I will be mainly dealing with the first few modes.

So I will still require the use of a ECU at some stage and some way of simulating changes of values. I believe by hooking up a 12volt power supply and doing the neccessary groundings that I should be able to get something up and running. However, without any sensors I will get readings of 0volts, 0rpm etc so I may have to develop a variable sensor, probably a variable resister, that will change the resistance on the circuit to simulate changes in coolant temperature for example. Some day however I’ll get around to that.