Thanks for you answer. I don't really know how to find the problem. Do you think could be a problem related to the power supply? Since I cannot leave the arduino connected for many days to a Computer, I tried to power the Arduino with electric socket by means this:

