Designing a Li-Ion Battery Gauge with the LM3914 - EEVblog #204

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome to the EEV blog and electronics engineering video blog of interest to anyone involved in electronics design I'm your host Dave Jones hi I've been working on a project that's art powered from a couple of well to our lithium ion cells in series and I thought I'd add like a little art battery gauge type thing to it just a little LED bar graph or something you know that shows the level of how much battery life is left in the product and there's quite a few ways to do this but anyway I thought I'd build something up and try and get something working so it's breadboard time now as I said there's a couple of ways to do this ah one is to go real high-tech and modern use one of these our battery gauge ICS arm they're basically are they basically measure the charge going into the battery and the charge coming out and you can read them out with you know they've got 80 C's in them in a little memory and micro and stuff you can read the data out for a serial bus to a micro and all that sort of stuff and it's all pretty fancy and I don't need something that fancy let's need a simple basic bar graph that you know when the batteries for when it's fully charged because this will be rechargeable right so as the thing charges up the bar graph goes up and when it gets too full it shows that it's full when you're using the product the bar graph will start out at full and it'll drop down to zero and maybe 10 LEDs or do you know one of those little 10 LED bar graph modules you can get for $0.50 they're very cheap readily available to use something like that now I could use a micro controller to do this you know it's got an ADC building a little picker an AVR or something but that's you know that's the obvious solution these days just put a micro in it I don't want that I thought I'd go a bit old-school and it brought back memories well how do I Drive little 10 LED bar graph of course the LM three nine one for absolute classic I see it's been around for decades and decades I use it extensively when I was a kid it's a little special-purpose analog chip from art national semiconductor who's now being borne out by TI bloody he'll go figure anyway LM three and I'm one for classy chip it's right up there with like the triple five timer in my opinion in terms of nostalgia and just one of those special-purpose chips that just does its job really quite well so I thought I'd get out my old parts been getting LM three nine one four and prototype it up it's give it a go now of course we can't just jump into bread boarding something without knowing our specs now for this project I'm going to be using two standard 18 650 lithium-ion ourselves you're probably familiar with these they're used in a ton of stuff these days not only to make up bigger packs but individually as well and by the way as it says down here this is a Panasonic datasheet okay I've just you know a good brand one a good datasheet I almost certainly won't end up using a Panasonic battery but they're all going to be are similar characteristics so I'm just using this as a representative example now there's a safety note down here I'll just mention ah basically a Panasonic will not sell the individual cells because they're unprotected and as I've mentioned before we've talked about lithium-ion cells they can be dangerous so you should only use the lithium-ion cells that are integrated with the appropriate safety circuitry built in so they're probably the majority of ones you can buy on the market but make sure you get the ones with the protection circuit or you'll have a little PCB in there and so it will be slightly longer and it will have a PCB in there that actually protects the battery and stops overcharge and over discharge and you know a safety factor stop them exploding anyway ah that doesn't change any characteristics that's just a side thing now we will look at the characteristic discharge curves of this battery and see what we need in terms of specs for a battery level gauge and you may recognize this this is the characteristic discharge curve of in this case the 18 650 lithium-ion cell which we're looking at here now because my project actually doesn't use one cell it uses new cells in series are a battery pack are the voltage on the y-axis here this is only for oneself so if we're talking say in terms of four volts we have to double that for all of our calculations and all of our thinking because we've got a battery pack of two cells and if we if it's three volts will be talking in terms of six volts so you should be familiar with this we've talked about in previous art blogs it's a standard a characteristic discharge curve of the cell voltage versus time in this case actually call the call at the discharge capacity they've done an extra calculation but it's effectively our time here we don't have to worry about the milliampere capacity really now they've got three characteristic curves here for different load currents in case it's constant current and they're assuming a 3 volt our cutoff which is there it is as 3 volts so pretty much you're only using the capacity between say there and there so you're not using all of the capacity of the battery but you're using most of it and that's good enough so my product will have a battery cutoff or a battery low voltage I'll call it 3 volts or big some reason to it'll be 6 volts so we know that we want a let's call it a V low equal to 6 volts ok that'll be our low voltage for our bar graph and and of course this is a 4.2 volt lithium-ion cell it has a constant voltage constant current it will constant voltage charge current charge voltage of 4.2 volts so when you are disconnected it's going to start out of 4.2 so we need a V high let's call it of 8.4 or volts or two times that so we've determined our what our upper and lower threshold voltages of our bar graph will be so if we've got our bar graph like this that goes all the way down and you've got 10 LEDs like that then this one will represent you know a maximum of 8.4 and that one will represent a low of 6 volts like that now ah the if you really want to be accurate with a bar graph LED battery gauge like this then you should take into account the fact that this curve is not perfectly linear it doesn't just go straight down like that but as you can see it's not too far off it's it's a more linear when you get to the higher current levels in this case our 4.3 amps but at 2 amps which is basically one city it you know it tapers off at the end here so you've got some gross non-linearity at the end of the curve but really that's good enough for my purposes I'm not going to fuss over that I don't want some intelligent control you know microcontroller thing that sort of you know compensates for the graph and all that sort of stuff it's good enough it's fairly linear you know it's not too bad at all and you can just mentally know that when it gets down the bottom it's a bit nonlinear so that's okay but as the products being used you will see the bar graph drop down like that and that's good enough so we have our upper and lower threshold voltages excellent let's go design a circuit and here we go the datasheet for the classic LM three nine one four and wow this brings back some memories it really does as a kid a classic project you do is use an LM three and I won Ford as a you know a audio level meter or something art this is actually a linear version you can actually get a logarithmic version specifically R for audio vu meters and things like that but it's a very versatile device that can be used a lot more than just a it's a dot bar display driver so um basically it can actually be a dual mode a bar or adopt display mode which is great you can choose which one in the case of this particular project because it's battery-powered you might use the dot mode because you don't want the in all of the it's lit up on your Biograph because that might chew extra power and really it doesn't give you any more information that's just visually a bit nicer the art bar graph so it's great that we've got that choice there it can operate LEDs else it needs vacuum tubes it's expandable to more than that 10 it's a 10 digit but or a 10 LED bar graph driver it's got an internal reference voltage which will make use of it operates down to single supplies of 3 volts up to up to about 15 volts I think it is up to quite high voltages so it'll operate directly from the battery pack where we're going to use and the inputs operate down to ground and you can and it's got programmable LED current so you don't actually need any dropper resistors in this thing that's great you actually save component count with this thing you can program it from 2 milliamps or 30 fantastic we'll use our two minutes down around that level today because we want you know this is a this takes power from the battery so we you know we don't want to waste too much power so we want our LEDs we don't want to operate them at 30 milliamps it's crazy we'll operate them down at two or three milliamps or so um it can withstand overloads all sorts of things anyway I love this chip and we're going to use it it's simple well it's not that simple actually you've got to tweak it a bit as will no doubt find out but it's a very versatile chip I highly recommend you check it out if you're after I am an LED bar graph of some fall now here's the chip in it's our standard configuration of a 0 to 5 volt Biograph meter now um this is we don't want this okay because we want to have our range you remember we said that we would have a range from 6 volts to 8.4 volts so that is what's called an expanded scale because you're not going from 0 to 5 you're actually expanding the scale I know you're actually shorting in it it's actually the span is actually lower than let's say a typical 0 to 5 but you're expanding because you're expanding above the ground reference level which is the basic configuration of this thing now they will have an application circuit for the expanded scale meter let's take a look at that and here's the application circuit for the expanded scale meter MDOT or bar mode so there's actually a single pin switch on here which actually can select between dot bomb oh it's really quite easy don't worry about this some AC transformer and rectifier up here that's got nothing to do with it and then they tell you that down here it's just to show that it needs no hardly any filtering at all and the thing still works but basically our expanded scale meter we can get away with just a couple of resistors down here now they're showing a couple of trimpots down here to so much you know get in there and tweak the thing but I don't want to do that we we want to learn a bit more about this chip and how it works internally and see if we can actually calculate the values instead of just throwing in some pots and just tweaking it until we get our upper and lower voltage thresholds that we need and here's some more info on a greatly expanded scale bar mode only they're talking about one look at all this you know that looks that looks quite messy I don't like there's the two trimpots in there but there's other little stopper resistors there's another one here it's all a bit messy I don't like it we're gonna what find a simpler solution than that and at the same time try and understand how this chip works internally now here's the internal block diagram of the device it does look at pretty simple but it's actually a bit more advanced in this this is quite a simplified block diagram but it'll it's a quite functional and allows us to work out what's going on here now as you'll see this is our voltage signal input as they call it's got a diode clamp here for over voltage and stuff like that it's got a buffer and it just drives a bunch of comparators which are driven by this resistor this own internal resistor ladder here each one of these resistors is 1k and it gives you a typical value further on in the specs for the device and they drive the LEDs over here so basic a very basic just a window comparator or a bar graph doc comparator type thing and it's got an internal voltage reference which we'll take a look at it's got the power pin ground pin and not much else just the upper and lower threshold voltages which go directly across the directly across the divider resistors here which determine the individual voltage thresholds for each of those comparators and then in turn each of those LEDs it's very basic cut stuff you can build up something like this just using armor just using the bunch of comparators yourself and the resistors and things like that but it's all build onto one chip it's beautiful now one of the keys here is this our internal voltage reference source of 1.25 volts now one of the important things to note about this is that it is not ground reference internally it goes out to a separate pin which they call ref adjust which in the basic application in this showing that it's actually grounded here but you don't have to ground it you can actually offset that by a certain voltage and if you like and you can do various things with it and likewise the lower the lower what they call our low here the pin our low is not tied to ground but in the standard circuit it is it is tied to ground so it the basic voltage ranges from zero volts upwards like that at each tap so you know for 0 to 5 volts it might be zero half a volt 1 etc etc but because that pin is effectively floating and so is this voltage reference it's quite versatile in what you can do with it and allows you to do expanded scale displays by offsetting various voltages which is what we're going to do here today and they've been very clever with this device as well this resistor which is the load for the voltage reference here actually determines the LED brightness so it's sort of that's it's quite clever can actually be a pain in the butt because then that interacts with your voltage offset voltage offset resistors as you'll see and things like that but it is quite clever I like it so that resistor effectively or the load on there on the voltage reference effectively determines the LED brightness and that will be a based on a formula which will find it further on in the datasheet now they've got a nice little section here on the internal voltage reference and how it works and it basically works the voltage reference is internal like that V Plus positive negative it's inside like that and it always generates 1.25 volts pretty much regardless of how you've got it configured externally but it will generate 1.25 volts so if you hook let's call them well they're called r1 and r2 here and that's what we'll call them in our circuit as well don't worry about it now we'll go into it later but that will generate 1.25 volts across that resistor there if you've got it wired if our ones wired directly across those pins so that you can use Ohm's law 1.25 volts divided by r1 generates a current which goes down there and hence flows into here but there is also a and what they call it call an error term there's a leakage current for the for the voltage reference itself and that will be an additional current there and they call it RI adjust so that means this current here the total current I through here will be equal to i1 plus I adjust like that and that's quite important we might have to take that into account later when we build up our circuit right so let's start designing this thing and see what we can come up with now as we determined before we basically want our voltage reference range for our window here we looked at before we wanted eight point four volts up here so this sum our hi pin which they call it needs to be at 8.4 volts and we wanted six volts down here on our lopen if you do the math if you subtract 8.4 volts from six point four volts what do you get you get two point four volts okay now what happens if you divide that by two what do you get I'm glad you actually get one point two volts now 1.2 volts is pretty darn close to the 1.25 volt voltage reference here so I think we can use that we can be clever and just use that as our voltage range for here so all we need to do is multiply that by 2 to give us our range on these a voltage range on these two pins so we need a circuit external to here that sets these two pins at basically half these values or for a single cell we need to be four point two volts on this particular pin and we need to be down here we need to be three volts on this pin down here and then and in our signal here we can actually our input we can use a voltage divider let's say that's 10k and that one's 10k as well our input signal if we connect that to our plus V battery if we connect it thup sorry that was off the screen if we connect it down to our V battery down here we can use a voltage divider to chop the battery voltage in half now this I think is important because these inputs here to this chip won't go all the way to the voltage round now this is our voltage here and if we connect this to plus the bat as well because we want to power this entire circuit from the battery under test we don't want to have to you know power from a separate supply that's just silly so these inputs won't operate all the way right up to this level of the battery so but if we have the battery voltage with the voice divider here we have it then it should be within the workable range of the comparators and the rest of the circuitry inside and if you have that as we said up here it's we want a range of 1.2 volts over which our LEDs light up or 1.25 is near enough for my purposes so ideally all we want to do is connect the voltage reference directly onto these pins here and if we did that if we actually did it as per the circuit I showed here if we grounded this grounded this and this connects to the V RF output there then this would the chip is designed to work over a range of 0 to 1 point to 5 volts so these LEDs will line up at 0 i but you know the first LED will light up and then all the way up to one point to 5 volts that's a standard circuit but as we've mentioned before we want an expanded scale one so we have to offset this pin here we have to offset our low by the minimum range we want so we have to add 3 volts to this pin down here and that's what we need to accomplish somehow externally to here so how do we do that well I'm glad you asked first of all let's get rid of that ground point there we don't want that let's just get rid of that resistor because it's in the way we'll replace it with our own resistor and let's draw in another resistor here we want to resistor there and let's tie it on to the ref adjust pin we'll call that our 1 and we want another resistor down here which we'll call our 2 and we will ground that now this are low down here we can want to get rid of that ground and we want to connect our low up here to the bottom of that because we know our range is one point two five thoughts or exactly the same as this voltage reference and we can leave this also connected up to you okay so our our high up here is connected to the positive side of the voltage reference our low down here is connected to the negative side of the voltage reference and all we want to do is choose these resistors so that we get three volts superimpose three volts across there and that will raise a voltage up by the three volts we need easy and if you remember this circuit over here there's actually a formula for the LED current now this is something we need to consider up front and it'll become obviously obvious why now the formularies are the LED current is approximately equal to twelve point five on our one so our one we need to be that basically our twelve point five divided by our LED current which in this case I said I'd like about two milliamps and like to be it as as low as possible so it doesn't draw excess current from my battery so twelve point five divided by two milliamps you whack that into the calculator twelve point five divided by two milliamps and you get roughly six thousand two hundred and fifty ohms and you can see the realization of that formula on this characteristic curve here of our LED current versus the reference load current and if you have a reference low current of 1 milliamp you get an LED current of there it is twelve point five so that's where that factor about twelve point five comes from and it's fairly linear not absolutely perfect but close enough so we're actually going to have a current through our through our one of 1.25 volts which is our voltage reference on our six thousand two hundred and fifty ohms which is equal to 200 micro amps and if you have a look at the translate that to the graph over here of course it all works out so all the math is nice it all works out and 200 micro ANSYS is up 500 micro MCS at 200 just puts us on the bottom of that curve there which is around about the two milliamp figure that what the curve doesn't actually extend that far but it's up near enough so there you go it all works out so over here we want a current there there of two hundred micro amps which will give us our led current if you know near enough to two milliamps basically that's our target but oh one here curiously right which we calculated the figure here is six thousand two hundred and fifty ohms that's great if nothing else was attached but what do we have here check it out look up here we have this resistor divider network directly in parallel with our one we've got these resistors in here we have to take into account so we have to add these in parallel with our wealth in parallel with our one we haven't actually calculated the true value of our one yet we what our one sure we want our one to be six thousand two hundred and fifty but we're not going to use a six point two five K a resistor in there because we've got all these other resistors in parallel so we need to calculate the true value of r1 when you include these ones in parallel so we need to find a target value of our one here for that six thousand two hundred and fifty ohms which we calculated before but based on our this resistor this resistor divider here in parallel so we need to know what value of r1 will give us the total resistance of six thousand two hundred fifty ohms here and I've done it down here if you look at your standard parallel resistor from low our total equals R one over one over r1 plus one over r2 that gives you total parallel resistance but we need to fight we know what value we want we want six thousand two hundred and fifty ohms as a total so we've got an unknown term in here one of these terms is unknown and we know the other one which is the resistor divider so we just sort of rewrite that formulas are we're trying to calculate one here which is our value and if you rearrange the formula you actually get one on our one which we calculated which is there six thousand two hundred and fifty ohms - instead of plus it's now minus one on the revolt egde the resistance divider the value of the resistor divider and if you plug the numbers into the formula it's one on one on six thousand two hundred fifty minus one on twelve K where did we get 12 K from where here you ask well if you look at the resistor ladder up here there's only ten there's only ten resistors there and they're all marked 1 K so you might think it might be 12 K but I don't know you've got to double check these things don't go by those block diagrams only go by the true electrical characteristics and sure enough if you look elsewhere in the datasheet the voltage divider there it is the divider resistance total of pin 6 - pin 4 is a typical value of 12 K so it's not 10k and should get from the block diagram just be careful that sort of thing it can range anywhere from 8 to 17 but is it 12 I don't know let's plug out 12 K into our formula and try it out I don't think it's going to be up near the maximum it might be down near the minimum there's quite a larger up side there on that but we'll take a value of 12 K which is what we've done here plug that in and oh one is just over 13 K there it is so we want to use a 13-point oh for K 13 k o4 there for our one doesn't need to be that precise why because it's only for the lead dropper resistor that's it basically this resistor here is only calculating the lead our current so it's not that vital really now we have our value of the resistor we can use for r1 our current down here hasn't changed we calculated that before at 200 micro amps because it's 13 K in parallel with the resistor divider 6250 ohms divided by 101 point 2 5 volts divided by 6 250 years of 200 my gramps so we know we've got 200 my grams flowing down r1 and this is where we need to now calculate r2 which actually increases now it's what generates our voltage drop across it to raise up our low input voltage and create 2 3 volts and create our expanded scale 4 meter so we need to calculate r2 for a 3 volt drop based on current down here but it's not just 200 micro amps remember before it's 200 my crabs plus the error term here and there you go if you remember back to this diagram here we talked about that r1 and we talked about that error term being the leakage current of the voltage reference itself so we need to find that value in the datasheet to find out what this value actually is and if you have a look here it actually tells you since the 120 micro amp current maximum from the adjust terminal well that's it once again don't take any of these application stuff for granted go over to your electrical characteristics table because this is the only one that matters so if we look for our voltage reference here we can find out there it is adjust pin current there it is 75 more grams typical ensure enough it is they were corrected is 120 micro amps maximum so they weren't lying over there like they were with the resistor divider up here so we'll take us typical value we'll take the typical value because I don't think it will be near to the upper maximum it could be now if you want to design worst case as we've explained in previous blows you might have you might use the maximum but I'm going to use the typical value and see what we get to see how far it is out so we will take this 70 F that as I adjust equals 75 micro amps so the total going down here through r2 is 200 micro amps plus 75 my cramps or 275 micro amps total so if we now calculate our two here r2 very simple it's going to be our offset voltage we want on this pin of three volts okay because it's connected through to their three volts divided by Ohm's law 275 micro amps total current flowing through their gives us a value of two thousand nine hundred and nine ohms bingo we now have our two values there and there for our circuit so if we build up the circuit hopefully we should get a work in expanded scale voltmeter that operates from three volts up to 4.2 volts threshold voltage but because we've got the voltage divider down here it'll be from six volt battery up to eight point four volts let's build it up and try it and here's our final circuit which we're going to build up on the breadboard using the LM three nine one four it's a two cell lithium-ion battery gauge will it work let's try it and here's r1 and r2 which we spent so much time digging around calculating and we came out with around about 13 K for r1 which will give us roughly two milliamps or so per LED and r2 was a ten point nine one K or ten point 909 and it just so happens that that's exactly you can make that up precisely using a 12 K and a 120 K in parallel so that's what I've built up here and our input voltage divider here - 10 K s they can be pretty much any odd value you like 10 K is not a bad value it's all powered you'll notice the whole thing is powered from the battery under test so here it is tada let's see if it works all right what we've got here is we've got the Fluke 87 measuring the input voltage here which I would come from our battery but in this case it's coming from a variable bench power supply I've got my 10 LEDs builder lined up here they should actually line up in this direction so this is the low end of the voltage range this is the high end so I expect this one to turn on and around about 6 volts and this one up here too turn on and around about 8.4 us I've got a bypass cap as well which we didn't talk about I've got a it's just a half micro farad bypass cap in there anything will do fine you'll notice that it doesn't need the lid dropper resistors really nice aspect to this so there's my two input divider resistors there's my 13k there and there's my um 10k 909 there Eady well let's give it a go let's wind up the wick so the power supply shows the exact battery voltage let's see what happens of course it's not designed to operate this low oh look there they're all coming on there you go there's a weird side effect which you wouldn't know about unless you actually built this up and breadboard it and a very and a 2 volt battery voltage they're all going to line up so you may actually think that's an error that's actually an error condition because um it shows that you've got full battery voltage but you've only got 2 volts it's crazy but you are your circuit should have a cut out under that so it's not a big deal but there you go that's just an interesting side fact it's designed to work from our 3 volts onwards the chip so it looks like it is no problems at all let's wind up the weekend we shouldn't see any LEDs on it all until that 6 volt mark which is our battery low here we go whoops we're on what was smack on six bolt volts it hasn't lit up yet obviously we're going to be there look there we go six point oh six volts bingo and then as you go you can wind up the wick like that and it looks like it's doing a pretty good job we should get around eight point just should turn on eight point two it does there you go so the bingo it works I'm actually quite surprised that um well not surprised we did the calculations but I expected some error in there with the error our adjust term will have to measure that so I didn't expect it to be our spot on but it is it's pretty darn close I'm and happy with that I wouldn't have to tweak those values at all I'm I'm quite impressed with that let's whine the voltage up even more just to check that it still works and it should work up to 15 volts is the maximum operating voltage of this chip so just make sure it works up to that we won't take it any further and I like it it's a winner now of course that was set to bar graph display mode which actually is going to draw a lot of current if are all those LEDs your honor at least 2 milli ampere LED plus the quiescent current the operating current of the chip so let's convert that to bar mode add 2 dot mode to do that you just leave pin 9 down there floating so we'll leave it floating and let's check that our dot mode works as well it's just over 6 volts there we go bang it's on and bingo dot mode works it's nice now one of the nice features of the lm317 Eid ed spot you'll notice there is no way that I can make I can make both LEDs come on but I can't get an error condition where no LED will come on so where the voltage threshold is right between the LEDs because it's got the data sheet I think claims are 1 millivolt our threshold between or our overlap between the LEDs so 1 millivolt overlap means that you will never get an error condition where an LED is not actually switched on and so dot mode you can trust that you're not going to have any dead spots within there that's built into the design of the LM 3 and I 1/4 you'll notice it's just a beautifully toggle which you know you might have two LEDs lit up but that's just fine because you've got noise on there and bingo it's there you go 8.3 in dot mode works just great and once again we can take it up to 15 no problems at all I declare that to be a winner both dot and bar mode and of course if there's no LEDs on you know it's under 6 volts all right let's check our LED car that we expected around about two millions but it wouldn't surprise me if it's not you know if it's over or under that because that's determined by that 13k resistor which we had in his circuit which remember is dependent upon that very wide variable range of the resistive divider inside the chip so let's wind it up to six volts till our lip turns on bingo it does I to 20 milliamps there you go it's a bit over so it's not exactly the two minds we expected so you could actually tweak that 13k value there if you wanted to um just to adjust the LED current that you wanted but as you can see and that LED is still reasonably bright enough even at two milliamps and these are twenty-year-old LEDs I just had in my jump in so if you use a our modern high-efficiency LED bar graph um there should be more than bright enough at 2.8 million so I'm happy with that I don't need to tweak that at all and what's the quiescent current of our circuit well I've just under five six volts there so no LEDs you're on it's around about five milliamps or so and if we wind it down you'll notice that yet no problems so at that some so it's going to consume at least start five milliamps and when you switch an LED on let's go up to six volts get one on there we go at Bingo jumps up to eight milliamps and it doesn't matter it's going to take around about eight and a half million maximum regardless of which led you'll notice that it is slowly actually increasing as we go up in our dot mode so there you go looks like up to nine milliamps maximum I would um I'd safely say I round that to about ten milliamps our maximum current draw in dot mode and in bar graph mode of course it's going to take considerably more than that there we go all the LEDs lit up and 35 milliamps so as you can see you pay a fairly hefty price premium therefore using the art bar display mode and if this is that measuring the consumption of your battery then you know if you're only out drawing low currents from your battery in 35 milliamps could be quite significant but if you're drawing you know if your product draws a couple of ants or something like that then you may not worry about that and you may like the effect of the biographic display mode and checking our reference voltage there is that one point two four six volts pretty close to the nominal one point two five volts claimed and if you remember this error term here of 75 micro amps that we included in our calculation for the offset voltage here how accurate is that because you remember it was a nominal value of 75 our bike Rams could it could have been a maximum of 120 micro amps well let's measure the thing there it is I've broken pin eight there so I've and I'm actually using my microcurrent adapter here just so that the meter doesn't introduce anything funny and there it is at fifty six point five micrograms so it's up lower so technically our calculations art would be slightly out there because we assume 75 microns but well it's 56.5 microwaves for this particular chip at this current temperature how about we change the chip and see if it makes a difference there you go I actually changed the chip it's exactly the same art batch and date code so I'm sorry I didn't have any different ones on in my set but there you go it's almost the same it's only out by half a micro M and if you're interested in what type of chip on you it is a genuine national as well I'm not aware of our second source ones for this but you probably can get gray market ones that it possibly is a second source somewhere I don't know but it's Salman in 1990 vintage there you go the 50 second week in 1990 so this is over 20 years old but you'll notice of course that this new chip doesn't hasn't switched on at 6 volts like the other one did so there you go it's it's you know the tolerances are slightly different because each chip so it is going to be up slightly different in terms of temperature coefficient absolute accuracy of the internal 1.25 volt voltage reference and other stuff so really you know that's why they have the trimpots in the circuit because ultimately you may have to work trim this thing if you want to get accurate but I I reckon you could what you like for a rough battery gauge for um for my application anyway I think I'm not going to worry about with the trimpots I think I can get reasonably close with the fixed value resistors I'm not going to fuss over whether it's you know it's six point one or 6.0 volts it's near enough and if you really keen the datasheet does mention in the application notes area ways to I keep your resistor values low so that the temperature coefficient affects of the internal divider and things like that don't swap your values and and stuff like that so you know if you're doing a really serious critical design with an LM three and I won four you've got to take that sort of stuff into account especially over the temperature range now for just of my input voltage so that first LED is just switched on fully and I'm using my micro current to measure that reference current leakage value but let's try it without the micro current meter and see what happened to use the shunt inside the meter itself so might change anything just switch over to current mode here so we're no longer using the micro current we're using the internal sharp and that meter and look the LED it's the same 56 micro amps or readings exactly the same but this shunt the higher value shock resistor inside the mean of the burden voltage is that slightly higher than what the micro current is so it's cause that led to turn off and if we switch it back to our microcurrent like that bingo it switches on C so if we go like that and that is a demonstration of burden voltage in action and if you integrate it's not that critical in a case like this but if you've got some serious circuitry you're trying to measure that can ruin your day now just as a bit of a little aside here a little tip for you when your breadboard in stuff beware of using resistor just pulling resistors straight off these are bandolier things and putting them straight into the breadboard it can be a real pain in the neck and I'll show you why watch this if you pull one of them out like that you can end up with a whole bunch of glue on stuck on the end of your pin so if you've got that glue stuck on the end of your pin like that and then you just go try and shove it into your breadboard you can end up with a bad contact or no contact at all and that can really ruin your day especially if you're trying to put two resistors in parallel like like you're trying to tweak a value or something if you put two of them in parallel and ones not making contact there happens to be the higher value one then your lower value one can be slightly out and ah can ruin your day trust me so it's actually sometimes beneficial to actually put resistors in series because then you have a gross failure because you know that the single resistor has failed anyway the way to cure that is simple when you peel them off the bandolier just make sure you snip off the end piece of cake so there you go that's a nice little practical to sell lithium-ion battery gauge I like and it works quite well we measured its performance does pretty much exactly what I want spot-on beautiful bit and it is adjustable for our other types of battery chemistry not just lithium-ion you can adjust it you can do all sorts of things with the LM three nine one four I love it it's a great chip it's very flexible someone should do a contest for it but if you want to adjust the circuit for other battery chemistries are the voltages different number of cells you can not a problem just follow through the steps we went through to calculate the values there's different configurations you use the one we use is quite simplistic because we just so happen to have that 1.25 volt ranges exactly what we wanted if you want something lower than that then our one in the circuit here if you've got our one there you have to actually put a voltage divider in there to get it smaller and then you've got a tweak the voltage divider important you can do all sorts of things and you can offset and you can power till the cows come home so it's a very flexible circuit but this implemented quite well I'm quite happy with it uses four resistors one capacitor LM three and I one four and it works as a complete two cell lithium ion battery gain so there you go I hope that was fun and useful catch you next time and don't forget to subscribe there's a button somewhere leave comments whatever give it a thumbs up beauty you
Info
Channel: EEVblog
Views: 125,664
Rating: undefined out of 5
Keywords: lm3914, chip, circuit, classic, bar, graph, dot, project, design, electronics, breadboard, resistor, multimeter, measurement, datasheet, lithium, ion, battery, pack, gauge, level, led, display, 18650, cell, capacity, parametric, 4.2V, 4.1V, 8.4V, 8.2V, expanded, scale, voltameter, LM3915, LM3916
Id: iIKGvHjDQHs
Channel Id: undefined
Length: 47min 8sec (2828 seconds)
Published: Wed Sep 28 2011
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.