user27350: Is it safe to connect a 9 volt battery to an Arduino Mega 2560 directly to power it?

user29218: Yes. On this page, you can see that you can safely connect 7-12V to the VIN pin.
Furthermore, you can simultaneously connect the USB; your Arduino will automatically draw power from the appropriate source.
Note that the power supply jack pin is connected to the Vin pin through a diode. Do not connect a battery and an external power supply, since a sufficiently high power supply voltage will try to charge your battery, which may be bad news for the battery.

27350: <p>Is it safe to connect a 9 volt battery to an Arduino Mega 2560 directly to power it?</p>
 29218: <p>Yes. On <a href="https://www.arduino.cc/en/Main/ArduinoBoardMega2560" rel="nofollow noreferrer">this</a> page, you can see that you can safely connect 7-12V to the VIN pin.</p>

<p>Furthermore, you can simultaneously connect the USB; your Arduino will automatically draw power from the appropriate source.</p>

<p>Note that the power supply jack pin is connected to the Vin pin through a diode. Do <strong>not</strong> connect a battery <em>and</em> an external power supply, since a sufficiently high power supply voltage will try to charge your battery, which may be bad news for the battery.</p>
