Resistor values for P-Channel MOSFET + NPN Transistor Switch

Suggest you (OP) make R1 = 1k and R2 = 10k.

If and only if you (OP) need to save on current draw, tune the resistors upwardly.

Edit
You do not need R4.

raschemmel:
I think you mean IB here, NOT IC

and 260k NOT 26k

Like this:
R1 = (VIN-VBE)/IB =(3.3V-0.7)/10uA = 260k

I think you missed the ß of 10. That's what converts IC to IB.

larryd:
As stated, NOOBs are hammered with connecting the Arduino GND to the external power supply GND.

Your circuit’s ProMini is being powered via +V power supply.

You are connecting the ProMini Vcc (3.3v) to the external load battery supply +3.3v for the circuit return path.

No effort was made to warn the OP to not connect Arduino GND and external power supply GND.

We can all offer weird and wonderful ways of biasing and referencing circuits.
However, we should have the foresight to tell new people what might happen if GNDs are then connected.

Good point. Changing it to:

Edit

larryd:

There is no Ground on a battery. "Ground" is an arbitrary concept. Yes, there are cases where the Ground Point is defined, such as on the Arduino [which defines it as the Negative Side of the Voltage Source], but the positive side of a battery can, also, be chosen as "Ground" [have you never heard of a positive ground car?]. Thus, the Circuit Designer as full freedom to place "Ground" wherever he/she chooses. For instance, there are OpAmps, such as the LM324, that are designed to function with a single rail supply, in which case, the inverting input is tied to the negative side of the supply--a side that assumes an identity as "Ground". But, such OpAmps, usually, can function just fine with a dual rail supply. In which case the moniker "Ground" is assigned to the point halfway between the Positive, and Negative supply points.

In my schematic there is the pre-defined Arduino "Ground" [which may, or may not, be connected to the actual physical ground]. And, the MOSFET Drain circuit, has it's own "Common" that is connected to the Arduino's 3V pin, and to the Positive side of the battery -- neither of which is ground [i.e. the *ground* defined by the Arduino].

And, therein lies the source of the confusion: conflating the concept of "Ground", with the concept of "Common". I agree there should be only one "Ground", in the sense that a true Ground is actually connected to the physical ground [i.e. the *Earth*], and there's only one "Earth". But, there can be more than one common, which is the case in this schematic of mine [the one that has raised so much alarm], and connecting two unrelated commons to ground, will likely lead to a short. But, why would anybody do that -- noobs included? It's not part of the schematic -- the schematic clearly shows how things are to be connected.

And, so often, the term "Ground" is used, when it's really a "Common" -- like in the case of the Arduino [where is an Arduino connected to the Earth?!?] It's like how we still say, "The phone is ringing", when, really, its a cellphone playing "We are the champions!". Back in the day, Ground actually meant, It's connected to the Earth.

larryd:

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 :wink:

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 :wink:

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] :slight_smile:

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. :slight_smile:
Notice she/he has modified the their schematic in post #1.

“When they do run into problems”
The operative word is “When” :wink:

“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 :frowning:

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. :slight_smile:
Notice she/he has modified the their schematic in post #1.

“When they do run into problems”
The operative word is “When” :wink:

“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 :frowning:

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]

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. :wink:

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

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:

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. :wink: