Using a Window Comparator...

Hi guys and gals,

I am considering the use of a dual comparator like the TS9002 (which is similar to the MAX923 but costs hobbyists 5x less) to help me with a LiPo backup battery backpack I'm thinking of developing. I have no experience with either of these chips and so I wonder if anyone else has used them in a similar capacity. The TSM9002 has two schmitt-trigger comparators and a voltage reference with which one can set hysteresis.

The overarching idea behind all this is keeping it simple. I know there are really cool solutions out there (I like the LTC4081 in particular) which will do a better job of extracting any and all power, optimize efficiency, etc. but at the expense of simplicity, $$$, and the potential for EMI. Moreover, this rig is supposed to keep the MCU running for only short bits at a time, no more than a minute @ 200mA or so.

Anyhow, the proposed power circuit consists of a wall-wart that puts out 5V nominal which is fed through a polyfuse and a Schottky diode to feed the main Bus. A trio of 3.3V LDO voltage regulators with dropout voltages ranging from 220mV to 150mV then turn that main bus power into well-regulated 3.3V power for my sensors and the main MCU. Thus, the main bus voltage should be about 4.7V-5V, as long as the wall-wart is running as usual. The backup battery (a single cell 100mAh Lipo, 3.7V nominal) is charged from the wall-wart using a separate power connection with a MCP7381T trickle charger.

I'd be using the window comparator to detect whether an external power supply has been disconnected (i.e. VPowerSupply drops below 3.9V) and if the Lipo battery still has enough potential (i.e. VBattery>3.6V). Next, I am considering using a NAND gate combined with a P-Channel MOSFET since I'm switching on the 'high' side of the circuit to connect and disconnect the battery from the main bus. Once the external power supply jumps over 3.9V, the battery would get disconnected from the bus and the MCP7381T charger can refill it. Similarly, if the battery voltage drops below 3.6V, it's lights-out to protect the battery pack.

The window comparator circuit would be very similar to the example given in the TS9002 and MAX923 datasheets except that instead of using a series of three resistors to detect over and under-voltage on a single supply I'd be querying the status of two separate power supplies using four resistors altogether. Conceptually, does it seem like I am on the right track?

A window comparator is for determining whether some voltage, a test voltage, is both greater than one threshold and less than another threshold - that it fits within some range (or in the window.)
You have described an application for monitoring two different voltages, one for presence (> some level) of an external supply and another for a battery's level.
That points more toward two comparators, each satisfying some threshold setting.
You need a good reference to compare against.
Any thoughts?

Attached is a board with a P-Channel MOSFET since I'm trying to switch the high side. The board is proposed to use a 74AHC1G00 NAND gate, along with a AO3415 P-channel MOSFET to switch the high side.

The comparator chip contains a reference and I'd like to think that two measurements on a separate set of chips would be OK. That is, if INA+ exceeds 1.182V + VHB, the OUTA pin will toggle positive, just as if INB- drops below 1.182V - VHB that the OUTB pin will toggle positive. VHB has been set to 1%, i.e. 0.006V. Then, if both OUTA and OUTB are positive, the NAND gate will sink the current from the MOSFET and connect VBATT to VBUS.

That is, if I got it right? Do the pullups and the current limiting resistors look OK?

Hmmm... am also considering the use of a dual transistor chip instead of a NAND gate chip. That is, use a dual transistor chip like the MBT3904 series from On semiconductor and then connect them up to make a NAND gate as shown on this page.

Adds an additional external resistor (unless you buy a pre-biased version) but looks more like the other solutions published here for P-Channel MOSFETs (i.e. a transistor to toggle the gate voltage of the MOSFET). Any comment on which solution may be better? The price is about the same and board space is not an issue.