The USB power supply you're using may have a built-in auto-shutoff feature to conserve energy when it detects that the device it's charging is fully charged or not drawing any power. This could be causing the power supply to turn off when the motion detector draws only a small amount of power...