Voltage regulator question
You don't mention what case style of 7805 you have. If i was guessing you are using a TO220. That case can only support up to 1A output current and even then requires substantial heat sinking to do so. Some 7805s had thermal protection and would shut down if overheating. Check the voltage to the device when it shuts down. Perhaps the voltage drops out. 

Also you cryptically say that it's a 5v device. If i also had to guess it's a USB device. Some USB devices require that an identified is detected on the data lines to announce that the device is connected to a charger. For example my HTC phone charger shorts the data lines together. Also my Galaxy tab doesn't like my HTC charger because Samsung uses a different scheme to identify the charger.