0
\$\begingroup\$

I've been working on a hobby project and recently got help from this community on input power source switching.

I'm supplying my AVR based PCB with USB or LiPo battery power (with an MCP73831 based charging circuit). The MIC2877 boost converter has a "Bidirectional True Load Disconnect" feature when the EN pin is pulled to ground. I was hoping to disconnect the load from V_BATT when USB power is provided.

I'm trying to eliminate nearly all current draw from V_BATT because as I understand it, if there's load present on the V_BATT line during charging it could prevent the battery from charging fully.

The current solution I have is to disable the boost converter with a high-side P-channel MOSFET, but I have no idea how to select an adequate MOSFET nor how to select appropriate resistors.

enter image description here

As of now, I'm considering a BSS84 because it's cheap, readily available, there's an Eagle symbol for it, and the datasheet says it's logic level compatible. The EN pin pulls 1.5 uA. The BSS84 has an Rds(on) of roughly 8.5 ohms at Vgs = -3.0V near that current.

enter image description here

I don't have any reason to believe that's acceptable, but it felt kind of reasonable. Is this an adequate MOSFET for this purpose?

I put a 2.2 KOhm resistor on the gate of the MOSFET to reduce the inrush current drawn by the capacitance of the MOSFET, but this resistor selection was somewhat arbitrary. Do I need R14? If so, how do I select a resistance for this application?

I added R12 because I assumed something was going to need to pull the gate to ground when V_USB was disconnected. I'm not really sure why I felt that way, but I assumed that if the transistor has capacitance then there must be a need for electrons to escape once the current source was removed so I stuck it on there. Is R12 necessary? How do you pick the right resistance for it?

Finally, I added R13 believing that when Q2 was switched off, a pulldown resistor would be necessary so the EN pin wasn't "floating?" Do I need R13? How do you pick a resistance for that resistor?

\$\endgroup\$
4
  • 1
    \$\begingroup\$ simpler to use an optocoupler to pull EN to GND, then you don't have to pull anything any way; p-chans need extra components to work, an opto is plug and play. \$\endgroup\$
    – dandavis
    Commented Jan 29, 2022 at 9:37
  • \$\begingroup\$ @dandavis oh! I never think of those! Do they have optocouplers that turn off when current is applied? Like, an inverted one? That way I could switch it on the high side and stop current from flowing from V_BATT when USB is connected? \$\endgroup\$
    – D. Patrick
    Commented Jan 29, 2022 at 10:25
  • \$\begingroup\$ they don't handle a lot of current, but they can simplify high/low side transistor peculiarities. IF vusb > vbatt, why not just put a diode from the battery to the boost? That way when usb is plugged in, (almost) no current will flow from the battery. With the right schotkey, you could probably only have to drop 0.5v through the diode at a few amps. \$\endgroup\$
    – dandavis
    Commented Jan 29, 2022 at 11:31
  • \$\begingroup\$ @dandavis oh that's a pretty good idea. Originally V_BATT was tied to both EN and VIN so the diode isolation worked in theory but the capacitance was an issue for USB so I've been rearranging. My goal is to disable to boost converter to disconnect the load from the battery while it is charging. \$\endgroup\$
    – D. Patrick
    Commented Jan 29, 2022 at 13:26

1 Answer 1

2
\$\begingroup\$

First of all, I personally would have opted to use an N-channel MOSFET to ground instead of P channel to V_BATT for this. Both ways do work, but N channel seems to be the most common way of doing it. Possibly because N channel MOSFET's are more readily available and generally cheaper.

But if you want to use P-channel, that transistor will likely work just fine. The Rds(on) is not a problem, as there will be only a few µA through the transistor.

Anyhow, regarding the specific questions; R14 is not absolutely necessary, but adding a series resistor like this is good-practice to limit the inrush current. Also it can be valuable during troubleshooting etc. The resistance of this resistor is very non-critical, it can be pretty much anything from 0 Ω to several kΩ. Too high value and the transistor will start getting slow to turn off and possibly noise sensitive. Too low value and the resistor becomes unnecessary. Somewhere in between that is good. I typically use something between 1-10 kΩ.

R12 is necessary in some form. You must make sure the gate is pulled low and not floating. Although, depending on what else is connected to V_USB it might be unnecessary, if there is some other load on the line. Also when adding a pull-down like that, I prefer connecting it before the series resistor so you don't create a voltage divider. With the resistor values you have there that won't be an issue though.

Choosing the resistance is similar to the series resistor, very non-critical. Too low value and you waste power, too high value and it can become noise-sensitive (some noise coupled into the signal could turn on the MOSFET) and the transistor can get slow to turn on. 1 MΩ is on the high-side I'd say, try going under 100 kΩ at least. If you don't have to save every µA you can, it's better to go a little too low than too high, and since it is on the V_USB rail power consumption shouldn't be an issue (5 or 50 µA...).

R13 is needed in just the same way as R12, with the same reasoning regarding its value.

\$\endgroup\$
1
  • \$\begingroup\$ Wonderful answer! Thanks! I was going to go with an N-channel, but V_BATT is on the output of a MCP73831 charge controller and I was worried that a low side switch would prevent the charge controller from thinking the battery is fully charged. \$\endgroup\$
    – D. Patrick
    Commented Jan 28, 2022 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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