1
\$\begingroup\$

I am creating a circuit in which a MCU (STM32) must drive 12VDC outputs, and wanted to make sure there wasn't anything missing in my driver circuit for the outputs.

-R1 is the inrush current limiting resistor
-R2 is the pull-down resister to keep the mosfet gate low if the MCU pin floats,
-D1 is the flyback diode, for protection against inductive loads, which will be a use case.

PS: I forgot to change the diode in the circuit, the actual part number is GSD2004W

schematic

simulate this circuit – Schematic created using CircuitLab

The load will be connected to the 12V power line and the ground will be switched via the out pin.

The expected load will be practically anything as long as it is 12V and less than 250mA. But there will definitely be relay coils, indicator lights, and solid state relays attached to the output.

If there is anything I am missing that would be necessary or even a good idea or small improvement to include? I just don't want to spin a board with this and find out something wasn't working as intended, so some assurance would be nice.

\$\endgroup\$
  • 1
    \$\begingroup\$ How would the output go high? Or is it a sort of "only pull down output"? \$\endgroup\$ – Vladimir Cravero Aug 11 '14 at 15:16
  • \$\begingroup\$ Wouldn't it be easier to use a ULN'? \$\endgroup\$ – Ignacio Vazquez-Abrams Aug 11 '14 at 15:16
  • \$\begingroup\$ What is the expected load? A relay coil? \$\endgroup\$ – Spehro Pefhany Aug 11 '14 at 15:16
  • \$\begingroup\$ Ah right, forgot to mention that, this is a low side driver so whatever the device may which is getting switched will be powered off of the 12V line and then this will be connected to the ground. \$\endgroup\$ – Nick Aug 11 '14 at 15:19
  • \$\begingroup\$ The expected load could be a relay coil, a solid state relay, a small motor, indicator lamp, or small resistive load. \$\endgroup\$ – Nick Aug 11 '14 at 15:21
1
\$\begingroup\$

A 2N7002 is a poor choice for an STM32 MCU, since you'll be limited to ~3V output voltage.

I suggest using something like an AO3418, which is inexpensive and guaranteed to have less than 85m\$\Omega\$ Rds(on) with 2.5V drive (at Tj=25°C). That would allow you to safely drive at least 1A with 3.3V drive over a reasonable temperature range, and it will have very low 'on' drop- typically something like 10mV when driving 200mA.

It might be nice to put a series resistor and LED across the load terminals for visual indication of the output state- it will also pull up the output so someone troubleshooting will be able to use a multimeter on voltage range to check the output.

The output as shown has no short-circuit protection, so if a screwdriver or probe slips, the output could be damaged if the 12V supply can supply more than a few amperes. If your 12V line can be limited in current, then that is another reason to make the output a bit beefier, so it can survive a momentary short-circuit.

\$\endgroup\$
  • \$\begingroup\$ Okay I have found a comparable replacement mosfet, a DMN3150L-7 (available from mouser) and see why it would be beneficial to have a pull-up across the output. Would another 100K in parallel with the diode be acceptable? or would 10K be a better value? I dont particularly want the led there for visual indication. Also the diode selected has a reverse recovery time of 50ns, and has a max current of 1A for a second (non-repetetive), so though should be good enough right? \$\endgroup\$ – Nick Aug 11 '14 at 16:06
  • 1
    \$\begingroup\$ @Nick 10K or 20K would be a reasonable value I think (1.2mA, 14mW wasted for 10K). I think that diode is fine for inductive loads up to a at least couple hundred mA, and probably much more. \$\endgroup\$ – Spehro Pefhany Aug 11 '14 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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