Yes, I use the EEPROM to store the following data : trip distance, trip time, trip max speed, initial fuel level, current fuel tank distance.
The problem with the EEPROM is that memory positions "wear" with usage, so it's not possible to record data at each program loop (100ms).
To record this data you don't have many choices if you want the most recent data and not data recorded every minute : data should be stored only when the power goes off. This way you have precise data without EEPROM issue.
So a "power down" detection is required to detect the switched +12V, but the µC must be fed by +12V battery via a delayed relay.
I had a look at the several µC "sleep mode" some time ago but this is not very useful for this kind of project : just detect power-down, store data then shut down. Keeps things simple but it requires some external electronics.
Power-down is plain easy to detect as there is already code to get the battery voltage. i just added a trigger when battery voltage goes below 1V. Battery voltage means here the switched +12V.
Acceleration is rather easy to calculate : subtract previous loop speed from current loop speed then divide by loop time (actually multiply by 10 due to loop time). You get acceleration in m/s2 as speed is in m/s. Then for engine breaking detection it's a matter of some riding tests. Then adding an "emergency braking" detection is very easy. One could also imagine to get the higher negative acceleration to do some brake pads testing...
For the speed calculation, this is a digital sensor so averaging by storing some values inside an array is not very useful, this method is best for some noisy analog sensors, but even for this I prefer to use external filtering to avoid heavy coding and timing issues - this is a basic Arduino after all, clock speed is low and program ram is scarce.
Speed is derived from the speed sensor (this is actually a distance sensor) by measuring the time every six sensor pulses. This gives enough precision and timing stay fast.
Injection timing is done by measuring pulse time with rising/falling interruption. Injection signal frequency is low enough to use this method and precision is in the µs range. Being calculated by INT, injection timing (and rpm) is permanently available except during engine braking, which is detected by time-out.
You're very right about the expected fuel range. I actually have some doubts about this and about the fuel economy. On my car I already removed the fuel economy display, it makes me mad about always looking at it and felling guilty when accelerating hard ! So if it's already annoying in a car, I don't know if it's useful on a bike.
So at the moment, let's consider the fuel screen feature on my project as "experimental"...
The fuel sensor is more a resistor ladder than a real variable resistor so I doubt it'll give useful data.
THe fuel tank display on the dash is heavily integrated (like on every vehicle) by some capacitors. Time constant is there to avoid measuring fuel motion inside the tank when accelerating/braking but as the fuel level is not expected to go low very fast, it works ok.
'naf said for today !