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?
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)