For an Arduino project I needed both 5V and 12V voltages. Specifically, for an IC I needed 5V and I needed to be able to switch it on and off using an Arduino PIN. Since the current drawn by the IC might exceed what can be drawn from the Atmega328 pins, and since I couldn't tolerate any less than 5V, I tried using the following circuit.
So the idea was to control the 12V source using the BC547 transistor with the base controlled by an Arduino pin, and then to feed the emitter of the transistor into a standard 7805 regulator setup (with cap sizes taken from the 7805 datasheet).
However, the circuit doesn't work as expected. I'm only seeing 4.32V on the emitter of the transistor - not 12V as I had expected. I can see that the input to the base is drive to 5V, and given the 4K resistor there should be amble current for the base (at least for 100-200 of collector-emitter current). Yet it seems the only voltage I'm seeing at the emitter is the mentioned 4.32V which seems to be just the base voltage minus some voltage drop. Changing the 4K resistor to e.g. 800 ohm didn't change this.
So what is the problem here? It is not possible to control 12V using 5V at the base? If so, from what values in the datasheet can this fact be derived?
I tried replacing the BC547 with a 2N7000 MOSFET, and that actually worked and I'm seeing 11.3V at the emitter of the transistor, and 5V at the output PIN, as expected. But I don't see why the BC547 couldn't do the job.