help in making engine digital RPM meter

I suggest using the mcu's own EEPROM using one of the following schemes:

  1. You are already monitoring the battery voltage, presumably after the ignition key. Therefore, if you power the Arduino via a diode and a large capacitor, you can detect when the ignition has been switched off some while before the Arduino loses power. You could detect the impending loss of power and write to EEPROM then, so that you only do 1 write to EEPROM each time the ignition is turned off (and only if the number of km has changed since last time).

  2. You could write to the EEPROM every km but use a wear-levelling scheme so that you don't write to the same cell every time. This would allow you to do well over 10 million km before you approach the 100,000 cycle write/erase lifetime of the built-in eeprom.