How many amps of current are you drawing?
Data sheet says:
The AMS1117 series of adjustable and fixed regulators are easy to
use and are protected against short circuit and thermal overloads.
Thermal protection circuitry will shut-down the regulator should
the junction temperature exceed 165°C at the sense point.
The power dissipation of the AMS1117 is equal to:
PD = ( VIN - VOUT )( IOUT )
Maximum junction temperature will be equal to:
TJ = TA(MAX) + PD(Thermal Resistance (junction-to-ambient))
Maximum junction temperature must not exceed 125°C.
Control Section -40°C to 125°C SO-8 package j JA= 160°C/W
Power Transistor -40°C to 125°C TO-252 package j JA= 80°C/W
Storage temperature - 65°C to +150°C SOT-223 package j JA= 90°C/W*
* With package soldering to copper area over backside
ground plane or internal power plane j JA can vary from
46°C/W to >90°C/W depending on mounting technique and
the size of the copper area.
The AMS1117 series have internal power and thermal limiting
circuitry designed to protect the device under overload conditions.
However maximum junction temperature ratings of 125°C should
not be exceeded under continuous normal load conditions.
Careful consideration must be given to all sources of thermal
resistance from junction to ambient. For the surface mount
package SOT-223 additional heat sources mounted near the device
must be considered. The heat dissipation capability of the PC
board and its copper traces is used as a heat sink for the device.
The thermal resistance from the junction to the tab for the
AMS1117 is 15°C/W. Thermal resistance from tab to ambient can
be as low as 30°C/W.