New Ground Pin

I have an Arduino Mega 2560. I grounded my step motor board to the ground pin next to the 52 pin. The stepper board is connected to a power supply that is rated at 30V 5A. All worked well.

Then, I disconnected that ground and started installing three optical sensors. I had to make multiple connections to get the three sensors grounded to the two ground pins beside the 52 and 53 pins. I finally got them working right with no problem.
When I added the stepper board ground to the group of other connections to ground it over heated. The connections were probably not perfect but I thought that I needed to find another GND pin to use.

Can I go with a thicker wire and use the GND pin the is between the AREF pin and pin 13 for this purpose? Another board is above it but this pin is not used. I will need to shield the bottom side of the board in that area so that I don't accidentally brush something against it. Is there anything else that I should think about?

What overheated?

There shouldn't be any significant current in the ground wire from the stepper controller - its the signal-return for the logic outputs
to the controller. Perhaps you need to show exactly how you've connected things up.

Do the optical sensors take much current?

This is a quote from another forum.

Now that you have a power supply capable of delivering what your motor wants to draw, enough current flows in the ground wire that the resistance in the wire (or a connector of that wire) causes heating. The first thing I'd look at would be looking for loose connections, tighten screws, etc. If it still heats up too much, the gauge of the wire is probably too high (too narrow) and you need to change the wire to something beefier.

Power equals current squared times resistance. If your wire has a resistance of 0.1 Ohms, and you send 5 A through it, that will end up burning (5 * 5 * 0.1) == 2.5 watts in the wire, which would be enough to make it heat up a fair bit, especially if the insulation is thick compared to the wire. If the heat loss capacity of the wire itself is something like 100 degrees C per Watt, you'd get a temperature rise of 250 degrees C from this particular illustration example. Chances are the resistance of your wire is a lot lower, but you're still seeing a significant amount of heating, because that's how the math works out.

This is how it is hooked up. The sensors don't draw much current.

The wiring is a mess but it works for the sensors. If I can move it to the other side to a dedicated pin, I can reduce the chance of cold solders or bad connections.

Check the connection from the COM side of the 30V power supply to the motor driver board. If that connection breaks or is poor, and the COM side is connected to mains ground in the power supply, then the motor current may end up flowing through mains ground, the mains ground of the PC, the USB cable, and the Arduino ground pin to get the the motor board.

That makes since. Perhaps the 2 pin connector that goes to VMOT and GND, on the stepper board, is not allowing a perfect current flow. I will try to clean it up and remove the tape on the 4 pin connector that contains 2B, 2A, 1A, 1B. It could be pushing the ground over for a compromised connection.
Now, also back to the first question. Can I use the GND on the Arduino between the AREF Pin and Pin 13 so that it will be dedicated and free of other influences?