Arduino shuts off and doesn't turn on after couple hours I use a mega 2560, pir sensor and a SG90 9g Servo motor in my project. Basically while the pir outputs high, the Servo Motor rotates from 0 to 180 degrees. 

Here is how everything is wired up:

PIR sensor:

Data: pin 24

Vcc: 5 volt 

Gnd: Ground 

Servo:

PWM pin: pin 11 

Vcc: 5 volt

Ground: ground 

The arduino mega has two 5 volt and ground pins, one next to the analog pins and other at tho bottom bar of pin, where pins 22 and up are. I connected the Servo to the first 5v and gnd and the pir to the second. 

My power source is my nexus 5 charger(5v 1.8 or 2 A). 

My code:

Servo myservo; 

    void setup() {
      myservo.attach(11);  
     pinMode(24, INPUT);
    }

    void loop() {
     if(digitalRead(24) == HIGH){
       myservo.write(0);
       delay(500);
       myservo.write(180);
       delay(500);
     }
    }


All of this works fine for the first ~10 hours. After that the arduino just shuts down. The power led of the arduino isn't lit up. Disconnecting the adapter and reconnecting it or pressing the reset button of the arduino doesn't work.  I Have to wait for a couple of minutes with the adapter disconnected and reconnect it. After that it works fine for the next ~10 hours. 

Seems like a hardware issue, but I'm not sure what exactly fails and why.
I assume your charger is connecting to the USB port of the Mega2560. 

That USB port has a polyfuse (actually a special type of positive-coefficient thermistor) which is normally rated at around 500mA (polyfuses are a bit woolly with their ratings since they are heat based).

If you are drawing near that limit of current the fuse will be gradually heating up. I would think that after 10 hours it may have reached its threshold temperature and thus switches the power off.

Disconnecting the power and allowing it to cool down would then make the board work again.

How can you test it?  Well, next time it switches itself off try bypassing the polyfuse (tweezers would be good to do that with) to see if the power LED turns on again.