0
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ 0.4 microamps would take nearly 70 years to drain a single CR2032 button cell. Just how small is the battery you're running this off? \$\endgroup\$ Apr 13 '15 at 13:39
  • \$\begingroup\$ On the same subject, since the PIC controller is powered by the very same battery: take its current consumption from the datasheet and use 1/100 to 1/1000 of that current as a target current in your divider. In the worst case (USB host running all the time and consuming 0 power) you will only reduce your battery life by 1% to 0.1% \$\endgroup\$ Apr 13 '15 at 13:46
  • 1
    \$\begingroup\$ @DmitryGrigoryev: But 1/1000 of 1.5mA drawn current at 16 MHz is very small too (1.5µA). In low power slow clock mode (32 KHz) it even requires only 30µA. But you a right if you say as long as VBUS is powered the current drawn by the divider is negligible. If VBUS is not powered (host is off), it means no current is drawn, that is what I actually want. \$\endgroup\$
    – bkausbk
    Apr 13 '15 at 14:00
1
\$\begingroup\$

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.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Both the microcontroller as well as the USB host is powered by a battery. However the micro controller should be independend of the VBUS voltage. My intention was to keep the energy consumption of the whole system As low as possible. \$\endgroup\$
    – bkausbk
    Apr 13 '15 at 13:34
  • \$\begingroup\$ Your divider will only consume when the USB host is powered. Do you know a typical consumption of your host in idle state? I'm guessing tens of milliamperes. My advice is to save yourself the trouble and use lower resistance values. With megaohm values your divider may stop working with just one touch of a greasy finger. \$\endgroup\$ Apr 13 '15 at 13:38
  • \$\begingroup\$ This sound reasonable. Typical power consumption of the entire micro controller it self (I guess including USB) is 1.5 mA (3V) at 16 MHz concerning datasheet. The host system that provides that VBUS voltage of course draws by far more current like 0.3A at 15V. \$\endgroup\$
    – bkausbk
    Apr 13 '15 at 13:44
1
\$\begingroup\$

With resistances this high, many parasitics become concerning. You've highlighted one, input leakage current, but another is any dirt, flux residue, oils etc on the PCB, which can have resistances in the tens of megohms range, or even much lower if it's wet.

0.4 microamps is not a lot, even compared to the MCU's idle power consumption. You can probably stand to make this significantly less stiff and still consume minimal current, while having to worry less about the cleanliness of your PCB and other parasitics than you otherwise would.

Regardless of these concerns, the power drawn by the divider is drawn from the VBUS supply, not from your device's power supply - so power consumption should not be so pressing a concern here.

\$\endgroup\$
3
  • \$\begingroup\$ Hello Nick, no the device is not USB bus powered. VBUS is only used for detection that the USB host is working. \$\endgroup\$
    – bkausbk
    Apr 13 '15 at 13:30
  • \$\begingroup\$ @bkausbk Even if it's not, the power consumed by the resistor divider will be drawn from the USB supply, not from your device's power supply. \$\endgroup\$ Apr 13 '15 at 13:32
  • \$\begingroup\$ 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. If the micro controller only requires 25µA/MHz, drawing some µA in resistor divider is pretty much in this case. \$\endgroup\$
    – bkausbk
    Apr 13 '15 at 13:39

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.