3 different ways to power the Mega2560 besides connecting to a PC:
7.5V to 12V 'wallwart' supplying DC to the barrel jack.
5V wallwart connected to the USB port.
5V wallwart connected to the 5V/Gnd pins on the Power header.
Battery powered devices need a system where the device checks over Internet connection (WiFi, mobile) if a new firmware bin file is available on a specific location on a server. If the bin file is available the device can download it and apply.
One option how to apply the new bin is to use SD card and SD bootloader (Zevero avr_boot) The sketch saves the ...
There is a solution with SD card and SD bootloader. You put a bin file on SD card, insert it into the SD adapter and power up the Arduino. The bootloader loads the bin file to flash memory.
I use 'avr_boot' SD bootloader by Zevero. It reads a file named firmware.bin from SD card if present and loads it into flash.
To generate a bin file for Arduino AVR ...
First you have to establish communication between Arduino and your computer. This communication could be wire (ex. LAN) or wireless.
Like Juraj said, you could use ArduinoOTA with an additional WiFi or Ethernet module on your Arduino, as long as arduino is connected to the network and you know its address. I haven't tried it yet, so I don't know its ...
There is no specific piece of hardware that does what you ask.
There are various options though:
Write a new bootloader that uses the USB Host Shield to load data from a USB MSD device then flash it to the internal flash of the MCU (hard to do if you don't know low-level programming)
Use an embedded Linux computer (Raspberry Pi, etc) to run avrdude and ...
Your case :
Check wire (shors ?) and pin configuration (out ??)
No resistor in a ground path.
Decoupling supply :
one can insert a 100 Ohms resistor between the arduino +5V and the +5V sensor : but ALWAYS use a decoupling capacitor : connect a 100µF betwen +5V sensor and groud. One can add a 100nF ceramic in paraller for digital devices.