Arduino nano, RTC, stepper motor and proximity sensors system

Hello everyone,

I'm working on a project of dry food dispenser for dog. it suppose to work 3 times a day. When i try to run the machine, i set it to work in gaps of 30 seconds and it works great. for example, i set it to work on 14:20:00, 14:20:30 and 14:21:00.

the problem begins when i set it to work in a bigger periods of time. when i set it to work on 7:30:00, 14:00:00 and 21:00:00. Sometimes it works for a whole day and the next day it serves only the first meal, sometimes when i set it after lunch, it server dinner on 21:00:00 and the meal of the following morning on 7:30:00 but then it doesn't work anymore.
the serving time has been saved in the EEPROM just to make sure it has not been erased for some reason. I don't think it's related to not sufficient voltage or current because it does work sometimes.

I would like to give some more details about the process. The process begins when RTC time and one of serving time are equal. Then a motor start rotates until a proximity sensor senses a piece of metal and then it stops. when it stops, a EEPROM variable is updating. I connect my computer and see that this variable has been updated but no food served....weird (no why the sensor sense this piece of metal, and the food is still inside the cup).

I Thought maybe the arduino resets randomly though it is not suppose to cause any problem.

Any idea of what can it be? what's wrong with that machine? I'm an inch close to through it away to the garbage :)) (not really).

I will appreciate any idea.

Thanks,
Nir