Tuesday, 26 March 2019

microcontroller - USB / Battery Switchover Circuit


Background: I am a non-EE (an 0x11? :^) thrust into the world of embedded systems design. I started this project with a only college physics-level understanding of circuits, but I'm gradually learning.


The design I'm working on consists of several sensors, an SD card, and a TI CC1111 SoC. The CC1111 includes an 8051 core, a USB controller, and an RF transceiver. My design is based on a reference USB dongle design provided by TI.


The device will typically operate on battery power, using 2 AA batteries in series (or potentially 4 AA batteries in parallel pairs), unless connected to a USB port. I'd like the device to switch over seamlessly between USB and battery, without a microcontroller reset.


I'm looking for a circuit to switch between the two power sources (batteries or USB bus). From what I can tell the simplest thing would be to use OR-ing diodes. The problem here is that I'd be wasting power (current x forward voltage drop of diode), and that's something I want to avoid.


One option I'm considering is the LTC4412 power controller, recommended in answer to someone else's question.


Question 1: Does this look suitable?


One concern I have is the delay in switching over from USB bus power to battery power when the device is disconnected from USB. According to the LTC4412 datasheet, the turn-on time for the MOSFET gate can be up to 175 us. I don't want the CC1111 (or the digital sensors) to reset. Looking at Figure 1 in the datasheet (see too the discussion of bypass capacitors on page 5), the trick is to properly choose a value for the output capacitor, C_out. I calculated a value, but I'm not sure if my approach is valid. If you'll bear with me:



Figure 1


The CC1111 is normally operating at 3V from 2 AA batteries. Suppose it could operate at only 90% of that (2.7 V). I use the current drawn by the load (my device) and the nominal voltage (3V) to come up with an equivalent resistance (V/I). Based on my measurements and summing currents taken from datasheets, the device can draw a current somewhere between 35 mA and 70 mA. This gives me an equivalent resistance in the range of 43 Ohms to 86 Ohms.


If I want the voltage to drop to no less than 90% after 175 us (the LTC4412 gate turn-on time), then after doing the math I get a time constant (RC) of 1.66 ms. Using 40 Ohms to be safe, I come up with C > (1.66ms/40 Ohms) = 42 uF. Maybe add another 10% or 20% for safety, so say 50 uF.


Question 2: Is that approach and calculation valid?


I pulled that 90% number out of thin air. The CC1111 datasheet says that 3.0 V is the minimum voltage, so I'm not sure what I'm doing is kosher. Should I use some kind of step-up converter to get, say, 3.3V out of the batteries?


Thanks in advance for your help (and for reading so much text).



Answer



No, like you already may have feared this isn't kosher. The 3 V is indeed the minimum, and the AA batteries' voltage will quickly drop below that. If you're using NiMH rechargeables you even get only 2.4 V, so that won't do, unless you can use 3 of them in series. (Don't use batteries in parallel like you mention in your question.) So three NiMH cells will give you 3.6 V. Fine.


That 3.6 V is the maximum VDD for the device, so if you want to run it off USB power you'll need an LDO (Low Drop-Out) voltage regulator to get 3.6 V. The LP2981 is a good part for this.


Now the switching. 175 µs seems like an eternity to me, but we'll have to live with that. Ben gave you already the right equation for a constant current discharge:



\$ \Delta V = \dfrac{I \cdot \Delta t}{C} \$


or


\$ C = \dfrac{I \cdot \Delta t}{\Delta V} \$


NiMH cells have a fairly constant 1.2 V, which only drop to below 1.1 V when they're nearly discharged.


enter image description here


So we can use that as a limit. With a minimum voltage of 3 V and a worst-case current of 70 mA you get


\$ C = \dfrac{70 mA \cdot 175 \mu s}{300 mV} = 41 \mu F \$


which is what Ben also found. If you think you won't go below 1.15 V then that would become 27 µF, so that's not going to change very much, but it gives you some headroom if you want to use a 47 µF cap. AndrejaKo rightly points out that electrolytic capacitors have large tolerances, usually -20 %, and then I would just go for a 68 µF/6.3 V cap.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...