Thought I'd sent this many hours ago. Still in drafts Sending ... > Hello all, I'm part of the design team for a high-volume consumer > product that needs to run for several months on a single li-ion battery. Can I play too? :-) > =A0As such, identifying quiescent current 'leaks' ... 400 mA charge suggests 400 mAh battery capacity. maybe >=3D 200 mAh. Several months ~=3D 2000 hours. 200 mAh / 2000 hours =3D 100 uA mean draw. So a sleep current of 50 uA is probably a significant contributor to battery capacity drain and an increase of say 10 uA in sleep current would have a noticeable effect on battery life. ie X% sleep current increase --> ~~~ =3D X/2% battery life decrease Or 1:1 for a 400 mAh battery. _________ > and checking that the > battery supplier is delivering batteries that meet specs is important. For "battery meet specs" tests you may want to find an off the shelf cycle tester. Roll your own is not hard, but buying is even easier :-). > I'd like to measure current into and out of the battery, the range is up > to 400mA going in when charging, > and out of will be brief pulses of > 150mA when doing RF transmit and down to 50uA when in a sleep state. > > I'd also like to measure battery voltage to check the charge/discharge > curves under different operational scenarios. > > So off the cuff, I'd say a 10 ohm sense resistor, ideally high-side but > low-side is ok, with differential connection to an amplifier that feeds > the A/D. 10R sense: 50 uA - 500 uV 150 mA - 1.5V ! 400 mA - 4V !!! If charging is from an external charger you may find that OK. If it's the charger which is part of the product that is of course unaccept= able. A 0R1 gives 40 mV / 15 mV charge/TX whic is liable to be acceptable on TX and may not be on charge depending where you put the sense resistor. ie if the LiIon battery voltage is decreased by 40 mV on charge you are significantly altering the end point and thus capacity achieved for a LiIon cell. A 1R gives 400 mV / 150 mV charge / TX. As above for charge but much much more so, starting to get noticeable for TX as battery reaches endpoint. Probably only significant if absolute max operating duration information is required. If TX is cheap and cheerful as seems likely all should be well. If you can add a suitable filter cap downstream of the sense R then this will probably be very OK. You COULD add a switched sense R to allow measurement of sleep and TX/charge modes BUT the simplest approach would probably be an amplifier with enough gain to match ADC range Say you wanted to resolve to 10 uA in sleep and also accommodate charge. 400 mA/ 10 uA =3D 40,000 =3D~ 16 bits :-(. With 12 bits and ignoring charging you get Sleep resolution =3D 150 mA / 2^12 ~=3D 40 uA. (36.62...) ie A 12 bit ADC that handles 150 mA full scale will resolve about 40 uV per= bit. A 12 bit ADC will have an achieve accuracy 1 to 2 bits worse than this or a measurement granularity in the 100 uA range. ie about twice you sleep current. You'd see gross problems with sleep current only. ___ A dual amplifier of auto range switched amplifier (easier than switching sense R) gives you what you want [tm]. Say 5V max ADC in. I'll ignore charging for now as that adds need for bipolar ADC or offset and ... . Charge can probably be handles easily enough separately, or add bipolar handling once basic need is sorted. . 0R1 sense. TX 150 mA =3D 15 mV. Sleep 50 uA =3D 5 uV 1R sense TX 150 mA =3D 150 mV Sleep 50 uA =3D 50 uV. Assume TX is not TOO fussy and that large filter cap will help. Note that filter cap downstream of Rsense will slug response that ADC sees and hide possible real world problems. Go with 1R sense. Say Vadc max =3D 5V (alter ratios as desired) Say 10 effective bits. Gain for TX =3D 5V/150 mV =3D~ 33.333 ADC resolves 150 mA/2^10 =3D~ 150 uA steps Say sleep resolution required =3D 10 uA steps. Say 10 effective bits. Vsense max =3D 10 uA x 2^10 ~=3D 10.25 mV. Gain for sleep =3D 5V/10.25 mV ~=3D 500 (487.8...). Instrumentation amp switched when Vin > ~=3D 10 mV OR dual instrumentation amps. Dual amps is by far the easiest. One for TX one for sleep. TX amp can be offset to allow bipolar measurement for Charging if desired. Easiest of all: 3 instrumentation amplifiers, one each for Charge, TX, sleep. Input polarity of charge amp swapped compared to other two. 3 x 10 bit ADC inputs. BUT if stated sampling rate is not needed, and unless very badly behaved indeed it shouldn't be, then a single slower eg Sigma Delta with 16 bit+ resolution would handle everything with one input. _____ The following is a very cheap quick easy method that does NOT meet stated needs but which would allow a very useful, trivially easily set up scoping measurement system to be implemented for <$100. A very cheap and easy but slow sampling time way of monitoring all the above is to use a COTS multimeter with serial output on 200 mV range with 10 uV resolution. Serial out to RS232/USB converter and you can resolve 10 uV to USB for probably $50 - $100. Note that resolution <> accuracy. YMMV. Sampling rate will be slowwwwwwwwwwwwwww. ie you will miss short term events. However, if you use suitably chosen filter capacitors you will catch the effects of significant variations from what is expected. eh if sleep is 50 uA but occasionally flicks to 100 uA 1% of the time you see < 51 uA and will probably miss it. If it flicks to 100 uA 10% of the time, average is now 55 uA and it will be spotted. etc. Russell McMahon --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .