Ok i am making a 3d printer and i connected my endstops wrongly and after that my arduino mega2560 voltage regulator AMS11117 5.0 LD518 and current protector gets very heated and arduino is working only for 20 seconds when i connect.
After connecting to pc it both ic's heats up and arduino automatically disconnect from pc after 20 seconds??
So whats the reason and cheap solution for this????
Possibly one or more pins on the large Atmel chip may be internally shorted, causing a heavy current draw.
Do things get hot when everything connected to the Mega board is removed and a very simple blinky type program is loaded?
Remove the AMS1117 and polyfuse. For a 3D printer, you cannot use the on-board regulator anyway - I suppose you have found that out.
Get a 5 V regulated power supply of some sort (with short-circuit protection), adequate to provide the necessary current, and connect it to the 5 V terminal of your Mega in addition to whatever other components require 5 V. The 5 V terminal is really an input, not an output. If that does not work, replace the Mega 2560 and remember not to use the on-board regulator on the new one.