Resistor values for P-Channel MOSFET + NPN Transistor Switch

larryd: |500x128

Whence did I use "hfe"? Or, more to the point -- if you saw hfe, then apologies. Must have been a typo, since I fully meant "hFE"

"Ground" is an arbitrary concept

No one is saying otherwise.

But, why would anybody do that -- noobs included?

Why do NOOBs do what they do?

The warning stands as is.

If you are teaching, explain the pitfalls and traps.

Whence did I use "hfe"? Or, more to the point -- if you saw hfe, then apologies. Must have been a typo, since I fully meant "HFE"

Never said or implied you wrote hfe.

This was to show the OP where to get the data from hence the FYI.

Back in the day, Ground actually meant, It’s connected to the Earth.

Copper grounding rods are still used in some cases (such as ground-loop problems) or poor grounding issues.

larryd: Never said or implied you wrote hfe.

This was to show the OP where to get the data from hence the FYI.

Sorry. It was presented in the same context as you scolding me about not save NOOBs from themselves. Thus, I assumed it was further scolding ;)

ReverseEMF: Sorry. It was presented in the same context as you scolding me about not save NOOBs from themselves. Thus, I assumed it was further scolding ;)

There is no scolding here.

The point was new people here often have difficulties reproducing simple schematics to actual circuits.

Any kind of multiple power supply situations quite often gets NOOBs confused and into problems.

When they do run into problems, they are often asked to take test measurements and confirm GNDs are connected.

As mentioned by you, there are things called "Rule of thumb . . . .", rules of thumb are great. Well, it is 'my opinion' (yes 'my' opinion) and Rule of thumb, that for interconnected power supplies, use 0V, GND, negative as a return path. Yes you can connect the positive of a battery to the 0 volt pin of another power supply. Yes you can connect the positive of a battery to the positive of another power source. Doing so is not wrong but following my rule of thumb keeps new people on a even footing where they hopefully don't experience problems.

I digress. Points have been made, we are all trying to help NOOBs learn and avoid making mistakes by teaching them to follow best practices.

I think it is more important to emphasis that a voltage regulator output (like the 3.3V output) should not be connected to a power source (like the battery). There is no reason why it is still connnected. Whether or not the GND is connected is almost beside the point because a battery shouldn't be connected to a regulator output. I think it is easier for a NOOB to remember that than it is to determine whether there is a current loop between the battery and the regulator based on whether the Vcc & GND are BOTH connected to the battery.

So why is it connected to the regulator output ?

raschemmel: So why is it connected to the regulator output ?

Because I was unraveling the OPs given circuit -- with the assumption that they asked so I responded. But, I probably should have asked, up front, why the heck they are doing that -- rather than asking later.

larryd: There is no scolding here.

I was being facetious [i.e. tongue-in-cheek] :)

raschemmel: The point was new people here often have difficulties reproducing simple schematics to actual circuits.

Any kind of multiple power supply situations quite often gets NOOBs confused and into problems.

True.

raschemmel: When they do run into problems, they are often asked to take test measurements and confirm GNDs are connected.

The opposite of this case. The grounds are connected. AND, there's a second common, which, also, is connected.

raschemmel: As mentioned by you, there are things called "Rule of thumb . . . .", rules of thumb are great. Well, it is 'my opinion' (yes 'my' opinion) and Rule of thumb, that for interconnected power supplies, use 0V, GND, negative as a return path.

Which is silly ! And not of the real world. It's the common case, but not the general case. But, I see your position of not confusing the NOOB. So, maybe the appropriate language is: "For now, lets only talk about Ground as negative, but some day..."

raschemmel: Yes you can connect the positive of a battery to the 0 volt pin of another power supply. Yes you can connect the positive of a battery to the positive of another power source. Doing so is not wrong but following my rule of thumb keeps new people on a even footing where they hopefully don't experience problems.

I still wouldn't call that a rule of thumb. Its a common practice. But, that's not quite the same thing.

And, again, bottom line. I was merely showing the OP how the circuit they supplied might manage to do something.

yes you can connect the positive of a battery to the positive of another power source

If by power source you mean the OUTPUT pin of the ProMini 3.3V regulator then it IS WRONG.

You should NEVER connect the OUTPUT of a voltage regulator to the positive terminal of a battery.

(the only exception is an experienced engineer designing a circuit who is careful to NOT provide a RETURN path for the battery to the regulator GND. (I believe this is what Larry was referring to ), but since we are talking to NOOBs and not engineers, I think it is best to simply issue a blanket warning to never connect the output of a regulator to the Positive of a batter. Just to be clear (for the NOOBS) , there is nothing wrong with putting a battery in series with the ProMini 3.3V by connecting the NEGATIVE of a 1.5V alkaline AA battery to the 3.3V regulator OUTPUT pin and using the POSITIVE of the 1.5V battery as a 4.8V dc OUTPUT using the ProMini GND.

3.3+1.5

ans = 4.8000

Look at the Supply Voltage specs for TTL Logic ICs

The supply voltage can be as low as 4.75V so if you need to power TTL 5V logic ICs, you can simply put a AA battery in series with the 3.3V to shift the voltage to 4.8V.

The current through the series battery loop is limited to the power source with the highest internal resistance so (for example) :

if a 3.3V regulator can source 800mA and an alkaline battery can source 1A, the maximum current you could source with the series combination would be 800mA

So, to recap, while it is a no no (in general) to connect the + terminal of a battery to the output of the 3.3V regulator, there is no limit to how many series batteries you can connect to it.

CASE 2: You have a ProMini which only outputs 3.3V from the regulator but you have an unregulated 9V input connected the the RAW Input and you need 12V for some device (ie: relay or solenoid or whatever). You can connect two AA or AAA batteries in series with the 9V to get 12V or you could connect a 6-battery AAA pack in series to shift the 3.3V to 12.3V . (using the ProMini GND as your return)

“Because I was unraveling the OPs given circuit ” Now that does make a lot of sense. :) Notice she/he has modified the their schematic in post #1.

“When they do run into problems” The operative word is “When” ;)

“I still wouldn't call that a rule of thumb. Its a common practice. ” I said it’s ‘my’ rule of thumb. And I finished with “best practices”.

I think we scared off the OP :(

raschemmel: I think it is more important to emphasis that a voltage regulator output (like the 3.3V output) should not be connected to a power source (like the battery). There is no reason why it is still connnected. Whether or not the GND is connected is almost beside the point because a battery shouldn't be connected to a regulator output. I think it is easier for a NOOB to remember that than it is to determine whether there is a current loop between the battery and the regulator based on whether the Vcc & GND are BOTH connected to the battery.

I think the defining distinction, here, is the battery is not connected across the Arduino's 3.3V output, merely referenced to it. There's a big difference. If it were connected across the 3.3V supply, then I would agree. But, if what you are saying were true, then it would be impossible to control one powered circuit, with another circuit having a different power source. For example, a voltage translator. Used, for instance, to translate a 3.3V output, into a 5V input. The two devices would need to have a reference connection between them [typically called a "ground", or a "common"]. They have different power supplies, but are connected together, so one voltage system can influence the other voltage system. Yes, this reference connection is typically between the negative side of each of the supplies. But, there are cases where the Negative on one will be connected to the Positive on the other. Or, where two Positives will be connected together. In other words, polarity is ambiguous.

larryd: “Because I was unraveling the OPs given circuit ” Now that does make a lot of sense. :) Notice she/he has modified the their schematic in post #1.

“When they do run into problems” The operative word is “When” ;)

“I still wouldn't call that a rule of thumb. Its a common practice. ” I said it’s ‘my’ rule of thumb. And I finished with “best practices”.

I think we scared off the OP :(

Please us the Quoting feature -- otherwise it very difficult to sort out the narrative.

I think that whole referencing/connecting issue would be best be eliminated by using an opto-isolator to drive the mosfet that switches the battery to the HC-12 module. That way there is complete isolation between the Pro-Mini and the circuit it is switching on and off.

I think we scared off the OP

I've seen threads where the OP had 2 posts and the thread took on a life of it's own by triggering a debate between 6 senior members that went on for more than 30 posts...

I'm sure you have seen similar cases where the OP gets buried alive under very technical replies and his brain explodes...

jaron: [Edit] |500x356

This is revision 1 of the schematic that I've modified according to the inputs given so far:

  • In the original schematics the emitter of the transistor was connected to VCC instead of GND.
  • This revision uses an NDP6020P logic level MOSFET instead of an FQP47P06.
  • There is now a 10kΩ pull-down resistor at the Arduino pin D4.
  • R1 is now 260kΩ and R2 33kΩ, which must be verified.

The circuit is part of a battery powered IOT application where a minimal power consumption and voltage drop are crucial. After some research I came to the above solution to switch all unused components off while an Atmega328P is in deep sleep. The LED is just an example of a consumer, in reality this would be at least an HC-12 433 MHz HF module and one or more sensors which together will probably use 1 A max. [End Edit]

Probably wise to put these Updates in a new post, otherwise we're likely to not see them.

Also, because you're using a MOSFET that is designed to switch a lot of current, it's likely to have a large input capacitance. As such, your Bipolar transistor will need to supply enough current to charge and discharge that capacitance, otherwise the MOSFET will turn ON and OFF more slowly than it's capable of doing. For this case it's not an issue, but when you start switching higher currents, this might become important. As for how to determine the values -- there's math, but I'm more of a back-of-the-envelop designer. I use simplistic math to get into the ballpark, then I breadboard it up and watch for smoke. There are others, here, who's math and methods are far more sophisticated. But, there is always the ole rule-of-thumb that says: Over drive everything to make sure it works! -- like LarryD's 1K and 10k. But, because you're dealing with a battery, more sophistication is probably in order. So, hopefully someone else will help you with that. ;)

“Over drive everything to make sure it works! ” And Larryd said to tune the values upward if power draw was an issue. ;)

One ‘final’ note, the way you have the circuit drawn the gate to source sees either 3.3 volts or a resistor terminated gate potential.

If there was a length of wire connecting the gate to the collector (when the load is at a distance) noise might cause problems.

It is best to have the gate going from 0v to 3.3v, as achieved with common ground return.

I once again offer the OP:

|500x336

Condolences to the OP.

raschemmel: I think that whole referencing/connecting issue would be best be eliminated by using an opto-isolator to drive the mosfet that switches the battery to the HC-12 module. That way there is complete isolation between the Pro-Mini and the circuit it is switching on and off.

Sure, in some cases, but to offer that as a panacea, ignores the specific case. And, the specific case is yet to be determined -- merely because, it hasn't been offered yet. Probably because the OP is still in an experimentation phase. ;)

I'll take the schematic in Reply#35 over the one in #34 any day because it does not have the battery across the promini 3.3V.

@OP HELLO ! ANYBODY HOME ? Are you still there ?

@ReverseEMF

Removing images from a post makes subsequent responses hard to follow.

Removing images from a post makes subsequent responses hard to follow.

The exception being when you say something and then wake up in the middle of the night and realize somebody might interpret it in a negative way and go back and change it or remove the post entirely hoping nobody saw it because they were out on the town and didn't have access to the net.

Why isn't R2 replaced with R3 and the LED? Would make things simpler. No need for the P-Mosfet. Or replace the NPN with an N-Mosfet, one that turns on full with >2.5V gate voltage. I saw one mentioned in the forum pretty recently.

Would be best to use a a N channel MOSFET, 2.5v turn ON are not too available.

I do not like 3.3v logic.

Only argument to use a P channel is if you need 0v across the load when MOSFET is turned off ‘and’ need a GND reference on the load.

P channel small lower power SMDs AO3401 FDN340P Si2301DS

N IRLML2502 Si2302DS