Electronic – Choosing transistor for a raspberry pi switch

debounceraspberry piswitchestransistors

I'm trying to design a circuit that will control the power to a raspberry pi with a button. The basic usage is:

  1. first button press-> rasp powers up.
  2. second button press-> rasp continues with power but detects that should shutdown.
  3. (After the shutdown sequence is done, raspberry shuts off).

The design envisioned is a circuit with a normally off button that is connected to a binary counter (74LS161AN).
The idea is to count the button presses and use the XOR of the counter's 2 least significant bits as a control for the power to the rasp. The XOR I intend to use is 74LS86.
The msb of the counter's 2 bits is how the rasp detects it should shutdown.
The rasp cuts its power by ouputing a High to a gpio that is connected to the counter reset.

This button/counter contraption is sort of working on a breadboard but now needs a transistor that actually takes the output of the XOR and controls the voltage in the rasp. power.
Do you think that BD135 is a good choice for this? (datasheet) I chose it because
Raspberry is powered by a 1.2A power supply, therefore the transistor needs to handle more current (bd135 has max collector current of 1.5A). It also needs to be NPN.

I have a few doubts if this is going to work, for example, how do I know if the XOR can supply enough current for the transistor base? Actually what does it mean when the high level output current of the XOR is -0.4mA ?

If this transistor would not work, could you point one that does and explain the reasoning to select it? I am a bit lost..

Thank you very much.

PS: between the button and the counter there is a 555timer in monostable to clear the bounces.

Best Answer

Something along the lines of this circuit would work:

PMOS Switch

Simulation:

PMOS Switch Simulation

Any decent logic level P-ch MOSFET with suitable current capability will work. An example is the NDP6020P. The NPN can be almost any small, general purpose NPN (e.g. 2N2222, 2N3904, BC337, etc)