How to switch a MOSFET when the drain is connected to 50V?  - Page 1
Forum section: electronics / beginners

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 11:30:43 am
content: Hi all. This is my first forum post here.I'm having some trouble figuring out how to switch a high-side MOSFET connected to a 50V voltage source.The circuit (shown in the image below) involves two switches (1) and (2). I have n-channel MOSFETs on hand. For (1) switching is straightforward because V_G is referenced to ground, so I can switch it adequately with 5V. But switching (2) is where I'm having trouble.Using an n-channel MOSFET here doesn't work well because it is referenced to a variable voltage. The voltage of the drain of (2) is stable though (50V). So maybe a p-channel MOSFET would be best here? Then how would I go about producing the required gate voltage (say 45V) to trigger switching? From the digital logic pins on an arduino to that.In the future, I'd like to up the voltage source to 250V, what solution would be future proof for that?

author: Benta
author_rank: Super Contributor
timestamp: August 29, 2025, 11:35:25 am
content: How fast does it need to switch? If it's slow (milliseconds), a photovoltaic optocoupler is usually the best way.Like Vishay VO1263A.

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 11:40:45 am
content: Oh I forgot to add that detail. Very slow switching, like every couple of minutes.I'll check out a photovoltaic optocoupler on youtube. Can I stack photovoltaic optocouplers? To reach 250V?

author: ledtester
author_rank: Super Contributor
timestamp: August 29, 2025, 01:36:31 pm
content: Quote from: infinitesimalkeisler on August 29, 2025, 11:40:45 amThe photovoltaic optocoupler produces a floating voltage (like 15V) on its output so you don't need to stack them if the MOSFET is used in a higher voltage circuit. Simply connect the outputs to the gate and source of the MOSFET -- its like a 15V battery you can turn on and off with another signal. Just make sure your MOSFET can handle the drain-source voltage.

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 06:05:08 pm
content: After looking at the datasheet for the Vishay VO1263A there are some problems in using it in my circuit.When the capacitor is discharged, the effective resistance of the circuit is 250 ohms. That translates to a tiny open circuit voltage for the VO1263A, not enough to drive the gate voltage required (~8V)Is there a workaround for this?

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 06:16:24 pm
content: If I connect a large resistance between MOSFET gate and drain (p-channel case), that might satisfy the load requirements. I'm not sure

author: Uunoctium
author_rank: Frequent Contributor
timestamp: August 29, 2025, 06:28:44 pm
content: just a suggestion...

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 06:52:48 pm
content: Is the bottom right branch the one with the capacitor?I would switch it this way, it's a lot simpler. But the 1M and 20.4k resistor is a voltage divider used for measuring voltage across the capacitor (sent to an ADC). So I need to switch the source directly from the left to not interfere with that.

author: ledtester
author_rank: Super Contributor
timestamp: August 29, 2025, 06:54:19 pm
content: Quote from: infinitesimalkeisler on August 29, 2025, 06:05:08 pmThis is how I imagine using the photovoltaic optocoupler would work:(see attachment)The control signal is low voltage - like from a GPIO pin. Also, the two grounds don't have to be the same. You can control M2 in a similar fashion or if the grounds are the same then just drive it directly from the GPIO pin.

author: Benta
author_rank: Super Contributor
timestamp: August 29, 2025, 06:54:34 pm
content: Quote from: infinitesimalkeisler on August 29, 2025, 06:05:08 pmI have a feeling you don't understand photovoltaic couplers.Connect pin 5 to gate and 6 to source (N-ch FET assumed). Drive the LED on pins 4 and 3 to turn on the MOSFET.Your load doesn't come into the equation at all.

author: Benta
author_rank: Super Contributor
timestamp: August 29, 2025, 06:57:33 pm
content: Yes, exactly as ledtester has drawn it. No level shifting or other stuff required.

author: TimFox
author_rank: Super Contributor
timestamp: August 29, 2025, 07:05:09 pm
content: Yes, “photovoltaic” here means that a voltage appears because of the optical power hitting the photodiodes at the output. No power supply is required at the output.The isolation voltage from the input LEDs comes from the optically transparent insulation between input and output.The output cannot supply high current, so a MOSFET gate is a suitable load, but the response time is slowed by the various capacitances and the limited photo current.

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 07:06:51 pm
content: Quote from: Benta on August 29, 2025, 06:54:34 pmThat's how I thought it worked. What confused me was what they meant by load resistance in figure 2 on the data sheet.

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 07:09:00 pm
content: In any case, thanks for the help guys. The parts are ordered, this is a good solution for my application.

author: TimFox
author_rank: Super Contributor
timestamp: August 29, 2025, 07:13:42 pm
content: Quote from: infinitesimalkeisler on August 29, 2025, 07:06:51 pmThe top 3 curves in Fig 2 of the data sheet show the maximum voltage obtained at high load resistance, but the “100 k” line shows the limited current (roughly proportional to LED current).

author: Benta
author_rank: Super Contributor
timestamp: August 29, 2025, 07:33:40 pm
content: A tip:The VO1263 is a dual. You can double output current (= faster MOSFET turn-on)) by paralleling the two photovoltaic cells.

author: Zero999
author_rank: Super Contributor
timestamp: August 29, 2025, 09:56:56 pm
content: Does it need to switch continuously on? Can't you bootstrap it? This circuit can give long on times, hundreds of ms, even when C1 is only 100nF.https://www.onsemi.com/pub/collateral/an-6076.pdfbootstrap MOSFET high duty cycle.asc

author: Benta
author_rank: Super Contributor
timestamp: August 29, 2025, 10:01:33 pm
content: I think you overlooked the wish to operate at 250 V if possible.

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 10:07:58 pm
content: Quote from: Zero999 on August 29, 2025, 09:56:56 pmCan't bootstrap because the input signal isn't period. It's just continuous DC to charge a 4200uF capacitor over several seconds.

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 29, 2025, 10:20:52 pm
content: I've settled on using the optocoupler method though.Not sure how to close a thread on this forum.

author: Smokey
author_rank: Super Contributor
timestamp: August 29, 2025, 10:34:01 pm
content: In general, to switch an nchannel FET as a high side switch and you want it to have a 100% duty (stay on for a while), you need a gate voltage from somewhere that is higher than the source voltage. There are a number of ways to do this:1) Generate an isolated floating voltage and tie it to the source of the FET. There are multiple ways to do this:a) Flyback converter output. Convenient if you already need a power supply on the board to add another tap.b) Isolated DC-DC Converter block. Something like this:https://diwellshop.cafe24.com/web/DATASHEET/01_subtitle/4_POWER/2_DC-DC/SRS-1212-2/SR.pdf2) Use a high side FET driver with a 100% duty internal bootstrap.https://www.ti.com/lit/ds/symlink/lm74502.pdfSomething like LM74502 is good up to 65V. Also configurable for reverse polarity protection.If you don't need 100% duty (like something that is constantly switching) then you can use a typical gate driver for a motor controller type system that has a bootstrap cap that charges every time it switches.If you want to switch up to 250V, I would use 1-b and use an isolated dc-dc converter as the gate voltage and run that with an isolated gate driver.For under 65V I would just use the LM74502.

author: Benta
author_rank: Super Contributor
timestamp: August 29, 2025, 10:57:47 pm
content: Quote from: infinitesimalkeisler on August 29, 2025, 10:20:52 pmYou can't, you'll be plagued by more or less imaginative suggestions in the future.Don't worry, just ignore it and switch off notifications.Cheers.

author: Zero999
author_rank: Super Contributor
timestamp: August 30, 2025, 10:40:43 am
content: Quote from: Benta on August 29, 2025, 10:01:33 pmNo I didn't. The circuit I posted is just a demonstration of bootstrapping. It was not intended as a drop-in solution. The same principle can be applied to much higher voltages than 50V.Quote from: infinitesimalkeisler on August 29, 2025, 10:07:58 pmThe input signal doesn't have to be periodic to use a boot-strap. When the power is first connected, keep the output off, to allow time for the boot-strap capacitor to charge, then turn it on for as long as necessary to charge the capacitor.

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 30, 2025, 12:02:10 pm
content: Quote from: Zero999 on August 30, 2025, 10:40:43 amThat's pretty neat, didn't think of that.But if we PWM the input the current spikes from the 4200uF cap would be quite large. But I'll keep this implementation in mind for different situations.

author: golden_labels
author_rank: Super Contributor
timestamp: August 30, 2025, 04:16:53 pm
content: Perhaps this question should have been asked earlier: why do you want to put two switches in series?

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 30, 2025, 09:09:06 pm
content: Quote from: golden_labels on August 30, 2025, 04:16:53 pmI suppose I could only use the high-side switch.But I prefer to disconnect the voltage source entirely to be safe for when the capacitor discharges, it isn't much extra work.

author: Zero999
author_rank: Super Contributor
timestamp: August 30, 2025, 09:21:10 pm
content: Quote from: infinitesimalkeisler on August 30, 2025, 09:09:06 pmIt would be easier just to add a diode, or two MOSFETs connected back-to-back.If it's protection against shock, then you mustn't rely on semiconductors to isolate the capacitor. A mechanical isolator is the only way to do that.The best way to protect against shock from a capacitor is to discharge it when the power is removed.

author: Smokey
author_rank: Super Contributor
timestamp: August 31, 2025, 02:26:54 am
content: Quote from: Zero999 on August 30, 2025, 09:21:10 pmOr just use a LM74502

author: ledtester
author_rank: Super Contributor
timestamp: August 31, 2025, 03:47:33 am
content: Back in reply #2...Quote from: infinitesimalkeisler on August 29, 2025, 11:40:45 amHow about just using a relay for the high-side switch? And maybe also for the low-side in light of Zero999's comment.

author: golden_labels
author_rank: Super Contributor
timestamp: August 31, 2025, 02:29:37 pm
content: Quote from: infinitesimalkeisler on August 30, 2025, 09:09:06 pmZero999 covered most of the response, including the safety part. So I’ll add only one more note.Charge needs a loop to flow.A loop stops being a loop after you break it in one place:(1)No need to add multiple breaks.However, we all are missing something in this picture.Other things, not shown in the diagram, are going to be connected in this circuit. Right? And they will form other loops. They may be or may be not important. Since we don’t see them, we can’t tell.But consider them too.Of course taking resistances into account: there is little to worry about with a 1 MΩ resistor in line.(1)The image breaks, if we’re talking about fast transients or ≥kV range voltages. Though not because of loop logic is wrong, but because what constitutes “a break” changes.

author: infinitesimalkeisler
author_rank: Contributor
timestamp: August 31, 2025, 05:24:14 pm
content: Quote from: golden_labels on August 31, 2025, 02:29:37 pmAfter reading this I realize I had incorrectly assumed a common ground node between the negative terminal of the voltage source and the rest of the circuit when the negative terminal is disconnected via a switch. Clumsy mistake.Thank you for helping me understand that.P.S nice stick figure renditions