Ufoguy:
Is it possible to use a transistor whose base is connected to arduino digital pin to control arduino's power supply. Let me explain this.A power switch is connected in parallel to the transistor circuit. Load applied to the transistor is the arduino's power supply. The power switch is pressed for long enough for the arduino to complete booting and the digital pin which is connected to transitor is set to high as soon as possible so that even after the power switch is open the arduino is on as long as it wants. When the arduino wants to shut down it just sets the digital pin connected to tansistor to low. I want to use this mechanism as an alternative to sleep mode.
Yes, quite possible. Pololu makes a popular mosfet based switch that can be made to work.
I build that functionality using a $1 e-bay 5vdc latching relay. One manually powers the board on and the first code in the setup function turns a output pin high to latch the power relay on. Then anytime the program wants to shut off power it just brings the output pin low.
http://img25.imageshack.us/img25/563/08miq7.jpg
Lefty