Agreed. Thats the sensible way. But it depends of how much current, and also the power supply (if it is a battery/solar cell or iv it's just a power outlet with a DC supply)
Now we waiting this thread will be put as solved by pepakpan.
I would like to thank all for their replies. I tested with 7805 and its working.
Added after 4 minutes:
My one more question is...
I would like to design a pcb with atmega8 controller. So to program this controller I need to have some interface between controller and computer. One more thing is i will program this pcb only once. So there any way of programming it without having USB or RS232 connectors on pcb.
I would like to thank all for their replies. I tested with 7805 and its working.
Added after 4 minutes:
My one more question is...
I would like to design a pcb with atmega8 controller. So to program this controller I need to have some interface between controller and computer. One more thing is i will program this pcb only once. So there any way of programming it without having USB or RS232 connectors on pcb.
If it is a DIP package, you may use AVR programmer from www.ikalogic.com/isp.php/
you may implement it on a bread board and after programming, you may transfer your ATMEGA8 to the user board.
if u use the 7805 regulator to convert 24 to 5 volt then u will lose lot of energy as heat and power dissipation of 7805 will increase as well , decreasing the power dissipation of lm7805
better use Dc-Dc converter , if u are to keep the efficiency high
afterall, you can use 6V and derive 5V for the few mA load using a Low Drop Out( LDO) regulator like LM2931-5 or LM1117-5
upto say 50mA even an input of 5.6V is sufficient got get 5V