Function to make arduino sample a sensor every 20 min

mahela007:
I only need to write the values to the EEPROM memory.

Well, in general EEPROM is not meant as a store for realtime data.
But it's your Arduino, you can do anything with it.
You can store some values there, and store which value you have written recently (!)
That's easier than a DataLogger/RTC shield, using an external memory card, just for storing 72 bytes/day.

However, you forgot a task: You may want to read the EEPROM at some time. So better go for the "Blink without delay" example, PaulS proposed.

Loading a different sketch just to read the EEPROM is too poor :wink:
( But it's your Arduino, you can do anything with it. )

BTW: Any solution, with or without delay, will start at reset/power up.
So you do not mind to not have the EEPROM events sychronized with anything ?