# Need help with switch circuit - all 3.3v - mofset(s)?

**URL:** <https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432>\
**Category:** General Guidance\
**Created:** [February 15, 2024, 8:53pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432 "2024-02-15T20:53:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![matrixIII](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/matrixiii/32/1013044_2.png) [@matrixIII](https://forum.arduino.cc/u/matrixIII)\
**Post date:** [February 15, 2024, 8:53pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/1 "2024-02-15T20:53:29Z")

</div>

I have the following circuit. I know a p channel MOSFET can do it (to switch the peripheral on/off from ESP32 logic) but I am looking for a variation. Looking for least amount of parts, smallest in size for surface mount assembly that can go in the middle - I would like to have +3.3v at source so that can feed through drain to power the peripheral. A p-channel MOSFET requires LOW/0v at source to turn on this switch and I would like to have HIGH/+3.3v to turn it on. (I also know that n-channel would turn on the peripheral with +3.3v at gate but then I need 0v at source which I don't want). I am handy and a quick learner but I am new to transistors and MOSFETs to calculate the values correctly to chose from thousands out there. What are my options for circuit and parts please?

![switching-circuit](https://europe1.discourse-cdn.com/arduino/original/4X/f/b/8/fb83944f01134b88355c74fa1654aeef80138c12.png)

My goal is to switch +3.3v as grounds are connected together everywhere already. And as ESP32 goes in deep sleep, don't want to keep sending +3.3v/current out of GPIO5 to Gate to keep peripheral off.

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [February 15, 2024, 9:06pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/2 "2024-02-15T21:06:06Z")

</div>

Check this list of MOSFETs I use.  
Pick a P channel MOSFET that works with a gate voltage of 3v3.

> **[7253db9f14a32e3568824488ca7d3ba8cae7aea6.pdf](https://europe1.discourse-cdn.com/arduino/original/3X/7/2/7253db9f14a32e3568824488ca7d3ba8cae7aea6.pdf)**
>
> 1351.52 KB

---

<div class="post-metadata">

**Author:** ![matrixIII](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/matrixiii/32/1013044_2.png) [@matrixIII](https://forum.arduino.cc/u/matrixIII)\
**Post date:** [February 15, 2024, 9:47pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/3 "2024-02-15T21:47:59Z")

</div>

> [@LarryD](#):
>
> Check this list of MOSFETs I use.  
> Pick a P channel MOSFET that works with a gate voltage of 3v3.

As far as I understand it (with my knowledge and skills limitations), a gate voltage of +3v3 will turn off the p-channel MOSFET (as in turn of the peripheral). I would like +3v3 at gate to have +3v3 at drain so the peripheral turns on. May be I need 2 - a p-channel and a n-channel to achieve this.

---

<div class="post-metadata">

**Author:** ![ShermanP](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@ShermanP](https://forum.arduino.cc/u/ShermanP)\
**Post date:** [February 15, 2024, 10:06pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/4 "2024-02-15T22:06:54Z")

</div>

Yes, you need your GPIO pin to drive an N-channel mosfet (or NPN transistor), which in turn drives the gate of the main P-channel mosfet. Below is an example.

 ![Switching High Voltage with Arduino](https://europe1.discourse-cdn.com/arduino/original/4X/e/f/0/ef07532f19c600b13e191d639dcc162c0b72572a.png)

---

<div class="post-metadata">

**Author:** ![ZX80](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zx80/32/643687_2.png) [@ZX80](https://forum.arduino.cc/u/ZX80)\
**Post date:** [February 16, 2024, 12:00am UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/5 "2024-02-16T00:00:51Z")

</div>

In Deep-sleep mode: digital GPIOs (GPIO6 ~ 21) are in a high impedance state.  
So maybe a simple pull-up resistor would do the trick.

---

<div class="post-metadata">

**Author:** ![Wawa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wawa/32/1211303_2.png) [@Wawa](https://forum.arduino.cc/u/Wawa)\
**Post date:** [February 16, 2024, 12:16am UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/6 "2024-02-16T00:16:56Z")

</div>

The GPS module seems to have an ON/OFF pin, so why not use that.  
Leo..

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [February 16, 2024, 2:27am UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/7 "2024-02-16T02:27:45Z")

</div>

> [@matrixIII](#):
>
> don't want to keep sending +3.3v/current out of GPIO5 to Gate to keep peripheral off

Try a pull up resistor from gate to source, from your 'schematic' you put the port LOW to turn on the MOSFET. Your schematic leaves a lot of information missing. For switching MOSFETs you need to remember they are finky and always use the source as a reference for the gate. For a P channel device to be on the gate needs to be at least Vgs rating **negative** to the source. If it is a N channel device the gate needs to be at least Vgs rating **positive** to the source. A pull up/down resistor can be used. I do not know the processor so when going to sleep put it into the input mode if it does not go to a high impedance mode.

---

<div class="post-metadata">

**Author:** ![matrixIII](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/matrixiii/32/1013044_2.png) [@matrixIII](https://forum.arduino.cc/u/matrixIII)\
**Post date:** [February 16, 2024, 4:37am UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/8 "2024-02-16T04:37:58Z")

</div>

> [@Wawa](#):
>
> The GPS module seems to have an ON/OFF pin, so why not use that.  
> Leo..

Good point for the GPS module, and I may do that. However, I think the concept applies still to other 3v3 modules on the board when the whole board is 3v3 powered with 3v3 processor - whats the easiest way to switch power for these components on/off.

---

<div class="post-metadata">

**Author:** ![matrixIII](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/matrixiii/32/1013044_2.png) [@matrixIII](https://forum.arduino.cc/u/matrixIII)\
**Post date:** [February 16, 2024, 4:38am UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/9 "2024-02-16T04:38:24Z")

</div>

> [@ShermanP](#):
>
> Yes, you need your GPIO pin to drive an N-channel mosfet (or NPN transistor), which in turn drives the gate of the main P-channel mosfet. Below is an example.

Perfect, I think this might do it! Just saw there are dual mosfets with p and n channel built in one - looking at those.

---

<div class="post-metadata">

**Author:** ![Wawa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wawa/32/1211303_2.png) [@Wawa](https://forum.arduino.cc/u/Wawa)\
**Post date:** [February 16, 2024, 5:50am UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/10 "2024-02-16T05:50:43Z")

</div>

> [@matrixIII](#):
>
> whats the easiest way to switch power for these components on/off.

Depends on the component.  
A single P-channel fet is enough to switch a 3.3volt supply to a 3.3volt component off.  
But you need a second (level shift) fet if the supplies are different.  
**[This page](https://www.gammon.com.au/motors)** has the basic circuits.

You also can't just turn the power off without turning the data lines off.  
If you don't, the device will still be powered through the data lines, which is bad for the chip.  
Leo..

---

<div class="post-metadata">

**Author:** ![wvmarle](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/wvmarle/32/1013044_2.png) [@wvmarle](https://forum.arduino.cc/u/wvmarle)\
**Post date:** [February 16, 2024, 12:18pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/11 "2024-02-16T12:18:18Z")

</div>

> [@ZX80](#):
>
> In Deep-sleep mode: digital GPIOs (GPIO6 ~ 21) are in a high impedance state.  
> So maybe a simple pull-up resistor would do the trick.

The clamping diodes in the output pin will limit the pin (and with it the MOSFET gate) to Vcc+0.5V, so 3.8V in a 3.3V MCU. You can't switch off the MOSFET that way. You really need that second n-channel MOSFET (or NPN transistor) to control the gate.

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [February 16, 2024, 12:27pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/12 "2024-02-16T12:27:53Z")

</div>

Hi, @matrixIII

What is the application?  
What is your project?

Thanks..Tom... 😀 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![ZX80](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zx80/32/643687_2.png) [@ZX80](https://forum.arduino.cc/u/ZX80)\
**Post date:** [February 16, 2024, 1:33pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/13 "2024-02-16T13:33:05Z")

</div>

+3.3V on the source, +3.3V on the gate ...  
[https://forum.arduino.cc/t/p-channel-mosfet-sanity-check/474169](https://forum.arduino.cc/t/p-channel-mosfet-sanity-check/474169)  
[https://www.gammon.com.au/motors](https://www.gammon.com.au/motors)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 14, 2024, 1:33pm UTC](https://forum.arduino.cc/t/need-help-with-switch-circuit-all-3-3v-mofset-s/1224432/14 "2024-08-14T13:33:40Z")

</div>

Closed on August 14, 2024, 1:33pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
