Hi,
After checking the specifications once again, I relalized that the pinouts of AMS1117 and UA78M05 do not fit to each other. An advise for those, who face the same problem:
UA78M05 similar parts:
LM340 SOT-223 (Texas Instruments)
TS2940CW50 SOT-223 (Taiwan Semiconductor)
GS7805L SOT-223 (Globaltech)
There are some other parts, which have the same pinout but have less max output current than the original regulator (e.g. LT1121)
Do not try the following ones (as I did):
LT1117 SOT-223 (Linear Technology)
AMS1117 SOT-223 (Haolin)
REG1117 SOT-223 (Texas Instruments)
LM1117 SOT-223 (National Semiconductor)
Regards.