Awesome price (that’s around the 10k unit price break). Who are you using as a fab?
JLCPCB. First time I’ve used them, or really anyone for assembly.
They have, as I understand it (their docs kinda suck) three different classes for parts: basic, extended preferred, and extended. There are a few hundred basic parts that are always in the assembly machine. Mostly passives. And a few thousand preferred parts which I suspect are kept close by. Finally, there are hundreds of thousands of extended parts which must be fetched from a warehouse or something. They charge a $3/run fee for the extended parts, which isn’t too bad (so I could use them for stuff I really can’t work around), but the basic and preferred parts have no extra charge. So I’m sticking with those when possible.
While I have people’s ear…
Another feature I wanted was a switched 5V source. But of course the microcontroller pins only output 3.3v.
I figured I could use a BJT with the collector at 5V, the base pulled to 5V with a pull-up resistor, and the emitter as the output. Then, a MOSFET that can pull the base low, with the gate connected to the microcontroller.
The only trouble, as I understand it, is that I’ll have about an 0.6v drop due to the need for a base-emitter difference. A bit less at low currents, maybe.
My understanding is that MOSFETs are even worse in this respect, and often need a gate-source difference of >2 V for decently low resistance.
Is my understanding correct? And if so, is there a better way to do this? (no electromechanical relays, please)
Incidentally, I will also have a simple current sink with a MOSFET source at ground. I realize that’s usually the preferred way to switch a load since it maximizes gate-source voltage. But not all the things I interface with will support this mode of operation.
Couldn’t you use a p-channel MOSFET?
No problem getting enough gate-source voltage drive, and I think (admittedly I haven’t been doing any hardware design for quite a while) that the ‘on’ resistance can be as low as a few tens of milliohms.
How much current from the 5V source? What power supply voltages do you have? How close to 5V do you need to go?
Search “Logic level FET”.
Plenty with Vgs under 1.8v
High-side switching is best done using a PNP BJT transistor. This transistor is controlled by an NPN transistor, which is controlled by the microcontroller. Two or three resistors are also required.
high side switching pnp
(then select Images)
to get circuit ideas.
As @Crafter_Man mentions you want to use a PNP for high-side switching - emitter at 5V, collector to load, base driven from the level shifter (NMOS + pullup). You will need a series resistor to the base to limit base current when you turn on. Voltage drop will be the Vce(sat) at your load current.
A little simpler using a PMOS as the high side switch (source at 5V, drain to load, gate to level shifter) since you don’t need the base current limiting resistor. You will have -5V Vgs when the output is on so plenty of drive. Voltage drop of Vds(sat) at your load current and gate voltage.
It depends on how close to 5v you want the output voltage to be, and of course how much current you want to be able to supply.
A junction transistor is always going to have that 600-700 mv junction drop. Whereas a P-channel MOSFET when biased ‘full on’ acts as a low value resistor with no intrinsic built-in source-to-drain voltage drop, at least as I recall from my hardware engineer days and a few brief scans of data sheets…?
Correct. You can get microvolt drops at low current.
This is not correct. That is the base voltage (Vbe), which does not appear in series with the load. The voltage drop when used as a switch is determined by Vce(sat), which can be in the tens of millivolts depending on current and transistor characteristics. Vce(sat) is a key parameter for switching transistors, since lower Vce(sat) => less power dissipated in the transistor => higher efficiency.
It depends on the VCE saturation voltage for the given current. In many cases it is around 0.2 V to 0.3 V.
Contrary to popular opinion, a MOSFET is not “always” better than a BJT, and vice-versa. For some designs, a BJT will give a lower voltage drop vs. a MOSFET. In other designs, a MOSFET will give a lower voltage drop vs. a BJT. It depends on a number of variables (current, voltage, temperature, size, etc.), with the main one being current.
Here is a relevent application note (sorry, pdf):
Low VCEsat transistors in medium power load switch applications
You’re right, but I think we’re in danger of going down a technical rathole here.
Yes of course the Vbe is not in the load path.
A fully on bipolar transistor may indeed have a Vce drop less than 700 mv: maybe as low as 200 mv?
But I think an enhancement mode MOSFET behaves more like a resistor than a junction transistor: once it’s fully ‘on’, I don’t think there is a threshold voltage before it conducts?
A BJT does not have a threshold before it conducts either. Vce(sat) is not a threshold, it is the transition point between the saturation and the active region for a given base current. Above Vce(sat) the collector current is (to first order, ignoring Early voltage etc.) independent of Vce. Below Vce(sat) the collector current is highly dependent on Vce, and decreases to zero as Vce decreases to zero.
Essentially Vce(sat) defines the voltage drop (Vce) where the transistor becomes a constant current source and therefore useless as a switch.
Again, it depends on a number of variables. But I’ve seen it as low as 0.15 V.
Right… whereas a BJT has a (more-or-less) constant voltage drop when the transistor is fully on, a MOSFET has a (more-or-less) constant resistance when the transistor is fully on. (This also means the voltage drop for a MOSFET, unlike a BJT, is not constant when it is fully on; it varies with the current.)
For a given current in a switching application, you might find the voltage drop across a MOSFET (due to its resistance and the current) is less than the “constant” voltage drop across a BJT. On the other hand, for a given current, you might find the voltage drop across a MOSFET (due to its resistance and the current) is more than the “constant” voltage drop across a BJT. There are a lot of variables at play, and I am glossing over a bunch of things, but that’s the essence in a nutshell.
Another thing to keep in mind is that a “low” on resistance for a MOSFET comes at a “price.” And that price is a relatively high gate-to-source voltage. I have found that so-called “logic level” MOSFETs leave a lot to be desired in switching applications, and will usually resort to BJTs for logic-level stuff.
Let’s say around 500 mA. Maybe 1 A if it can be done compactly. It’s all powered by USB, so only 5v is available (and a small 3.3v supply from the microcontroller). I guess somewhere around 4.8v would be nice. Most stuff rated for 5v will work at 4.8v. 4.4v is getting dicey.
Ahh! See, this is the problem with having a totally amateur level of electronics understanding. I understand plenty of the basics. But there are entire holes in my knowledge base, like this one. That looks like what I want. And now I have a new topology to keep in mind.
I would go with a PMOS for the high side switch. You have 5V of Vgs, it should be pretty easy to find a FET with on resistance less than 100mohm (0.1V drop @1A) that can handle 1A current.
NMOS and pull-up specs are not going to be critical since I am guessing you don’t care about switching speed.
Yeah, 5 cents for the AO3401A. Also nice–for the purposes of JLCPCB specifically–is that it’s a “basic part”, not an “extended preferred part”. Neither type incurs a handling fee, but from additional investigation, it looks like the preferred parts rotate in and out over time, so there’s not a huge guarantee that they’ll be there when I need them. They’re also sometimes in low/no stock. The AO3401A above has almost half a million in stock.
I may end up putting in a boost converter, in any case. They have a cheap 350 mA IC that can go up to 28 V (a TPS61040). And another 1.5A model (MC34063) that’s slightly less cheap, but still not bad. Need to figure out the component selection, though.
I can (and have, in the past) use external DC-DC converters when the need arises, but having a local adjustable supply could prove very handy.
For something like a switching regulator, follow the recommended components as closely as possible (capacitor voltage rating, physical size, and dielectric) and the layout to the letter. Very experienced people are making thos reference designs.