Arduino circuit power supply

Recently I had made a IR relay circuit using standalone Arduino. It contains two different circuits i.e. 1.Standalone Arduino (using atmega328p) which needs 5V and 2. Relay board circuit (using pc817 optoisolators) which needs 12V. As a power supply ,for this as a whole circuit, I am using a Chinese led driver 12V 1.5 A supply (shown in attached image below). I had used L7805 voltage regulator to provide 5v to standalone Arduino circuit from the same power supply. Now my doubt is that if this setup is good for long time use? Although the same circuit is working since last two months in my room continuously without any problems. The voltage regulator becomes too hot and this seems not good to me. Is this not the ideal way to do this?

Sorry I can’t explain the 12V supply but I have attached a picture below for this. This 12V supply costs me for 40INR i.e. equal to 0.60 USD and a good power supply with same ratings costs around 2.25 USD. What’s difference in these? (I know I haven’t provided any detail about my power supply except an image) and also using a L7805 is much cheaper than using any DC-DC step down module, I want to keep circuit as cheap as possible. Please give me some suggestions.

An 7805 linear regulator burns excess voltage, and becomes very hot. When powered by 12V it has to consume 7V at the same current of the 5V devices on its output, i.e. 140% of the output power.

Switching (step-down) regulators instead perform much better, with a loss of less than 10%. This means no additional heat sink and cooling fan, as may be required with a linear regulator.

I have used this voltage Regulator which is drop in compatible with the 7805 but is much more efficient and therefore generates much less heat.

Because it is drop in compatible, all you have to do is unplug the 7805 and stick this one in. No other changes to Hardware or wiring are required.

DrDiettrich:
An 7805 linear regulator burns excess voltage, and becomes very hot. When powered by 12V it has to consume 7V at the same current of the 5V devices on its output, i.e. 140% of the output power.

Switching (step-down) regulators instead perform much better, with a loss of less than 10%. This means no additional heat sink and cooling fan, as may be required with a linear regulator.

I'm a fan of boost and buck converters but I've seen that the output can be slightly ripply. That may be good reason to put a bypass cap across the output?

That is a cute little part. Added to my stack of "future project parts". You can also (cheaper) add a heatsink to the 7805 - still wastes the same power, but will run cooler

And what about the 12 v power supply in image that I have attached? Is it looking good for long time use?

Hard to say about the supply, but in general, you get what you pay for. My preference is to run a supply at around 50% of the rated load. In the picture, (maybe it is just the camera angle), the electrolytic on the left side of the picture almost looks like it is starting to bulge on top. If it is, it is going to fail soon.