I want to use a PMOS-Transistor as a high side switch like so:
simulate this circuit – Schematic created using CircuitLab
But when I tested this circuit on a breadboard, there was always a small voltage spike at the output, when the 12V where switched on. Since this will be used as a control signal to external devices it must not glitch when powered on.
Is there anything I can do to improve this circuit? Or are PMOS-Transistors entirely unsuitable for this purpose. I already thought about using NMOS instead, but then I would have to add a charge pump to get above 12V which would add an undesirable amount of cost and complexity.
Since I do not have to source a lot of current (/the voltage drop is not that relevant), would it help to use BJTs instead?
UPDATE:
I did some more measurements and the amplitude and duration of the spike is proportional to the load resistance. Removing M2 did not change the result.
This means that this is not a suitable solution for me because the load resistance can be very high. With R_Load > 10k
the output voltage does not even go down to 0V.
So the real question seems to be: what are the alternatives? BJTs?
UPDATE 2:
The question is not why this happens (I know it happens because it takes a few microseconds to charge the gate), but how to prevent it. Another PMOS transistor will not help, because it could make the problem less severe, but it will still be there. Especially with light loads.
So again my question: Can I somehow make this better? What happens if I replace M1 with a PNP-Transistor and a base resistor (I don't have one to test at the moment)?