Maker Pro
Maker Pro

Latching power circuit - expert critique please

Hi there, I'm a newbie to electronics design but am doing my best starting out with PIC microcontrollers.

I put together the attached circuit which is a 3.7V lipo battery power circuit to drive a PIC. The circuit has the following features:

- Charging of the 3.7V lipo battery from phone charger
- Momentary switch to turn the circuit on
- Latching of the power by an output from the PIC (LATCH_PWR)
- Hard reset by holding button in for 15secs (provided by Q2, R8/8, C11)
- VUSB is a 5V tolerant digital input to the PIC to determine when the charger is present
- CHARGE_STATUS is an ADC input to the PIC to determine if battery is charging or charged
- D2 prevents PIC output (LATCH_PWR) from interfering with SWITCH_STATE which is a digital 5V tolerant input to the PIC

MicroCircuit.png

I have built the circuit and am happy it all works as planned but like an expert critique. Could I have done better, used less components, are there redundant components or things I overlooked?

Thanks for your interest.

M.
 

KrisBlueNZ

Sadly passed away in 2015
Hi there medic :) Sorry for the slow response. Your circuit looks pretty good. I wouldn't describe you as an electronics newbie!

I have a few comments, most of which are probably just me being paranoid. I'll start with the simple ones.

1. Naming of VIN label

I would call it VBAT or VBATT, since that's what it connects to.

2. Clarify nodes that connect to the PIC

It's obvious from the drawing that the nodes marked CHARGE_STATUS and LATCH_PWR connect to somewhere else on the drawing, but that's not obvious for the SWITCH_STATE node. It's perfectly valid and useful to name a node that's only connected locally. I suggest that you somehow indicate that this node connects elsewhere. Either add an unconnected line, marked with the node name, or perhaps add the text "TO PIC" or give the IC reference and pin number that it connects to.

Now the functional issues.

3. Battery charger IC

I'm not familiar with the MCP73831 battery charge controller that you're using as U2 but I don't see any problems.

4. CHARGE_STATUS signal source resistance

You're feeding the STAT output of the MCP73831 through a voltage divider of two 100k resistors, and into the ADC in the PIC. I understand why you're doing this, but I'm a bit worried that the source resistance of this signal (i.e. the output resistance of the voltage divider) may be too high to get reliable conversions.

In the past, I have had problems getting clean conversions with successive approximation ADCs because of the current pulses they fire back from their input pins. I have had to add smoothing capacitors from the pin to 0V (or AGND) to provide a stable voltage to the pin. Values around 10 nF worked well. Avoid cheap multi-layer ceramics though; they can become leaky. With the capacitor, the actual driving impedance can be quite high. Of course, adding capacitance also slows down the response to changes on that output from the battery charger.

You could also reduce R6 and R7, but you don't want to waste power.

I'm not sure if this will be an issue with your PIC but you might want to test for it by connecting a scope on the analogue input pin while conversions are being performed, or writing test code to see how stable the converted value is.

5. Turn-off circuit: R4 not needed

R4 in the pushbutton circuit shouldn't be needed. The voltage on C11 will never be more than about 0.6V because it's limited by the base-emitter voltage of Q2, so R8 will pull D2 pin 1 to that voltage, and D2 has a forward voltage to overcome.

6. Turn-off circuit: U3 part type and CE pin pulldown

You haven't specified the full part number for U3, the XC6219 LDO regulator. You MUST specify the full part number - some of the characters in the suffix specify parameters that are critical to the circuit's operation.

xc6219 suffix options.png

Characters 2, 3 and 4 obviously depend on your output voltage requirements, and characters 5, 6 and 7 obviously depend on the package you want.

Character 1 selects between the 150 mA version and the 300 mA version (the choice obviously depends on how much current you need to draw from it) and between four options for the CE (chip enable) pin.

You have already chosen devices with an active high CE input, which means letters A, B, E and F. Only the B and F devices are described as "standard"; the others are described as "semi-custom" so it may be wise to avoid those.

If you use a "standard" device - type B (150 mA) or type F (300 mA) - you'll need an external pulldown resistor on the CE, since those types don't have built-in pulldown resistors. You could move R4 over to the CE pin.

Your full part number for U3 would be:
  • XC6219B33txy-G (150 mA)
  • XC6219F33txy-G (300 mA)
where t is "1" for 1% output voltage tolerance or "2" for 2% output voltage tolerance, and xy are the package designation letters.

7. Turn-off circuit: CE voltage threshold and saturation of Q2

To guarantee that the XC6219 will turn OFF, you have to take the CE pin below the maximum VCEL voltage. This voltage is 0.25V as shown on the data sheet:

xc6219 cel voltage.png

(That table applies to types A and B, but that parameter is the same for all types.)

My concern is whether there will be enough base current to saturate Q2 to the point where it will reliably pull the CE pin below the 0.25V threshold.

I'm going to look at the collector current assuming VBAT is 4.0V because that gives the highest current through R3, which is the worst case. Then I'm going to look at the base current assuming VBAT is 3.0V because that is the worst case. This is not really fair because both worst cases can't exist at the same time, but engineering is one place where it's good to be conservative.

I've used LTSpice to test a simulated transistor. You haven't specified the component type for Q2 so I used a BC847B. Here is the test schematic.

269474 simulation schematic.png

The simulation applies a base current that ramps steadily from 0 µA to 10 µA. I graphed the base current IB in blue, the base voltage VB in red (just for interest), and the collector-emitter voltage VC in green. This is the result.

269474 simulation graph.png
This screen shot shows only the bottom part of the graph. The green trace starts at the supply voltage, 3.4V, at the left side of the graph, but we're only interested in the section where VC goes below 0.25V.

You can see the base current rising smoothly to 10 µA over the full 10 ms simulation period. Therefore, the millisecond markers along the X axis correspond directly to microamps of base current. Base voltage is pretty stable at around 0.61V.

The collector voltage doesn't drop below the 0.25V chip enable threshold until the base current has reached slightly over 1 µA, and it doesn't go comfortably below that threshold until the base current is around 2 µA. It seems pretty clear that a BC847B will pull its collector safely below the 0.25V threshold, but this simulation uses a typical BC847B. I don't know how a worst-case BC847B will behave. Or a worst-case of whatever transistor type you decide to use.

Will you get reliable power supply shutdown with 2 µA of base current into Q2? I don't know. At these low currents, leakage currents, that can usually be ignored, can become significant.

It might be better to use an N-channel MOSFET with a low VGS threshold voltage instead of a transistor for Q2. A MOSFET will pull its drain down closer to 0V than a bipolar junction transistor, and it doesn't draw any significant gate current, which is important, because the currents in the C11 circuit are very low (see later).

The FDV301N is widely used, and looks suitable. Here are the gate threshold limits from the data sheet:

fdv301n gate threshold voltage.png

8. Turn-off circuit: leakage in C11.

You need to consider leakage in C11.

When S1 is closed, your R8/R9 circuit is equivalent to a 375k resistor connected to a voltage of half the VIN rail voltage. Let's assume that's at minimum voltage; say 3.0V. So C11 is being charged from a 375k resistor from 1.5V. You need C11 to reach around 0.7~1.1V (assuming you use an FDV301N for Q2) in the power-off button hold time period, currently 15 seconds.

Assuming a worst case VGS(th) of 1.1V, the voltage drop across the theoretical 375k resistor is (1.5V - 1.1V) = 0.4V. Maximum current through a 375k resistor will be about 1.0 µA. Most electrolytics have maximum specified leakage currents much higher than that!

Reducing the feeding resistance and increasing the capacitance may not help, since the worst case leakage current for most electrolytics is specified in proportion to their capacitance! Reducing the power-off button hold time would be an option.
 
Last edited:
Top