Just wanna verify my idea here for a bit, I am trying to ultra conserve the power of my battery by turning off the IMU using a MOSFET I have laying around(that's why the capabilities of this MOSFET might be slightly overkill) Now i forgot to label it but a microcontroller with 3.3V logic will drive the gate and turn on and off the MOSFET depending on weather or not the microcontroller wants to use the IMU. Is this circuit viable? The IMU takes 3.3Vs btw, so essentially all three pins of the MOSFET runs on 3.3V
Here is the datasheet: https://www.unikeyic.com/media/datasheet/ea/08/0e17/ea080e1716288bf6cfa60163d883f209.pdf
Look at the absolute maximum ratings otherwise what you plan should be OK but it is usual to have a current limiting resistor on the gate (say 200 Ohms) to protect the MCU pin.
It will work, but I would consider placing the pull-up resistor on the processor port and then adding a resistor in series with the MOSFET gate, as suggested by @6v6gt.
With the pull-up connected directly to the gate, it forms a voltage divider with the series resistor, reducing the gate-drive voltage. At 3.3 V you do not have much gate-drive voltage to spare, so this can become critical depending on the MOSFET you choose.
I am assuming the processor remains powered. If the processor is turned off, you need to consider what happens to the gate, as that condition could turn your IMU on.
Tiny mosfets like that have a low gate charge.
Meaning you can omit the 220 Ohm gate series resistor.
What you also need to consider is the data lines of the IMU.
They can still phantom-power the IMU.
Will the IMU have to be restarted (reinitialized) after turning back on?
Gosh darn, I don't really get when do I need a gate series resistor and when do I not, nor do I know what kind of values should I give to the resistor. I am using a XIAO nrf52840 board as my microcontroller if anyone is wondering. Can you all please help me
, I've added the pull-up on the microcontroller pin instead of at the gate, as per @gilshultz , and then used a 100 ohm series resistor because thats what I have lying around. Also what is it about the whole "if the processor is turned off my condition will turn my IMU on"? Doesn't that pull-up prevent it from turning on?
edit: side note here, the 3V3 is supplied by the microcontroller itself, so theoretically if the microcontroller turns off 3V3 will also be gone as well, so there should not be any conflicts here right?
edit 2: I forgot to address the phantom power part, my solution is to also tie the address lines to SENSOR_PWR as well, and keep the data lines pulled low by default on the microcontroller side when the power to the IMU is off
edit 3: I am thinking of using this on a passive buzzer as well, is that necessary? I don't believe that the GPIOs on the XIAO nRF52840 can handle the current that the buzzers need to drive them directly, do I need more special circuitry or anything I need to look out for if i do this?
These opinions appear from time to time especially if you present a schematic which doesn't show a current limiting resistor in a mosfet gate circuit. Here for example:
How do you know this?
Is 100 ohms too small for a gate resistor?
to answer how do I "know" about the buzzer thing: Its because YOUNGER ME (from 10 minutes ago) didn't know that there are 2 types of passive buzzers, one electromagnetic and the other piezoelectric, and electromagnetic ones gobble current up MUCH MORE than piezoelectric ones. now the OLDER ME (right now, less stupid) realized this mistake and sought out for a buzzer with a cool MAX 5 mA current rating, but I still wanna drive this buzzer through the MOSFET as I want to potentially drive the buzzer even while in standard drive mode (standard drive current for the nrf52840, according to this: https://docs.nordicsemi.com/api/khub/maps/de~7rocmcN70bRHnA4~zJA/attachments/E732R5Ad4Sh6oiV1o_OaJg-de~7rocmcN70bRHnA4~zJA/content?Ft-Calling-App=ft%2Fturnkey-portal&Ft-Calling-App-Version=5.3.49#page=370&zoom=180,-52,362)
Now for the question: "is 100 ohms too small for a gate resistor?" . It kinda looks like it, since standard drive mode while outputting VDD (3.3V) is 0.5mA (source:https://docs.nordicsemi.com/api/khub/maps/de~7rocmcN70bRHnA4~zJA/attachments/E732R5Ad4Sh6oiV1o_OaJg-de~7rocmcN70bRHnA4~zJA/content?Ft-Calling-App=ft%2Fturnkey-portal&Ft-Calling-App-Version=5.3.49#page=370&zoom=180,-52,361), and 100 ohms just seems not enough, I dont know what value i should bump it up to since the MOSFET discharge is only instantaneous and probably will be fine with something a little bit higher, but something tells me it can't be 100 ohms.
Then there is another problem: the switching speed
I wanna drive this passive buzzer with PWM, but if i current limit the gate resistor to much, from my understanding, this reduces the switching speed, and I might not be able to do PWM correctly
so, what do i do now :(
The output current specification are IOH and IOL and the minimum for standard drive is 1mA.
Nordic does not provide absolute specifications for currents but they do give max values for the currents which is 4mA, so you have no choice but to use those values.
For the gate resistor 3.3/4mA = 825
RE: Switching speed.
The total gate charge for your MOSFET is Qg = 4nC.
Q=CxV
So the equivalent capacitor you need to charge is Q/V = 4nC/3.3V = 1.2nF
The time constant with an 820Ω resistor is τ = 820 x 1.2nF = 984ns
5 x τ ~ 5us, so PWM at 1kHz is no problem
quick question, why multiply by 5?
1 Time Constant (1τ):63.2% charged / 36.8% remaining
2 Time Constants (2τ): 86.5% charged / 13.5% remaining
3 Time Constants (3τ): 95.0% charged / 5.0% remaining
4 Time Constants (4τ): 98.2% charged / 1.8% remaining
5 Time Constants (5τ): 99.3% charged (considered fully charged or discharged)
Not necessarily. The processor has ESD/protection diodes on its I/O pins. If the processor VCC is removed while the pull-up remains powered, current can flow through those protection diodes into the processor's VCC rail. That can pull the I/O pin low enough to turn the MOSFET on.
That is why you need to consider what happens when the processor itself is unpowered, not just its normal powered state.

