Arduino Mega Voltage Regulator/Regulador de tensao do arduino mega

You should not be attempting to use the on-board Arduino regulator for any practical project as you are going to connect many additional loads - clearly not the steppers themselves, but other parts of the equipment - and the regulator has no heatsink to speak of.

You need a 12 V to 5 V switchmode regulator.