5V voltage regulator over heating when powered with 5V

Hi All,
I am experiencing high heat output from a voltage regulator when I am powering the voltage regulator with the same input voltage as its output. Now I see that many people have posted questions similar to this on the form and I have read them and I think that my issue is different and I want to ask it.
I understand that the voltage regulator will dissipate heat based on the amount of voltage drop it has to do. My circuit is basically a custom arduino nano with an atmega328. The circuit uses only about 0.030 amps at 5V. I am using a 5V wall adapter and based on my multimeter the supply voltage is 5.02 volts. The output voltage of the voltage regulator was about 4.95 volts. The voltage regulator should only be dissipating about 2mW! I did not measure the temperature of the regulator but I estimate it was upwards of 60 degC which I feel is higher than expected for this amount of power.

My voltage regulator is the AMS1117-5.0S (It is about 4 mm long and 2 mm wide). I have it integrated into the board as per the image attached. I unfortunately chose a regulator with a Chinese data sheet so I cant read all of it but based on the information I see it is rated correctly for this application.

image

For testing I have been powering the board with 5V directly to a Vss pin headder (bypassing the voltage regulator) and I am not seeing any temperature change based on the integrated thermistor. The moment I plug in the wall adapted which goes through the voltage regulator first the temperature starts climbing. One main issue is that I want to use the temperature sensor as an environmental temperature sensor and I cannot have it swayed by the board overheating.

I want to give the final product to other people and the main goal of the voltage regulator is to protect the board if someone uses a higher voltage wall adapter and I would like to keep a voltage regulator on the board.

Can someone please advise me if this is expected based on this voltage regulator and if I should either remove the regulator and put a note to only power with the supplied 5V wall adapted or look into other ways to protect the board from over voltage.

Thanks!

Connect 5V to 5V on the power header, or to the USB connecter (use a cell phone charger for example).
Do not connect 5V to the barrel jack adapter.

Ok so you recommend skipping over the voltage regulator entirely. I think I will do this for now. I have a cellphone charger I can power it from but is there a reason why you recommend to not connect the 5v directly to the barrel jack adapter which is a 5v supply?

Thanks,

Yes, you have it wrong, first the barrel jack has a series diode, then you will will be applying 4.3V to the input of a 5V regulator. That regulator needs at lease 6.5V in order to work correctly.

Your regulator circuit you posted is wrong anyway. You don’t have to be able to read Chinese to see the application circuit and you will see that that needs a 10uF capacitor on both the input and output lines to ground. You used only one capacitor with a value of 100nF or 0.1uF which is 100 times smaller than the recommended value. This will have resulted in your regulator oscillating, that is not working correctly.