Using transistor to switch power on with a push button

I am trying to turn on a Picaxe board and remain on until the program finishes executing. The problem is that with a single cell LIPO (4.2V fully charged), the output voltage of the transistor switch is 2.4V. I may be using the wrong transistors or trying to do the impossible.
 

Attachments

AllyCat

Senior Member
Hi,

You do not have any current-limiting resistors between the PICaxe Legs 7 and 8 and the NPN transistor bases. Therefore, up to 20 mA might flow into each base and 40 mA through the PICaxe is probably enough to pull the PNP out of saturation (i.e. Vce = 1.6 v). The 4k7 will give only about 0.5mA of base current, but it would be better to reduce the base currents into the NPN transistors. Unless your "LEDs" require a great amount of current in the Q1 and Q2 collectors (in which case it might be better to use FETs there) ?

Cheers, Alan.
 

Buzby

Senior Member
244881612830574520.png This is the circuit I use most. It was originally for a Stamp, but it works ok with a PICAXE.
 
Hi,

You do not have any current-limiting resistors between the PICaxe Legs 7 and 8 and the NPN transistor bases. Therefore, up to 20 mA might flow into each base and 40 mA through the PICaxe is probably enough to pull the PNP out of saturation (i.e. Vce = 1.6 v). The 4k7 will give only about 0.5mA of base current, but it would be better to reduce the base currents into the NPN transistors. Unless your "LEDs" require a great amount of current in the Q1 and Q2 collectors (in which case it might be better to use FETs there) ?

Cheers, Alan.
Thank you Alan I will add a current limiting resistor to those two transistors.
 

Goeytex

Senior Member
Andres,

I took the liberty to modify and correct your circuit. It is attached

The "hold" section was not properly biasing the Q4. Note that I added a 1K current limiting resistor to the HOLD line and then moved the connection point to the base of Q4 . R4 is not really necessary but I kept it and increased the value to 47K.

The hold circuit was then simulated in LTSpice and worked OK. Yours did not.
I also corrected the LED circuits by removing the unnecessary pull down resistors and added 1K current limit resistors.

The 80 ohm value of R4 is probably too low. I Increased to 330 1K ohms to reduce the current to a more reasonable limit.

The attached circuit should work as a baseline. Consider reducing the value of R9 to 3K3 or 2K2 if you find that Q3 is not supplying the correct
voltage when the entire circuit is powered and under maximum load.
 

Attachments

Last edited:

AllyCat

Senior Member
Hi,

The OP's schematic shows: "Vin is 3.5v to 4.2v" and I'd still like to know the required currents in "LEDS1" and "LEDS2", but...

The maximum (worst case) "Gate-Source Thresholds" of the 2N7000 and BS250 FETs are specified as 3.0 and -3.5 volts respectively. That's the voltages at which the FETs are guaranteed to deliver at least 1mA into their Drains. In practice, those FETs probably will work, but I'd prefer to recommend a design that complies with the manufacturers' specifications. ;)

Cheers, Alan.
 

Goeytex

Senior Member
Sometime we are compelled to use what we have on hand. The BJT's will work fine as long as Q3 can supply the total current required for V+. Since LEDS1 and LEDS2 use transistors, I am guessing that these are for LEDs that may require more current than the Picaxe Pins can supply.

I am with Alan on this. We need to know the current required for the LEDS1 and LEDS2 before recommending specific parts for Q3, Q2 and Q1 .

On the high side: A BS250 is rated at 180ma @25C. A @2N3906 is rated at 200ma. A 2N2907 is rated at 600 ma.
On the low side : A 2N7002 is rated at 100 ma, A 2N2222 is rated at 800ma A 2N3904 is rated at 200ma.

These are maximum ratings and do not address potential heat dissipation requirements when used at higher continuous currents.
 

AllyCat

Senior Member
Hi,

Perhaps easier said than done. "Logic Level" is often taken to be (a "TTL" Level of) 5 volts, but the OP is using down to 3.5 volts. However, MOSFETs weren't even available when I was designing logic systems, so I decided to "research" the issue and found THIS LINK which includes the comment:

"Another thing to beware of in datasheets is Vthresh (threshhold voltage). This is not the gate voltage to turn the device on, its the gate voltage at which it switches fully off (less than a few uA of current, typically). If Vthresh is given as 2..4V range, it cannot be a logic level MOSFET (Vthresh is usually 0.5 to 1V for logic-level MOSFETs).

Another link suggested that the "only" Through-Hole Logic-Level PMOS FET is the Fairchild NDP6020P . That does indeed look like a "useful" device (which is why I'm posting its part number), but complete "overkill" for this application ! : The PICaxe here is very unlikely to draw more than 50 mA, so the OP's original proposal of the 2N3906 should be "good enough" (but something like the BC327 has about 4 times lower Vcesat). They just need to use the "rule of thumb" that (to "saturate" a transistor) the base current should be 1/10 times the collector current, e.g. 5 mA. Q4 can easily deliver that, so it just needs a resistor of about (3.5 - 0.7) / 0.005 = 560 ohms. ;)

But as for Q1 and Q2, I still would like to know how much current they need to be rated for. They possibly DO need to be Logic Level FETs (however, it does depend if the "LEDs" have series resistors, or if those transistors are being used as current sources). :)

Cheers, Alan.
 
Last edited:

premelec

Senior Member
That is useful information - however don't shy away from SMD devices e.g. AO3401 for less than 10 cents in 20 lots that are P-channel and .05 ohms, 4 amperes logic level. Only 3 pins that you can solder wires to. I also have seen a number of 8 pin SMD MOS transistors where all pins on one side are Drain and 3 pins on other side are source so not too hard to solder to... I have salvaged some from battery balancing boards [computer surplus] and various data drives... there are 4 pin styles like IRFD123 [N] and IRFD9113 [P] DIP4 for through hole use... [not logic level and lower current]..... so many parts!
 

GY44

New Member
I found this circuit in my archives - it might be of interest to this thread. A centre off toggle switch has a continuous and button position which gives approx 15 seconds of power before turn off.
 

Attachments

Goeytex

Senior Member
...The PICaxe here is very unlikely to draw more than 50 mA, so the OP's original proposal of the 2N3906 should be "good enough" ...

But as for Q1 and Q2, I still would like to know how much current they need to be rated for...
Q3 (2N3906) not only supplies current to the Picaxe but also to LEDS1 and LEDS2 through Q1 and Q2. So Q3 should be rated accordingly.
 

premelec

Senior Member
I have some "battery bank" units which take voltage from one or two lithium batteries and put out 5v to a USB type socket - these turn off automatically when current is not drawn high enough - a short high current pulse will keep them on another 15 seconds - this could be used to advantage to have auto off on low current circuitry - just stop pulsing the current and the unit shuts down. The circuitry in the units prevents over and under charge of the lithium battery and does NOT seem to draw much current when off and "looking" for a load - I judge this from measuring voltages of units which have been in storage for over a year and still show 3.9 volts on the installed battery. The auto off feature is ordinarily a nuisance but could be used to advantage in auto shut off.
 
Top