1
\$\begingroup\$

I'm working on a circuit where a 12 VDC line is switched from a USB-powered microcontroller (U1, running at 3.3 V, specs below). I want to ensure that the switch defaults to ON if the microcontroller is powered off (i.e. unplugged from USB). The switch I'm using (U2, specs below) can be controlled directly from a GPIO pin. I've come up with two possible methods of doing this; are there any issues with either approach?

Option 1: Simple pull-up
Use a 300k Ω pull-up (R1) to 12 V on the Enable line; this will ensure that the signal is ON if the microcontroller's pin is high-Z. An additional 100k Ω resistor (R2) connects to ground; this ensures that the enable line is at 3 V when the microcontroller pin is high-Z (this protects the microcontroller from over-voltage). The resistor values are high enough that I think there should be no issues with the microcontroller driving the line high or low. There's no ESD diode to VDD on the microcontroller (only to ground) so I'm not concerned about back-powering it. This is my preferred solution.

Option 2: Switched pull-down
The switch's enable pin is pulled high via a 100k Ω resistor (R3) connected to the 12 V rail. An N-channel MOSFET (M1) connected between the enable line and ground can be switched on by the microcontroller to turn the power switch off. An additional 100k Ω resistor (R4) to ground on the MOSFET's gate ensures that it's off when the microcontroller isn't powered. For board-space reasons I'd rather not take this approach.

Do either of these approaches seem reasonable or is there a better way to do this? Is there anything I've missed?

schematic

simulate this circuit – Schematic created using CircuitLab

U1: TPS22810 Power switch (datasheet)
Switch is turned on or off via the EN pin:
VEN 0 V .. 18 V, threshold = ~1.0 V (low=off, high=on)

U2: Teensy 3.1 (MK20DX256VLH7 microcontroller, datasheet, schematic)
GPIO pin specs:
VDIO -0.3 V .. 5.5 V (input voltage range)
ID -25 mA .. 25 mA (maximum sink/source current)
VOL maximum 0.5 V (Low output voltage)
VOH minimum 2.8 V (High output voltage)
GPIO pins default to input (high-Z)
From the datasheet (p. 11):

All 5 V tolerant digital I/O pins are internally clamped to VSS through a ESD protection diode. There is no diode connection to VDD.

M1: 2B7002 N-channel MOSFET (datasheet)
VGSth 1.1 V .. 2.1 V (gate-source threshold voltage)

\$\endgroup\$
  • \$\begingroup\$ " Is there anything I've missed?" Yes everything necessary for good design/verification specs on inputs and outputs for a simple inverting logic controlled power switch. Like the datasheet, your design specs must be detailed. Not your choices with no specs \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 May 12 at 14:45
  • 1
    \$\begingroup\$ With option 1 you're likely to have current 'leaking' in thru the micro's GPIO pin which might be enough to intermittently power the micro. Go with option 2. \$\endgroup\$ – brhans May 12 at 14:48
  • \$\begingroup\$ @brhans The MK20 only has protection diodes going to ground so I don't think that would be an issue. \$\endgroup\$ – Alex Hajnal May 12 at 14:50
  • \$\begingroup\$ @TonyStewartSunnyskyguyEE75 What specific parameters are you referring to? Also, what do you mean by inverting logic? The switch specs are >1V=On, <1V=Off. \$\endgroup\$ – Alex Hajnal May 12 at 14:55
  • \$\begingroup\$ I am referring to all the requirements . One of which are listed in question. make a list like the datasheets of examples you chose for your requirements. I won’t ask again. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 May 12 at 14:58

Your Answer

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

Browse other questions tagged or ask your own question.