battery packs 500ma supply potential plus the 500ma of the USB ...
Big NoNo.
If your device is to be battery powered, the USB must not power the Mega.
Common ground is required, but you must keep USB +5V and battery +? Volt separate is USB powers the Mega.