Transistor for Power Enable Circuit with Hold

Thread Starter

BurninBri

Joined Aug 16, 2011
30
I have circuit that runs on a 12V battery. The battery supplies power to a power regulator with an enable pin (logic 5V on, shorting to ground turns off the power regulator). The circuit allows a "power-on enable" pin to turn on the device; this power-on enable pin can be up to 12 volts.

If I'm just converting the 12 volts of the "power-on enable" pin to the 5V logic required for the voltage regulator's enable pin (that actually turns on the power to the rest of the circuitry) - then I can just put it through a voltage divider. Should be no problem.

However, I also want to keep the power on - even if the power-on enable pin goes back to 0V. I would like to do this with a GPIO (General Purpose I/O) output pin that I have available from an extra pin in my circuit. The GPIO can output 3.3V. (Note that I also have a separate GPIO "power-on sense" pin that can read to see if the "power-on enable" pin went back to ground or not.)

I am trying to allow the voltage regulator to have a logic 5V input, either from the 12V "power-on enable" pin OR from the 3.3v GPIO. In order to go from 3.3v on the GPIO to 5V, I was thinking I would do this from a transistor to 12V. And in order not to affect the other circuits, I just used two diodes to allow either one of these inputs to keep the device on.

I have attached a schematic of my circuit here, and my question is whether this is correct or not (in a general sense) and if this would work well for doing what I want to do. I typically do digital circuits, so any help with the transistor and diodes would be appreciated. I've read up on how to do this, and it seems like this may work. Any thoughts on the type of transistor? I'm thinking it would be an NPN-type, but if anyone can give a "standard one" that would be great. (Then I can look up the specifics on it.)

I was thinking all the resistor networks would need to get me to 5.7V since there would be a 0.7v drop across the diodes. So that would be a 52.5k/47.5k voltage divider on the "Power-on Enable" pin to go from 12V to 5.7V.

I would have a 52.5k resistor tied to the transistor collector and a 47.5k tied to its emitter. As for the resistor going into the base, the GPIO pin is 3.3V and I would want 6.4V on the base (to get 5.7V at the emitter). Since I'm using such big resistors here, I would only have 0.12mA of current flowing when the transistor is turned on. I've seen transistors with a gain of 100x current, which would mean I would only have .0012mA going into the base resistor (which is a difference of 3.3V & 6.4V)... which would mean I should use a 2.583M-ohm resistor on the transistor's base.

Does this all sound correct? Should this all work fine? Or are there any "gotcha's" that I have to worry about here?

Thanks for any help and pointers!!
 

Attachments

#12

Joined Nov 30, 2010
18,224
About a dozen gotchas.

B4 I forget, if you sense the voltage level on the enable pin to tell when to turn on the GPIO feed, the next time you sense the voltage, it will be high and the brain will turn the GPIO enable off. Don't check for logic high if the GPIO is already driving the enable pin.

Next, your math is right on the resistors but you can't buy those values and you would be safer if you allowed ten times that much current to flow. If this isn't a power miser application, use 1ma for your voltage divider, and I don't mean 1.000 milliamps. I mean give or take 10%.

Third, you are using the transistor wrong. 3.3 volts on the base will never get 5 volts out of the emitter. The emitter always lags the base by about .6 volts. This will have to be arranged differently.

You're welcome.

2N3904 and 2N3906 are the kind of cheap transistors that can do this kind of work.

Use the 3.3 volts to drive the base of an npn transistor with a 27k resistor. The point is to ensure saturation of the transistor by driving the base with what amounts to 10% of the load current. Ground the emitter and use the collector to drive the next transistor. It will be a pnp with its emitter connected to the +12V. Put a 12k resistor from +12 to the base of the pnp and connect that junction to the collector of the npn. Now you have a pnp "pulling down" 12 volts when the 3.3 is high and you can put your voltage divider on there...from collector of pnp to the voltage divider resistors. Use (2) 5.6 k resistors for the voltage divider.

This is getting cramped. I'm gonna post now and add on as needed.
 

Attachments

Last edited:

Thread Starter

BurninBri

Joined Aug 16, 2011
30
#12, Thanks!

This was extremely helpful. I was wondering if I needed to do an emitter/follower pair of transistors, so your schematic was exactly what I was looking for! Thanks also for the "standard" transistors, since I don't work with them much.

I redid it so you could see the final schematic that I think I'm going with (unless there are any further points). Note that I am using two different GPIO's - one for sensing and a separate one for driving output when I want to keep the circuit on, so I should be able to tell when the "pwr-on" pin goes low with the sensing pin then wait a certain delay and then stop driving the output to shut the circuit off.

Since my GPIO sense expects a 3.3V input, I further divided the resistor value there (and yes, this time I used standard values - I hope).

Is there a "standard diode" that I should be using for this as well?

Thanks again. If there are any further points please let me know.
 

Attachments

#12

Joined Nov 30, 2010
18,224
Looks good to me.

Common diodes...1N914, 1n4001, 1N4148

You're looking for milliamps capability and rather low voltage if you go looking for one yourself. It's hard to find a diode that is too weak to do this job. Your most likely mistake will be buying one that is way more powerful than you need.
 

Thread Starter

BurninBri

Joined Aug 16, 2011
30
I was thinking that I was 1% low (4.95v):
12V-0.7 transistor drop is 11.3V then the divide-by-2 resistors for 5.65, then it goes through the diode drop of 0.7v for 4.95. Either way (4.95 or 5.15) - this will work great!

Yeah, the "power enable" pin is a 5V logic pin (I'm pretty sure - I'll double check), so this should be good.

I had seen the 1N4001 previously, so I thought it was a pretty standard part. Thanks for confirming it and for letting me know about the others. I just looked them up and they have a better switching time and are 100V instead of 50V, but I don't think I need that for this application - so 1N4001 it is.

Thanks again,
Brian
 

Thread Starter

BurninBri

Joined Aug 16, 2011
30
Doh. I think I just saw my mistake. There is no 0.7V drop across the diode from the collector to the emitter. So I think it would be 6V-0.7 across the diode, which is 5.3V.

Okay, I guess I'll change the top resistor value from 5.6k to 6.2k. That should be perfect.

Thanks again!
 
Top