Electronic – Easiest way to connect two pins when an output is off

invertertransistors

I'm planning to build a switch that turns off the power supply to my Raspberry Pi when an integrated circuit (ATtiny 85) output pin is low. The power supply (Adafruit PowerBoost 1000C) goes off when the EN pin is connected directly to the ground. I've been trying to use an NPN transistor inverter circuit to do this, but I haven't had much luck. I can use the transistor (without inverter) to turn the power off when its base goes high (connecting the EN to collector and ground to emitter), and I can use the transistor inverter to turn on/off an LED when base goes low/high, but the inverter circuit actually turns power on when base is low, power off with base high (like the transistor circuit WITHOUT an inverter). It may be that there's an internal pull-up resistor in the PowerBoost that's somehow interfering.

I'd like to be able to connect the ground to EN when my IC output is low so I can save batteries and put the ATtiny in sleep mode. The Pi will be off far more than it will be on.

How can I get this to work? I tried a PNP transistor but seemed to have the same problem. I'd prefer not to use a relay because I don't have a low enough voltage one. I've got lots of semiconductors, though.

Best Answer

If i understand the question, you could do it like this.

schematic

simulate this circuit – Schematic created using CircuitLab

Although this seems somewhat redundant to me, as this is essentially how the ATiny works internally. A more elegant solution would seem to be connecting them together directly, like in the following diagram. The use of a discrete transistor is sometimes required, but only if it needs to sink more than the capacity of the controller, and it looks like it's only overpowering a pull-up resistor, piece of cake.

schematic

simulate this circuit

Note that this will only work if the 2 circuits are at the same ground potential, which can usually be achieved by connecting the grounds directly together.

You should also take into consideration that the 2 circuits may be running on different logic voltages, so to avoid problems there you should be setting the pin on the ATiny to a hi-z state (in arduino, "input" mode) to avoid mucking with the other circuit.

Related Topic