Power Mangement - nightmechanic/WRFL GitHub Wiki
The WRFL power management system
Looking at the power management system I ended up with, I have a feeling it is somewhat over engineered - 5 PM ICs (charger, boost converter and 3 LDOs) seems a lot for a relatively simple board (which has a total of only 6 major power consumers (MCU, Flash, LCD, Bluetooth, pressure sensor and the accelerometer). I think I have good enough justification for each of the LDOs...
- Battery shall be charged from the USB supply (5V)
- MCU requires 3.3V
- Servos (the standard, cheap ones) require 4.8 - 6V
- All other devices (Sensors, LCD and Flash) require 3.3V
- Hibernate current consumption should be minimal - less than 25uA from the battery is a good target. (A 500mAh battery at 10% state of charge (50mAh left) will last about 2000 hours at this mode - almost 3 months before system shutdown)
- Supply 200mA @ 3.3V for future peripherals. Should be shut down during hibernate)
It was clear to me that it will be a lithium-Ion Battery, as I think they are the best value for money these days as well as having a good capacity/weight ratio. The question was the voltage - a single cell (3.6V nominal voltage) or 2 series cells (7.2V).
If you look at the requirements above, you can see that a boost converter is anyway required - either to charge the 2 cell from the USB, or to supply the servos from a single cell battery. In order not to loose too much energy with the 2 cell approach, a step-down switching converter would be required as well...
And so, as 1 switching regulator is better than 2... and from the quick search I made, and from the short search I have made, single cell charger ICs have a better selection than 2 cell ones, the single cell approach was chosen.
500mAh - TBD
- Support USB Charging (100/500mA charge current selection by MCU)
- Support battery temperature monitoring - you can never be too safe with Li-Ion charging
- In a package that can be soldered by hand (a.k.a. "reasonable package")
- Charge status indication (to MCU) - not a must, nice to have.
The selected charger is a Texas Instruments BQ24092 charger IC, that supports all of the above requirements.
As mentioned in the power management requirements above, everything else needs 3.3V, so why not just 1 regulator?
Well, I wanted A generic peripheral supply for peripherals that I do not know what they are yet, and what their sleep/standby current is - So one low quiescent current regulator for the MCU and a high output one for the peripherals. I also wanted to have good noise isolation for the sensors' supply, so I looked at adding chokes/ferrite beads on the power and ground paths, that, however was terrible for the SPI's signals that go between the MCU and the sensors. Due to the fact that the sensors have a single ground for the IO and analog functions, the inductance on the ground paths caused severe "ringing" on the SPI lines at the speeds i wanted to run them (few MHz). It is good that there are free spice simulators!
And so another regulator was born...
Now there were 3:
- MCU - 3.3V low quiescent current ~150mA
- Peripheral - 3.3V 400mA
- Sensor - 3.3V, low noise, >100mA
All regulators should have low dropout voltages (LDOs) as I want to get as much run time as possible out of the battery. All regulators, except the MCU one, need to have an enable signal, so that they can be shut down during hibernation.
- MCU - Texas Instruments, TPS78233 3.3V 150mA, 0.5uA Iq LDO
- Peripheral - Texas Instruments, TPS73633 3.3V 400mA LDO
- Sensors - Texas Instruments, TPS73033 3.3V 200mA, low noise LDO
- input voltage range: 3 - 4.2V
- output voltage: 5.2V
- up to 0.5A load current
- Enable pin
- convenient design guidelines/tools - I did not want to mess this up and wanted to minimize the guess work
Texas Instruments LM2735Y, 520kHz boost regulator
TI also has a very convenient tool called "Webench" that helps select a regulator from given requirements, and suggests regulator's peripheral components (Inductor, Capacitors, diode etc.) considering the device specifications - stability etc. while giving the user possible trade-offs between efficiency, solution size and solution cost.
I did make sure that selected components make sense by going through the design guidelines in the regulator's datasheet.
As you can see all the power management ICs are from Texas Instruments, so, I think this is a good time for a disclaimer:
I worked in TI for several years (nothing to do with any power management devices, other than using some on dev boards, and leaving before this project was even conceptualized) and I am sure it had some impact on my selection process, being familiar with some of the product lines, the web site etc. I did look else where, however, it wasn't exactly what I was looking for, and so, it seems that TI had the best matching portfolio (for this project, and my requirements, of course).
TI does not support this project or me (anymore ;) )in any way, (except for sending some samples, which I am sure all IC manufacturers do) and there is no intention to promote their business etc.
p.s. As this project has no commercial intentions, large quantity prices were not a consideration in the selection process, only the technical requirements and availability (samples or small quantities at distributors).
I have spent some time around this, relatively small, circuit, so I thought it may be worth while to write a short overview.
I have outlined the relevant section in the schematic below:
The reasons for having the power switch are:
- To protect the battery from over discharge.
- Avoiding any unknown circuit state while the battery is discharging below the circuits operational voltage.
The power switch is a 6A P-channel MOSFET [Q2] connected, in series, between the battery's positive node and all the WRFL's regulators inputs, i.e., nothing is supplied when the FET is not conducing.
The OFF state is maintained using R7 to pull up Q2's gate, as well as making sure that Q1 (an N-Channel MOSFET) is not conducting by pulling it's gate low with R6.
WRFL power on is generated from 2 sources:
- Applying a high enough voltage (>4V) on the VBUS node (e.g. connecting the launchpad's USB to a PC), this will also activate the charger. This voltage (divided by R1 and R2) will, through D1, will apply a high enough voltage to Q1's gate, causing it to conduct, creating a low resistance path from Q2's gate to GND, which will cause Q2 to conduct as it's Vgs will be negative enough (-Vbat).
- WRFL "ON" button pressed (The encoder's [SW2] toggle button) for a long enough (TBD) time. While the button is pressed, Q2's gate will be pulled low through the R7, R14 and R15 resistor divider network causing Q2 to conduct.
Once the MCU is up it will assert the "VBAT_EN" node HIGH (using the appropriate GPIO), this will, through D1, cause Q2 to conduct, "latching" the ON state.
Note that "VBAT_EN" needs to be asserted before "PM_ENABLE" (that will turn on VDD_PERIPH), otherwise we might (will) get into some power on-off limbo...
Eventually, if and when the battery voltage is high enough (>3.4V) the MCU will assert "PM_ENABLE", and once VDD_PERIPH is available the encoder's toggle switch may be used as a (active low) user switch for any purpose using (the conducting) Q2 as a low resistance path to GND and R14 as the pull-up.
WRFL power off is controlled by the MCU as it can de-assert the VBET_EN node. (And, you can always unplug the battery...)
Power off may be triggered by the user through the UI or autonomously by the MCU e.g. if the battery voltage is too low.
Note, A high enough VBUS voltage will force the power switch to conduct regardless of the MCU's intentions.
The power on circuit was simulated in spice with the specific MOSFET models to make sure that it is a viable solution.
WRFL by Ran Katz (Nightmechanic) is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at https://github.com/nightmechanic/WRFL.