Click here to Skip to main content
15,884,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day,
I am currently involved in the project and I’m trying to understand why connecting,an arduino digital pin 4 to pin2 of a 2N4401 transistor vs 5V PSU to pin1 of a [^]2N4401 transistor; and pin 1 and Arduino VCC to 2N4401 pin 3, won't keep power.
When shorting pin 1 and pin 3 on the 2N4401 the MCU is powered on and in-software pin 4 is set to pinMode OUTPUT and HIGHwhich should allow the 2N4401 to let power flow to the MCU for as long as power is available even when the short circuit between 2N4401 pin 1 and 3 is cut.
I am trying to understand why connecting, say, an Arduino digital pin 4 to a 2N4401 pin 2 as well as 5V PSU to 2N4401 pin 1 and Arduino VCC to 2N4401 pin 3, won't keep power.
Just look at the folllowing picture,sorry I don't know how to add my picture here.

Could anyone explain why this is happening?
I'm sure I lack a lot of knowledge here and I want to know how I could utilize a 2N4401 to make a SW shutdown system. The code is as following:
<pre lang="c++"><void setup(){
pinMode(4, OUTPUT);
}
void loop(){
digitalWrite(4, HIGH);
delay(3000);
digitalWrite(4, LOW);
}
Why 2N4401? Why not a MOSFET? MOSFET's circuits that do SW shutdown are available, but no transistor base SW shutdown circuits are to be found anywhere, and the 2N4401 is all that I have right now.
When shorting pin 1 and pin 3 on the 2N4401 the MCU is powered on and in-software pin 4 is set to pin Mode OUTPUT and HIGH which should allow the 2N4401 to let power flow to the MCU for as long as power is available even when the short circuit between 2N4401 pin 1 and 3 is cut.Instead what happens when the short between pin 1 and 3 is cut, the MCU is turned off instantly.It's as if the transistor isn't reacting to the pin 4 MCU signal at all.

What I have tried:

void setup(){
pinMode(4, OUTPUT);
}
void loop(){
  digitalWrite(4, HIGH);
  delay(3000);
  digitalWrite(4, LOW);
Posted
Updated 21-Jun-18 20:21pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900