I need to have an LED turning on when there's current flowing through a device. Consider an electronic gadget, e.g. an MP3 player and its battery. This MP3 player draws approx. 25 mA in standby but hundreds of mA during operation. The LED (and its circuit) will be installed between the battery and the gadget and I'd like it to turn on whenever the gadget is not in standby, i.e. the current is above a certain threshold (let's say 50mA)
Some of the specifics are:
Battery: 3.7V to 4.2V, depending on charge
Standby current: approx. 25mA
Operation current: 75mA to 400mA
Desired LED current: 10mA (Vf = 2.8 to 3.0V)
Look at a Zetex (Diodes, Inc) ZXCT1020 high-side current monitor or its cousins. The Iout pin could drive the LED directly. If you use two of them back-to-back, you could drive a Red LED during discharge, and a Green LED during charge. This lets you do it with ~25mV dropped across a low-value series resistor.
Thanks, Mike. That "zetex" seems to be just what I was looking for, plus it comes in a small SOT-23 package, too. However, my current knowledge does not allow for putting together a working circuit. Can you please recommend some values for the extra parts, something to match the parameters and desired results I described in my first post?
well for starters the mp3 player in standby should draw next to nothing, not 25mA. it should only draw that much when connected to a USB port, that would not happen to be how you get the measurement would it?
what you are looking for is a comparator not a sense amplifier. https://www.electro-tech-online.com/custompdfs/2010/08/LMV7271.pdf would work ... using your battery voltage divided by 100 for a reference you get a sense voltage of around 40mV with a 25% inaccuracy depending on charge state and other tolerances.
I couldn't make it work with their formula:
Vsense = Vin - Vload
Vout = 0.01 x Vsense x Rout1
So here is a simple comparitor circuit. Any low power comparitor should work.
I'm so sorry, I linked to the wrong datasheet... the diagram I posted was for ZXCT1020 which MikeMl suggested, whereas the link itself was for a ZXCT1009. Anyway, I believe the comparator-based circuit is a better idea (?) for this particular application, since the LED has to be either on or off; not varying in intensity.
So here is a simple comparitor circuit. Any low power comparator should work.
Thank you very much for this. If I determine that I need a higher current threshold, for example 100mA instead of 25mA, how would I calculate the new values?
The voltage is developed across R1 based on the current. E=IR. In the example .4 amps X .1 ohms = .04 volts. This is compared to the reference voltage developed by R2 and R3. I=E/R -- 4.2volts/201000ohms=.00002 amps. So the drop across R3 (the 1K) is E=IR or .0209 volts or the equivilent of .2 amps across R1. Change R2 to vary the threshold. If Isens is higher (more positive) than Ref. the LED will light.
Ok so I went to Digi-Key, then Newark, looking for comparators. There were so many types available that I just had to come back here and ask for help again. Can you recommend a specific model? My only requirement relates to size, i.e. tiny footprint. Of course, a low price tag is always welcome.
I don't dislike it either, plus it's nice that you addressed the charging situation as well. However, just as the link to mouser shows, the only available packages for this quad comparator are DIP-14 and SOIC-14, which are both "huge" for the application. I was wondering how to look for an equivalent IC; what are some parameters I should use in search filters?
You of course have better eyes than I have. I have to look around for the DIP package.
I think this one will be ok. https://www.electro-tech-online.com/custompdfs/2010/08/tlc372.pdf Comparator ICs
You can just look for output current > 10ma, Voltage > 10v Input voltage Vdd-.3 and low power supply current < .5 ma.
Most of the info can be found on the description and maximum ratings.
I built some prototypes on flexible PCB; they fit nicely and work good... in fact, they work too good. That is, the LED lights up instantly as soon as there is some current consumption.
What I didn't realize when doing the initial measurements was that in standby, the phone occasionally draws high currents in very short bursts and these spikes make the LED light up for a fraction of a second or sometimes flicker. Therefore, I need to add something to this circuit that would introduce some kind of delay or otherwise smooth out the results.
I was thinking to connect a capacitor on the comparator's inputs (would it work?), but after some basic calculation I realized I'd need hundreds of µF and at it's hard to find small parts of such high capacity. What else can I do to obtain a delay with a smaller capacitor? Approx. half-second worth of "buffering" is all I need.
You can change R4 to 100k and add a 10Ufd. ceramic cap from the top of R4 to ground. The cap need only be rated for 6.3 volts so not to large but you won't find it at Radio Shack.