Arduino only works when connected to USB

Because it's powered by USB.