Thanks everyone. As I said, I'm very new to electronics so what sounds like a stupid thing to experienced people doesn't sound so stupid to someone who only learned what a capacitor is two weeks ago...
I didn't actually plan to use my (bad) method in a project, I was just curious as to IF it would work, and then WHY it wouldn't.
Jiggy-Ninja:
In order for current to flow through a BJT's collector, the base-emitter junction must be forward biased. For an NPN, that means the base must be about 0.6V higher than the emitter voltage. Without going into details too much, that is impossible in the circuit you have described.
Brilliant, this answers my question, thank you
Jiggy-Ninja:
More importantly, this is a terrible, horrible, no good very bad day way to extend battery life. The ATmega328P microcontroller used on the Uno board has many options that you can use to shut off peripherals or sleep the CPU to save huge amounts of power without needing to disconnect the voltage source. In the deepest sleep mode (with all peripherals turned off) you can get down to 100 nA, though that's a hard sleep mode to use properly. A more realistic amount is single-digit uAs. Compared to the normal current draw of around 20 mA, that's over 2,000 times less power.
However, an Arduino Uno board has some extra chips on it (primarily the USB->Serial converter and 5V and 3.3V regulators) that will draw over 30 mA of current even if you unplug the main chip. You can't shut those off, they just sit there burning power forever and ever as long as the board's plugged in. Most reasonably-sized batteries will get sucked flat within a few days at most.
Solution: learn to make a "bare bones" Arduino circuit or buy a Pro Mini (and desolder the LEDs). When you learn how to use the power reduction features properly, you can get far more battery life than by just physically shutting off the power.
There's an article in the Useful Links sticky that was written by Nick Gammon, one of the moderators here. He investigated the power savings a lot of those different modes give.
Thanks, I've found the tutorial and will have a read.
james-eton:
In order that the NPN be switched, the base needs to be around 650mV more positive than the emitter. The AVR chip will be supplied with 5v when the switch bridges the transistor, which of course means the maximum driving voltage from an AVR output pin is just under 5v. But the NPN transistor requires 5.6v or more to maintain bias when the switch is released. You can probably now see why it won't work!
Numerous circuits probably exist on the web to do this - it will require one more transistor at least to act as a low-side switch. This can pull down to ground a pair of resistors connected between it's collector and the 5v line (the transistor emitter is connected to ground / 0volts of course), which act as biasing chain. The main NPN's base is connected to the junction of these two resistors. When the bridging switch is pressed the Arduino is fed with 5v. An output port pin is set HIGH, this drives the second transistor ON (with a suitable current limit resistor from output pin to the transistor's base). The driver transistor pulls current through the bias chain, which biases the power rail transistor ON for when the switch is released. The Arduino is now feed with around 4.4v when the switch is released and base-emitter voltage drop takes effect.
Jim
Edit: please read 9 volts for 5 volts, etc!
Cheers for explaining that, although I now know it's a terrible way to do it, at least I understand how it would work
Jiggy-Ninja:
When you park your car in a parking lot, do you take the wheels off to prevent it from moving? Or do you just shift the transmission to "P"?
There are often multiple ways to achieve the same objective; some of them are good, others are stupid. A bootstrap power switch like this is almost always the stupid way.
When someone asks a question like this, don't give them tips to help them take off and put on their tires faster. Tell them to use the parking brake. Teach them the right way.
Being British and driving a manual, the "right way" is to take it out of gear and put the hand brake, haha