Question about TL431ACLPG shunt regulator diode

In one of the projects I'm working on, I want to have the ability to detect when a battery is getting low on power. I read an article about using two resistors, don't remember exactly how it worked off hand but it looked like it would be a power drain in itself to do it that way.

Since this project is trying to minimize battery usage I don't want any additional unnecessary power drains. Then I saw this on sparfun: SparkFun "Uh-oh" Battery Level Indicator Kit - KIT-11087 - SparkFun Electronics

It uses a TL431ACLPG which from what I can tell acts kind of like a relay and only lets power through when it is under the reference voltage.

So I have a couple questions, one would this create a power bleed off? I'm guessing it will since it still runs the reference to ground, I think? If it does have a power bleed, any idea how much it would be? The datasheet for the TL431ACLPG says it has an operating range of 1 to 100ma, so I'm guessing best case scenario it would still drain 1mA continuously?

Another question I have is attempting to better understand some electrical properties of resistors and such. Why doesn't the trim pot in the spark fun board cause the reference voltage to continually drop as the voltage from the battery drops? It seems like the lower the voltage the battery puts out the lower the voltage that makes it through resistor would be? Like I said this is probably simply me not understanding an electrical trait properly.

I think you could also just monitor the voltage directly using an analog input pin.

CrossRoads:
I think you could also just monitor the voltage directly using an analog input pin.

Pretty sure that is the method I read about using two resistors. I can't find the page now, thought I bookmarked it but must've bookmarked it on my computer at work. But reading another page it's something about using two resistors of a certain ratio as a voltage divider and one goes to an analog pin the other goes to ground. So this does indeed create a constant bleed off in itself. I guess I could do something like this and use a relay or something to turn on the battery check circuit only when I'm actually checking it to prevent the power drain?

Is there anything like a relay but really cheap and easy to add to a circuit and control the state of with a single pin?

How much power do you consider a drain? any voltage divider or reference diode like the TIL431 requires power. The TIL431 is an adjustable Zener diode and does require 400 uA as a minimum cathode current for proper operation.
It and a pnp transistor could make a switch for flagging when the voltage to the device was above a "Set Point" but it would require about 1 mA for proper operation when used to measure the primary power source and there's a way with 2 transistors to enable the device that isn't very complicated and draws no current until enabled.
3 transistors 2 pnp's and an npn and about 4 or 5 resistors total maybe a .1uF cap on the '431 for stability as there is a LOT of current gain in that device.
About 100 uA to control up to 100 mA of Zener current through the diode.

Doc

Docedison:
How much power do you consider a drain? any voltage divider or reference diode like the TIL431 requires power. The TIL431 is an adjustable Zener diode and does require 400 uA as a minimum cathode current for proper operation.
It and a pnp transistor could make a switch for flagging when the voltage to the device was above a "Set Point" but it would require about 1 mA for proper operation when used to measure the primary power source and there's a way with 2 transistors to enable the device that isn't very complicated and draws no current until enabled.
3 transistors 2 pnp's and an npn and about 4 or 5 resistors total maybe a .1uF cap on the '431 for stability as there is a LOT of current gain in that device.
About 100 uA to control up to 100 mA of Zener current through the diode.

Doc

My goal for the project is for normal power drain to be as low as possible. Most of the time the atmega328p and the nrf24L01 that is part of the project will be asleep. Unless an interrupt wakes them up to transmit data. What I'd like to have happen is during this transmission it check the battery level and transmit that as well. Right now my total power drain while in sleep mode is 1 to 2 uA. When it's awake and transmitting it's at around 16mA for about 3 tenths of a second. So 1mA of continuous drain is definitely to much. I might be ok with 10 uA of continuous drain but don't want to go much beyond that.

Like I said, I can use the resistor divider method if I can put in something like a relay to enable / disable that part of the circuit so that it doesn't drain power when I'm not measuring it. Most relays that I've seen are to big though, plus they can be somewhat expensive for a single component in a low cost unit. I read something about using a MOSFET switch for something like this but there are apparently a lot of different kinds of mosfet switches and not sure which one would do what I need.

I tried to point out a simple method to measure the battery, flag it's output and be a 0 drain load until enabled circuit. I can provide a schematic If you are interested. This isn't rocket science at all just an "Open Collector NPN switch that pulls a little current from the base of a PNP to turn it on and send power to another PNP and a resistor or two and the TIL431 If the 431 is turned on enough (the battery is high enough to turn the TIL431 on then the last PNP's collector goes high and you have a "Good Battery Flag". Test for it and then set the controlling port pin low to turn off the Batt Test enable. later today I will install Fritzing or something close and create a schematic for you. If I can find it I will try to simulate it in MultiSim 11. This is in order to verify something I have used many times in the past. As I remember there is a MAX666 or something close that can give you a linear low current regulator and a low battery flag... all for 10 uA overhead... less than the current required by the Arduino linear too. Interested?..

Doc

Docedison:
I tried to point out a simple method to measure the battery, flag it's output and be a 0 drain load until enabled circuit. I can provide a schematic If you are interested. This isn't rocket science at all just an "Open Collector NPN switch that pulls a little current from the base of a PNP to turn it on and send power to another PNP and a resistor or two and the TIL431 If the 431 is turned on enough (the battery is high enough to turn the TIL431 on then the last PNP's collector goes high and you have a "Good Battery Flag". Test for it and then set the controlling port pin low to turn off the Batt Test enable. later today I will install Fritzing or something close and create a schematic for you. If I can find it I will try to simulate it in MultiSim 11. This is in order to verify something I have used many times in the past. As I remember there is a MAX666 or something close that can give you a linear low current regulator and a low battery flag... all for 10 uA overhead... less than the current required by the Arduino linear too. Interested?..

Doc

Interested, sure but it all depends on exactly what is required. Sorry I'm not an Electronics Engineer, still learning and I don't know half of what you just said. It sounds like it takes quite a few parts to make it work though. That is another thing that I have to take into consideration. The devices I'm making are very small (20mm wide, 50mm long). I can increase the size some but I don't want to increase it to much because these are meant to be small inconspicuous objects. I will also be doing the circuit boards myself using the print toner method, so it can't be extremely crowded on the board with very tiny traces. I've got enough room to probably add a couple resistors and maybe a couple of other small components, but not a lot.

Also, if I could get a method working that will tell me the battery power remaining at any power level and not just when it's already low that would be preferred. That is why I was leaning more toward the two resistor method if I could get some kind of activator enabled for it (be it a relay or something else). Using it I could read battery power from 100% until to low to power the device.

And then of course there is cost consideration. Right now each device is costing me about 8 dollars when all is said and done. I'd like to stay under 10 dollars per device, but the cheaper the better.

It is a simple circuit that can be controlled for zero current drain and using a little trick with a PNP transistor sense when the battery voltage is above a certain point and I thought I could see a way to do it simply but some what inexpensively with about 5 parts with the same accuracy as the A/D... The point about the regulator was more rhetorical than anything else because I thought You had overlooked the 5V reg quiescent current and how much it can ramp up at higher input voltages and be overlooked as one of those "Page Three" things, I've been bit by that one a time or two in the past and I learned to read all the data sheets of the design proposed devices first before I began assembling them as an entity or better before I created the first approximation of a design as a schematic proposal for consideration as required. That's All.

Doc

Doc

Well that sounds fine, like I said I'm interested in seeing a schematic for it to try and better understand it, but I also just had this thought that may require only a single resistor. It hinges on two questions though that I can't find the answer to.

First, what is the default AREF voltage for a stand alone atmega328p. Is it the internal 1.1 volts as stated here: analogReference() - Arduino Reference ? Just as a side note I've got my ATMega328p set to brown out at 1.8 volts, right now mainly because the nrf24L01 needs 1.9 volts minimum to operate correctly anyway. Don't know if that makes a difference or not.

Second, the voltage on a digital pin set to high is equal to the power supply voltage isn't it? Since I'm dealing with less than 5v and not using a regulator.

The battery I'm using is most likely going to be a 3v coin cell. If it is the 1.1v internal aref, could I not put a ~367k resistor between a digital pin and an analog pin, set the digital pin to high, and read the analog, then set the digital pin back to low? If my math is correct that should give me roughly 1.1 volts at max power so the analog should read it's max of 1023 correct? And as the supply voltage decreases, the analog read should proportionally decrease, 2v on the power supply should give me ~682 analog reading. This is assuming the voltage going out of the digital pin decreases as the power supply decreases. So that should give me a fairly accurate reading of the power remaining in my battery? That is assuming my math is correct on the resistance value. Also I based all those calculations off something that I read that stated that the analog inputs on the mega328p uses a 100mohm resistor to create the load.

I can try to test this in a bit for myself to see if it works or not, just not at my work bench right now.

steven6282:
Well that sounds fine, like I said I'm interested in seeing a schematic for it to try and better understand it, but I also just had this thought that may require only a single resistor. It hinges on two questions though that I can't find the answer to.

First, what is the default AREF voltage for a stand alone atmega328p. Is it the internal 1.1 volts as stated here: analogReference() - Arduino Reference ? Just as a side note I've got my ATMega328p set to brown out at 1.8 volts, right now mainly because the nrf24L01 needs 1.9 volts minimum to operate correctly anyway. Don't know if that makes a difference or not.

Second, the voltage on a digital pin set to high is equal to the power supply voltage isn't it? Since I'm dealing with less than 5v and not using a regulator.

The battery I'm using is most likely going to be a 3v coin cell. If it is the 1.1v internal aref, could I not put a ~367k resistor between a digital pin and an analog pin, set the digital pin to high, and read the analog, then set the digital pin back to low? If my math is correct that should give me roughly 1.1 volts at max power so the analog should read it's max of 1023 correct? And as the supply voltage decreases, the analog read should proportionally decrease, 2v on the power supply should give me ~682 analog reading. This is assuming the voltage going out of the digital pin decreases as the power supply decreases. So that should give me a fairly accurate reading of the power remaining in my battery? That is assuming my math is correct on the resistance value. Also I based all those calculations off something that I read that stated that the analog inputs on the mega328p uses a 100mohm resistor to create the load.

I can try to test this in a bit for myself to see if it works or not, just not at my work bench right now.

Ok, well that doesn't work like I expected, and not exactly sure why. I tested with a steady 3.3v power supply instead of a battery just for testing purposes. My digital output pin is indeed 3.3v, however even with a 330k and a 270k resistor in series the analogRead still resulted in 1023.

I don't understand why this is? 3.3 volts with a 330k resistor should be around 1.08 volts with if I figure a current of 0.0000033 amps (which is what the current is figuring 3.3 volts with a 1megaohm resistor, and I just realized I didn't figure that correctly since what I read was the analogRead pin used a 100megaohm resistor to create the load not a 1megaohm. But if that is the case figuring on that current instead a 330k resistor should be giving me something closer to .01 voltage and near 0 analogRead, not 1023.

I'm guessing I'm just calculating or doing something wrong, or it just doesn't work like I was thinking, but not sure what / which hehe.

EDIT: Just to see if it made a difference I tried a 5mohm resistor between the pins and still got 1023 on the analogRead.

Wow... just found this:

http://code.google.com/p/tinkerit/wiki/SecretVoltmeter

It seems to really work. Tested it with a few different batteries and it's consistently giving the same exact reading as my multimeter.

I as away for most of today and although the offer might have been valid when I made it it was based on some basic assumptions and you fail to meet them... So after reading your last two posts you seem to have the theoretical side well under control and obviously you don't need the services an an aging senior engineer with 15 years experience in just what you are now doing so I will BUTT OUT Permanently From this thread... Sorry I intruded

Doc

Docedison:
I as away for most of today and although the offer might have been valid when I made it it was based on some basic assumptions and you fail to meet them... So after reading your last two posts you seem to have the theoretical side well under control and obviously you don't need the services an an aging senior engineer with 15 years experience in just what you are now doing so I will BUTT OUT Permanently From this thread... Sorry I intruded

Doc

Hey I'd still welcome your suggestions. I look for knowledge anywhere and everywhere so it would be very interesting to see what you had in mind, even though I have already found a working solution that requires no additional components and no additional power consumption at all.

This is the internet and tone and intent is somewhat hard to discern, but your last message seems to me to indicate some sort of offense has been taken on me not waiting on your schematic. I apologize if you took offense to that, I'm an eager learner and don't usually sit around waiting for one person when there are millions of sources of information out there. I make posts like this one in order to discuss the information and ask questions on things I don't yet understand but if I find the answer elsewhere while waiting on an answer in my post I usually tend to bring it back here and post it (like I did in this thread) so that future people who find my post with similar questions might find the same answer equally beneficial. So if you post what you had in mind, someone searching down the road may find your information a better solution than the one I came up with!