Power supply self control using transistor

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.

Shortly YES. You need to limit the base current to a sensible amount or use a mosfet. But there are better or other ways to do this. Check RS Flip flop

I searched Google for RS Flip Flop and found something about logic gates etc. I don't see how it can be used as a transistor circuit alternative. I'm a slow learner. Can you please tell me how RS Flip Flop can be used as a transistor alternative.

And will a BC547 be enough to handle the current that arduino consumes or would I need a metal packaged transistor or a Mosfet?

Thanks in advance.

Well, RS flip flop is a lock circuit. There are two inputs, off and on=R and S. (and out puts Q and \Q)

BC547 might do well if you have a plain Arduino, not many LEDS and so on. But BC547 is a bit small, BC637 and so on are stronger.

What does a lock circuit do. Does it turn the output high upon pressing it once and low upon pressing it again?

Edit: S makes Q output to go high and stay there forever or until you make R active. R makes Q go low and stay there forever or until you make S active.

Now you should use Google again.

So you are saying that I can use S instead of the push button in my circuit and R instead of the transistor base. Is that it? If this is the case it indeed will be useful. I will have to turn the arduino pin connected to R high to turn off the arduino. By the way how do I make this RS latch or whatever. :smiley:

Almost

For instance you start you computer by setting S to active (that may be 0 or 5V depending your circuit) and your computer turn it off by setting R active. By the way, I said wrong it is better to use PNP transistor like BC558 or BC640 and so on. When you use PNP correctly, you connect /Q to base.

But I am not going to design this for you, see Google.

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

If the original poster has problems with electronics, it is best to use module or or whatever previous poster suggested.