heating problem - L7805C
A 7805 will always produce waste heat because it is a linear regulator. This means that current out = current in and, given that it might regulate 7V down to 5V, the power dissipated is 2V * current out. If the current out is 0.5 amps then the power dissipated is 1 watt.

If the voltage in is 12V and the current out is 0.5 amps then power wasted as heat is 3.5 watts and this will fry a 7805 without a heat-sink.

Work it out with the formula: -

Power dissipated by 7805 = \$(V_{IN} - 5V)\times I_{OUT}
\$