Why do this project I hear people asking? Well I was recently burgled and the thief stole both my Subaru Impreza car keys making the car a dead duck since it has an immobiliser. To get it going again it would cost over £200 but the car is only worth £500 and I always wanted to design a car ECU to see if I could do it and do it better. My opinion is that the systems in your average saloon cars are fundamentally wrong and look like they have been designed by people from MENSA with no practical experience or regard for the real world. For instance my Ford KA has been giving me 42 mpg and passed the MOT emissions for the last two years and yet I know the car used to give me 55 mpg. The ECU is making the mistake of chucking more fuel in to get what it thinks are the right Oxygen sensor readings but the result is higher emissions although they are still below the MOT requirements. Basically the ECU systems are too complicated and only work correctly when everything is perfect unfortunately in the real world nothing is perfect for very long.
The majority of systems try and measure as much as possible with all sorts of complicated sensors like Mass flow meters and Lambda sensors and yet when you look at the pinnacle of engines in Formula 1 it is completely different. The most straight forward way for an ECU to work is to emulate how a carburettor system works where the engine speed sets the amount of fuel. In order to keep a fixed fuel to air ratio the injectors need to supply the right amount for the speed of the engine so you only have to read the engine speed and calculate the injector on time for the right fuel flow. The throttle position isn't required for this simple version because as the throttle is opened the engine will speed up requiring fuel adjustment and fixed values can be added for acceleration or subtracted for deceleration. My aim is to keep the design as digital as possible because the inputs on the RPi are digital. The only analogue sensor that might be required is the throttle but it might be possible to get away with fully open and closed detectors. Lambda and Mass flow sensors are not required in my design and air temperature can be dealt with using one or two level sensors. All the other sensors for speed and ignition are digital anyway so don't present a problem.
The biggest problem on the hardware side is the fact that the Rpi is very weak when it comes to noise immunity so I think it is best to stick it in cotton wool by giving it a perfectly regulated supply well decoupled and make all connection to the outside world via opto isolators this way the only direct connection to the car system is the power rails. All the output drive MOSFETs and all the signal conditioning circuitry will be on the opposite side of the opto isolators from the RPi. Another headache with the hardware is connecting it to the car. The ideal solution would be to get hold of the ECU connector that is on the original so I will either take that one off or buy an old one off Ebay and cannibalise that. The thing to do now is identify all the I/O from the car schematics and sort out the circuit interfaces including any that might be needed for improved operation with more sophisticated software. Well these are my initial thoughts but I don't know how long this project will take I will just have to suck it and see.