Voltage shift 5V to 3.3V for PIC16LF145x 3.3V I/O input, several approaches

mosfetusbvoltage divider

For USB device detection I need a way to shift that VBUS 5V to 3.3V in order being able to connect it as I/O input pin. The input pin should be high as long as VBUS = 5V, and low as soon as VBUS = 0V. This pin will be configured to generate an interrupt on input change. Only in high state USB functionality will be enabled as specified in USB 2.0 specification.

Low power consumption and low BOM is absolutely important in my case.

A design with a zener diode was rejected due the relative high required minimum zener current.

I decided to use a reistor divider with very high impedance.

schematic

simulate this circuit – Schematic created using CircuitLab

This voltage divider would ideally sink at most 0.4µA current as long as VBUS is 5V. The question is, is it enough for the PIC16LF145x micro controller I/O pin in order to detect a high signal? Theoretically it should since I/O pins are basically MOSFETS. Since there is some design specific capacitance it would take some time I/O pin to become "high", but this delay is no problem. However, there is also an input leakage current (datasheet, parameter no D060) of 5-120 nA. Does it mean, that the current provided into input has to be higher than that leakage current? Can R1, R2 even be higher for even lower constant sink current?

Is a MOSFET design the better approach?

schematic

simulate this circuit

An MOSFET for example this BSS138 also has some constant current in the range of some 100nA to 5µA (Zero Gate Voltage Drain Current, VGS>0V, VDS=0V). For this reason, this circuit is also not to be considered as an ideal solution.

What would you use, is there an even better/simpler solution (in regard to power consumption)?

Edit: Both the microcontroller as well as the USB host is powered by a battery (the same battery). However the micro controller should run independend of the VBUS voltage (USB host can be off, suspended…). My intention was to keep the energy consumption of the whole system as low as possible.

Best Answer

If you want to use resistors, you need the current in your divider to be at least 10 times bigger than input leakage for a reliable operation (1.2uA in your case).

But quite frankly I don't understand the requirement to sink as little current as possible from USB - any device connected to it will probably consume around 100mA if not more, so taking even as much as 0.1mA for device detection doesn't sound unreasonable.