Thread: Super MPGuino?
View Single Post
Old 02-06-2011, 12:32 PM   #97 (permalink)
bobski
EcoModding Apprentice
 
Join Date: Jan 2010
Location: Newark, DE
Posts: 143

'91 CRX - '91 Honda CRX DX
90 day: 34.91 mpg (US)
Thanks: 0
Thanked 14 Times in 14 Posts
You already have an input you can use for RPM: The injector signal. Its only shortcoming being that it will read zero during deceleration fuel cut.
You just need to measure the time between the start of each injector pulse. If the MPGuino code used the up-to-date Arduino IDE and libraries, I would tell you to put something in the injector interrupt routine along the lines of:
Code:
routineCallTime = micros();
injectorPeriod = routineCallTime - lastInjectorOpen;
lastInjectorOpen = routineCallTime;
And in the main program:
Code:
if((injectorPeriod == 0) | (injectorPeriod > 1000000)){RPM = 0;}
else{RPM = 30000000 / injectorPeriod;}
Then do whatever you like with RPM.

But MPGuino is sort of off on its own development fork, so the above probably won't work.
If you want an RPM input that will work under all conditions, you could feed a conditioned tachometer signal to an interrupt input. Oh wait. Both interrupt inputs are being used for the single injector signal, thanks to the limitations of the older Arduino IDE. Huh. :/
  Reply With Quote