Arduino mega 2560 problem

If you mean that the microcontroller chip is getting hot, I can think of a few likely causes:

  1. You have one or more of the I/O pins shorted to ground or to Vcc. This could happen if you have wired it up incorrectly, or if it is standing on a metallic surface.

  2. You are trying to drive too heavy a load from one or more output pins.

  3. You are feeding more than 5 volts into the +5v pin, or a negative voltage into the +5v pin.