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!!
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
-
13.2 KB Views: 62