nhs wrote:Tage --
2 more questions:
1. Why is R1 necessary?
2. Could a transistor do the same job as the mosfet is doing in the circuit?
Sorry for bugging you with so many questions. I hope you don't mind too much.
R1 is used to keep the gate-source voltage at zero when the npn transistor is not ON. without it, the gate would float and the MOSFET could be on or off or something in between. (there is also some leakage current in the npn transistor when it is off. that leakage current is flowing through the R1 resistor but only causing a very small voltage.)
you can replace the p-channel MOSFET with a pnp transistor, but you need to add a resistor in series with the collector of the npn transistor to control the base current of the pnp. a MOSFET is controlled by a voltage from gate to source, a pnp is controlled by a base current that flows out of the base. the npn and the newly added resistor defines this base current. the voltage from emitter to base of the pnp will be about 0.6V to 1V depending on the transistor type.
you could try another 10k resistor from the base of the pnp to the collector of the npn.. I could keep R1 connected as shown from emitter to base of the pnp, to handle the leakage current in the npn. (the pnp will amplify this leakage current so there may otherwise be a small current flowing out of the collector of the pnp when Q1 is off.)