High side switch

panic mode

Joined Oct 10, 2011
4,985
no...NPN has same limitation as N-channel mosfet. to turn it on you need positive signal (voltage higher than supply).

if load is low, you can drive it directly by optocoupler. if you need more current, you can use suitable SSR like VO1400AEFTR or AQG22212 or bigger...
1768833389714.png
 
Last edited:

panic mode

Joined Oct 10, 2011
4,985
yup...switching on high side using NPN is possible (as sghioto has shown). the drawback of this is higher voltage drop across output transistor - that is some 10x larger than comparable circuit with PNP (and much worse if that NPN was replaced with NMOS). and that is ok if the load current is low (signaling rather that delivering power). i suppose I got carried away with beefy MOSFETs like IRL540 that thread started with.... ;)
 

Irving

Joined Jan 30, 2016
5,128
Given the TS requirement is to switch 40mA or so (post #6), why complicate it with BJTs etc. A simple P-channel MOSFET, even a pretty awful one, is far better than any polarity of BJT for this requirement, as any style of BJT will lose you 0.3 - 0.5v or so compared to the <0.1v of a P-channel.

The Infineon IRFU5305PBF I recommended in post #8 has an Rds(on) of 65mOhm, <3mV @40mA and <0.35v @ 5A!
 

sghioto

Joined Dec 31, 2017
8,634
Given the TS requirement is to switch 40mA or so (post #6), why complicate it with BJTs etc.
The TS asked is the reason I posted the BJT circuits.
Originally wanted to keep the N channel as a high side switch.
Post #5 shows a P channel high side configuration.
 

Irving

Joined Jan 30, 2016
5,128
At these low currents, the saturation voltage of a 2N3904 is less than 90 mV, and the 2N2222 is lower.
OK I'll give you that with the PNP, better than I recall, assuming the current is definitely that low, but with an NPN the output will always be 0.6v below the input.

I rarely use BJT these days!
 

sghioto

Joined Dec 31, 2017
8,634
Getting back to post #1 the request is feasible using the N channel as a high side switch depending on the load.
Below is an actual test using a IRF520N mosfet may get better results using the IRL540N as originally listed.
If the load is a 12 volt relay @ 40 ma then 9.9 volts output might work.
1768865644855.png
 

Thread Starter

barg

Joined Dec 23, 2015
129
Getting back to post #1 the request is feasible using the N channel as a high side switch depending on the load.
Below is an actual test using a IRF520N mosfet may get better results using the IRL540N as originally listed.
If the load is a 12 volt relay @ 40 ma then 9.9 volts output might work.
View attachment 362413
Hi sghioto,
Thanks for the solution as it makes things in order for me. as for now there are 2 options (switching directly with opto).
 

Thread Starter

barg

Joined Dec 23, 2015
129
if load is low, you can drive it directly by optocoupler. if you need more current, you can use suitable SSR like VO1400AEFTR or AQG22212 or bigger...
View attachment 362365
[/QUOTE]
Hi, Thanks, yes, its only a 12v relay with max 40-50ma constant, if using this option, deos it need any pull down resistor between 12v to pin#4 of the opto or the 12v output(pin#1 of the connector to gnd) or not? is it reliable as the option with the mosfet in post#30?
 
Last edited:

Irving

Joined Jan 30, 2016
5,128
The PC817 opto won't reliably drive 40mA directly, it's max Ic at 25C is recommended at 30mA. Even then you need to go for a C or D quality part to get enough CTR to hope to get to >30mA from a typical GPIO output current of 10 - 15mA (depending on MCU and # of GPIOs in use).

Given we now know it's a relay load a high-side PNP is the cheapest option, the 2N3904 or 2N2222 are a few cents/pence. Even the high-side NPN would be fine here, 11v out would be fine. I'd steer clear of the high-side N-channel, yes it'll probably work with 9v or so output but it's not guaranteed for all combos of MOSFET & relay...
 
Top