gate-drain-source is the order of pins on any power MOSFET... Your diagram suggests you assume theorder is source-gate-drain, if so you are shorting your Arduino pins into the drain, which would accountfor the severe overheating of the ATmega2560.The microcontroller should only be rising a few degrees above ambient in normal use.The drain is the centre terminal because that's the substrate (underside of the chip), and powerMOSFETs are vertical current flow, so the drain has to be substrate.
Mosfet order being gate-drain-source. Could you suggest wiring/patching of circuit ?
Also, is it possible to power up arduino and all of the 12 motor/ speed control motor, from one power supply ? 9v, or maybe 3AA (4.5v via 5v pin) would be enough ?
first thing you need to do is disconnect everything from your Arduino and check you havenot blown the pins that were on that pot or the MOSFET, as you may very well have fried them.
Don't connect the pins wrongly? Don't connect the Arduino analog pin to a 9V potentiometer.Don't connect the arduino pin to the drain of the MOSFET, connect it to the gate...I suppose the key point is check everything carefully against the circuit diagram before applying power.You must have had a circuit to work from the first time?