0
\$\begingroup\$

I want to use a MOSFET as a switch driven by my micro controller unit. Schematic

The idea of the schematic is to enable on/off power ability to a load ("R_LOAD") of 150Ohm. The MCU_PIN is set HIGH which flows current to GND through an NPN transistor. This pulls the gate of the P_Channel MOSFET LOW, which connects the source to drain providing power to the load.

I have assembled this circuit as shown with an STM32L151 to control the MCU_Pin, NPN Transistor, and a P_Channel MOSFET. The circuit is powered by a 3.3v power supply capable of 150mA continuous.

However the circuit crashes the MCU on the moment MCU_PIN is set High. I believe the problem arises from this circuit because bi-passing the two transistors and making a connection from +3.3V directly to the R_Load does not crash the MCU, and there is no short from MCU_PIN to any other line.

  • Did I choose parts that are not well suited for this use case?
  • What about the circuit is causing the MCU to crash?
\$\endgroup\$
7
  • \$\begingroup\$ That schematic makes my brain hurt. But, what decoupling did you use? \$\endgroup\$
    – user16324
    Apr 9, 2020 at 19:53
  • \$\begingroup\$ Do us a favour. flip the entire right leg of your circuit upside down to match convention. Why would you draw it that way? \$\endgroup\$
    – DKNguyen
    Apr 9, 2020 at 19:54
  • \$\begingroup\$ Sorry for the hurt brains, Drawn that way to work around the orientation of the MOSFET symbol. Will fix. \$\endgroup\$ Apr 9, 2020 at 19:58
  • \$\begingroup\$ Don't be afraid to rotate or mirror symbols whichever way is required to make schematics consistent and readable. What is your R_Load and what is your power supply? \$\endgroup\$
    – DKNguyen
    Apr 9, 2020 at 19:59
  • 1
    \$\begingroup\$ You parts selection and schematic seem fine so the circuit is doing something extra that has not been accounted for which is affecting the rest of the circuit. What is your Rload and power supply? Try this...remove R16 to disconnect the NPN from the MCU, and apply 3.3V through a 2.2K resistor. Does the MCU still crash? \$\endgroup\$
    – DKNguyen
    Apr 9, 2020 at 20:15

2 Answers 2

1
\$\begingroup\$

There is no current limiting of the 2N3904 collector current other than transistor hFE, which might result in >100mA briefly, however if you have a ceramic bypass capacitor near the transistors of at least 100nF (better 1uF) and reasonable layout that should not cause the MCU to reset.

Of course if your 150 ohm load is actually something with capacitance, such as a module with internal supply bypassing, that would easily explain the problem as that MOSFET is quite capable of conducting more than 10A.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Adding an extra 10uF capacitor solved the Brown out. The capacitor was added on the +3.3V side, near the two transistors. Thank you. \$\endgroup\$ Apr 10, 2020 at 17:30
1
\$\begingroup\$

There's nothing inherently wrong with your schematic. I would omit the NPN however and just invert the sense of the MCU output (you can do that because your MCU can swing to 3.3V and can fully turn the FET off.)

You could have a current loop through your board that's dragging down your 3.3V. Try wiring the FET source directly to a separate power supply to see if that's the case. If so, review your power supply design and layout carefully, and try to separate the high-current paths from the MCU rails.

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.