Using an N-channel and P-channel mosfet to switch VCC on, am I doing this right? - Page 1
Forum section: electronics / beginners

author: vortexnl
author_rank: Contributor
timestamp: August 21, 2014, 10:04:34 pm
content: To keep it short, I want to be able to switch power to an IC using the DTR pin on a board we're using. This is the setup I'm using:Basically, the PWR input will be the 3.3v power input, and the VCC will be the VCC pin of the device. Both mosfets are logic level so should be able to operate in these voltages.I have soldered everything on the PCB, triple checked that the footprints are correct, but this is currently happening:When DTR is pulled low, VCC will be ~2.8V and I can pull current from it by shorting the VCC pin (current limited on power supply)When DTR is high, VCC will be 3.3v.I don't really know what could be going wrong here, have I swapped source/drain around or something? One last thing to note is that I had a lot of problems reflowing this board so the small SOT-23 packages might have given up due to the heat, but I will solder another board tomorrow and see if the problem persists.

author: c4757p
author_rank: Super Contributor
timestamp: August 21, 2014, 10:13:50 pm
content: You have source and drain of Q1 swapped. What you're seeing - see that little diode symbol inside the MOSFET symbol? (The one you've used even draws a second, redundant diode symbol, in case you forget.) The power is flowing through that.That diode is a parasitic P-N junction formed by the MOSFET's channel (P-type) and the body underneath it (N-type), so current can flow from the channel to the body. The body has to be connectedsomewhere- since the source is usually at the highest voltage in a PFET, they connect the body to the source so that when used correctly, this parasitic diode will never conduct. If you connect it backwards, current can flow from any point in the channel (such as the drain) out to the body, and from there to the source contact.

author: vortexnl
author_rank: Contributor
timestamp: August 22, 2014, 02:25:39 pm
content: Looks like I properly messed up. I looked up pictures online of circuits where a P mosfet was used to source current, and it would have this layout. So the drain side should always be connected to the load you're trying to source/sink right? This sucks because I just cost my boss 74 euro's in PCB costs. fuck.Edit:This is what I was talking about when I looked up examples:

author: c4757p
author_rank: Super Contributor
timestamp: August 22, 2014, 02:29:59 pm
content: Yeah, that picture is wrong too. I'd generally recommend 1) avoiding anything you find at the Arduino forums in general, and 2) actually readingthe page a picture comes from... the first comment made is that the FET is backward.

author: vortexnl
author_rank: Contributor
timestamp: August 22, 2014, 02:35:55 pm
content: Yeah I rushed it, what a beginners mistake! Maybe I can find a SOT23 mosfet that has different connections? Or a PNP transistor perhaps....

author: Precipice
author_rank: Frequent Contributor
timestamp: August 22, 2014, 03:07:46 pm
content: you can always make a SOT23 fit, by rotating and / or flipping. 3 pins can only be wrong in so many ways...Sure, it's not always attractive, but there's no way it's worth a PCB spin unless you're making lots.

author: vortexnl
author_rank: Contributor
timestamp: August 22, 2014, 03:19:28 pm
content: Yeah it is only 74 bucks. I'll just bypass the switch and have the IC on all the time, we can test all the other functions and I'll swap the source/drain before the next runI still can't believe I made such a rookie mistake, and I'm feeling horrible at the moment, but it could be worse :')

author: SL4P
author_rank: Super Contributor
timestamp: August 22, 2014, 11:37:40 pm
content: The way I 'remember' - FETs in simple supply applications is -Gate-Source-Drain...S = SupplyrailP-type =+V supply railN-type =-V supply rail

author: vortexnl
author_rank: Contributor
timestamp: August 23, 2014, 11:40:38 am
content: Quote from: SL4P on August 22, 2014, 11:37:40 pmThats the way I see it too now! thanks(same with the emitter on a BJT)