Low voltage, low current sense design advice - Page 1
Forum section: electronics / beginners

author: STMartin
author_rank: Contributor
timestamp: December 16, 2021, 02:38:40 am
content: I have a work project to design a circuit that discharges batteries. During this process, I need to measure the current.My first thought was to use a current shunt and current sense amplifier. The resulting output will be fed into a DAQ. However after adding up all the error sources, I'm struggling to get anything better than 3%-ish.Design constraintsCommon-mode voltage: 1 - 10VCurrent: 300 uA - 200 mAOutput: <=10 VCurrent shunt: 5Ω or lessDesired accuracy: 1% or betterI'd like to be able to measure any current at any voltageHigh-side / low-side doesn't matter. The rest of the circuit is just resistance for discharging25 C° pretty well guaranteedWork so farLearned how to calculate the error budget using these videos from TI:https://training.ti.com/ti-precision-labs-current-sense-amplifiers-current-sensing-different-types-amplifiersAnd used the formulas from this spreadsheet:https://www.ti.com/lit/zip/sbor020to make my own Excel calculatorCalculated the error for a bunch of current sense amplifiers from TI, Maxim, Analog Devices/Linear Technology, Renesas, given the above constraintsToo high a gain, and the output exceeds 10V on higher currents. Too low, and voltage offset becomes an issueCMRR contributes significantly on the lower voltages as wellHad a look at instrumentation amplifiers, but haven't really chewed through the specs yetChecked out the schematic for the uCurrent. It seems Dave just uses a (pretty schmick) op-amp? Maybe I should re-watch those design videos.Am I going about this the wrong way?Should I look to dial in a really good op-amp with some trim pots instead?Instrumentation amps maybe? Amps with programmable gain?I feel like I'm missing an obvious solution.

author: Kim Christensen
author_rank: Super Contributor
timestamp: December 16, 2021, 05:33:46 am
content: Why not use a calibrated benchtop multimeter with GPIB/USB interface instead of trying to build one?

author: STMartin
author_rank: Contributor
timestamp: December 16, 2021, 06:37:04 am
content: We'll be doing 24 batteries at a time, over a four month period.Eventually, we'll probably be doing hundreds.It was my first suggestion too, but the equipment expense is prohibitive.

author: Berni
author_rank: Super Contributor
timestamp: December 16, 2021, 07:00:31 am
content: You can buy a bench multimeter with a slot for a multiplexer card. A lot of Keithley ones have it. This lets you use a single precise bench DMM to grab readings from 8 to 24 inputs. Larger systems can use dedicated multiplexer mainframes that can hold 5 or more of these cards, giving you literally 100s of inputs to switch between. This is how measuring a large number of nodes is done in a typical manufacturing environment.If you are in a tight budget or too much in a hurry to gather up cheap used gear off ebay then you can definitely still build your own. For reading shunt resistors you would typically use a purpose built current sense amplifier chip such as TIs INA series. They contain the whole diff amp with lots of gain to grab your tiny shunt voltage and amplify it up to something usable in a ADC all in one chip with next to no external components (especially no precision resistors). You can get a good high resolution measurement ADC chip for about 5 to 10$ and then you can use some cheep analog switches to feed say 10 shunt amplifiers into one ADC, making it one 10 channel current measurement card. Then stack these cards together for as many as you need. If you use SPI to control the ADC and switches you can put it all on one SPI bus and just use chip select lines to select between a large number of cards, easily allowing you to hook up 10 of these cards together for 100 inputs.On the end of it all you can stick a raspberry pi or something similar run the whole show while easily being able to log all of the data, copy it over a network, remote admin over network etc...

author: Kim Christensen
author_rank: Super Contributor
timestamp: December 16, 2021, 05:12:17 pm
content: If you're going to build your own, then adding a calibration table to your software could help reduce some of the errors.

author: David Hess
author_rank: Super Contributor
timestamp: December 16, 2021, 09:27:09 pm
content: Quote from: STMartin on December 16, 2021, 02:38:40 amWhy is the common mode voltage range so high if you can measure at the low or high side? It should hardly change for at least one of them.Quote200 milliamps at 10 volts would be 300 microamps at 15 millivolts. 1% accuracy then requires an *output* offset below 150 microvolts which is not particularly demanding, but it will require precision parts. This will be a good application for chopper stabilized amplifiers but the instrumentation amplifier could be tricky. The best precision analog amplifiers could do it also but would require offset null trimming to get below 3 microvolts; see below.QuoteLower resistance increases noise and other errors, but also lowers the error from the current shunt heating up. Use as large (in watts) a current shunt as feasible to minimize temperature rise.QuoteI would work backwards to find the absolute minimum shunt resistance. Assuming 3 microvolts of input error to make the math easy (3 into 15 is 5) and because it is not far off from the expected noise, which is greater than the offset of a chopper stabilized amplifier, so a 300 microvolt input (1% error is 3 microvolts) produces 15 millivolts at a gain of 50. That yields a minimum shunt resistance of 1 ohm. It cannot be lower because input errors will reduce accuracy below 1%. Also, it cannot be higher or the output will go above 10 volts. So the range you want is just barely possible but care will be needed on the error budget and noise.1 ohm at 200 milliamps is 0.04 watts so power is not a problem, but as I said above, use a larger current shunt resistor than necessary to keep self heating low.If a 2 watt Caddock SR20 current sense resistor was used, then at 200 milliamps, the temperature rise would be 1.6C (I estimated the thermal resistance from the power derating graph) so with a 100 ppm/C temperature coefficient, the maximum self heating error would be 160 ppm or 0.016%. Ambient temperature variation will create more error but still well within 1%.Because of the 1% tolerance of this current shunt resistor, trimming will be necessary for gain.QuoteSo you have a load resistor and current shunt in series across the battery?QuoteI did not even consider a dedicated current sense amplifier. Are any good enough?QuoteI do not understand why there is a significant common mode voltage to handle at all if either low or high side sensing can be used. Aren't the batteries all floating?

author: STMartin
author_rank: Contributor
timestamp: December 17, 2021, 07:13:37 am
content: David,Really appreciate the reply.QuoteGood point. I went back and watched Dave's video on the uCurrent (more on this below), and noticed he ran it low-side. He didn't really talk about it, but this eliminates CMRR error altogether, and he doesn't have to worry about a subtraction stage in his amp or any of that mess.QuoteThis is a great idea. I hadn't given much thought to temp co stuff since it'll be sitting in a lab, and the error doesn't add much anyway. Either way, I like it.QuoteThis is an approach I didn't consider. Let me make sure I got this straight.Given my range of inputs (300 uA - 200 mA) and my range of desired output (0 - 10V), it necessitates a gain of 50 to make full use of my output range. That gain will ultimately be a multiplicative product of shunt resistance and amplifier gain. We haven't determined those values yet, so put it aside for now. Gain of 50.Considering my lowest output (300 uA input, gain of 50, means 15 mV output), the sum total output error must be 150 uV or less to meet my 1% accuracy spec. Given the gain of 50, that means my sum total input error must be 3 uV or less. That in turn demands my lowest shunt voltage must be at least 300 uV.Therefore, if my lowest input is 300 uA, and my minimum output is 300 uV (to stay ahead of the 1% error spec), a 1Ω ­shunt is the minimum resistance. As you said, any lower resistance and the drop across it will be too low to stay ahead of the error. However, I don't understand why it couldn't be higher, say 2Ω, and reduce the amplifier gain to 25. Our overall gain is still 50, and we're still within the 10V output limit.QuoteYes. The discharge current is based on the battery capacity. The device needs to support a range of capacities (hence the current requirements), so the actual load resistance will vary from battery to battery.QuoteMaybe? After your post, I'm beginning to realize I'm not analyzing this problem properly; although I'm still digesting your advice. Quite possibly they're good enough. So far, though, given a few other wrinkles in the design requirements I haven't brought up here, the error is still too large at lower currents. At least, if TI's error calculation tutorial is to be believed (and if I'm doing it right).QuoteThere isn't. I'm mistaken.All that said, after watching Dave's uCurrent video again from way back when he was still in his garage, I've found a better approach that sidesteps all the amplifier error issues altogether.I don't need one.First, I was mistaken in my current range requirement; it's actually 3 mA to 200 mA. Oops. Second, instead of a single shunt, use multiple and switch them in or out with a FET or something. I have plenty of DIOs on the DAQ. This way I can keep the gain for a given range well above the error floor for the DAQ. I'm thinking this:1 mA - 10 mA @ 100Ω10 mA - 100 mA @ 10Ω100 mA - 1000 mA @ 1ΩThis scales everything to sit nicely within the 1V range on the DAQ. If the resistance on the FET is a significant portion of the 1Ω shunt, I may be able to eliminate that one and just step up to the 5V range on the DAQ if the error isn't too bad. I didn't have time to run the numbers today, but I think the error should be acceptable. There's a few other design requirements that may spoil this, but we'll see.

author: David Hess
author_rank: Super Contributor
timestamp: December 18, 2021, 02:43:55 am
content: Quote from: STMartin on December 17, 2021, 07:13:37 amThere is a still a common mode voltage where the connection to the current sense resistor is made, but it is tiny. If a 4 wire connection is made, then the connection to the shunt resistor can form a single point ground for the rest of the circuit and no subtraction is necessary. More complex circuit will still need a subtraction to preserve the performance of the current shunt resistor.Figure 83hereshows this. The "common" point is the junction of the current shunt and 10 ohm resistor. If the common point is moved elsewhere, then the non-inverting amplifier needs to be replaced with a difference or instrumentation amplifier but the common mode voltage is tiny.QuoteThat is right. I got lost somewhere in my thinking but a larger shunt resistance can be used with lower gain to get the same results but with more self heating error from the shunt and less demanding precision in the rest of the circuit. A 10 ohm shunt would increase the self heating error to 0.16% for that particular part which gives some idea of what is feasible, although that particular shunt is not made in a resistance that high.If the shunt resistance is high enough, then a 4-wire current shunt is not required although a 4-wire connection still needs to be made to the 2-wire resistor for accuracy.QuoteReal precision current shunt measurements with multiple ranges do not place the switch in series with the current shunt resistance where it will affect the measurement. Instead, the current sense resistors are placed in series and the amplifier input is fixed at one end. The switches direct the current to be measured into a selected point of the series connected resistors, and the higher value current shunt resistors which are not being used end up in series with the amplifier input where the additional resistance adds no error.For decade ranges in a multimeter, the resistor series is something like 1, 9, 90, and 900 so the 4 switches select 1 ohm, 10 ohms, 100 ohms, and 1000 ohms, and the amplifier input is fixed at the top of the 900 ohm resistor. The switch resistance becomes irrelevant to accuracy although it does affect the burden voltage.Study one of the old Tektronix multimeter schematics like the DM501, DM501A, DM502, or DM502A to see an example of this.

author: Terry Bites
author_rank: Super Contributor
timestamp: December 18, 2021, 06:41:04 pm
content: To get wide dynamic range and resolution I'd use a precison voltage to frequency converter and count the pulses with a uP. see LTC6990.You can mux a large number of current sense reistors. The input impedance of the VCF is very high compared to the sense resistors and mux on reistance.

author: STMartin
author_rank: Contributor
timestamp: December 19, 2021, 09:35:58 am
content: Terry,That is quite an interesting suggestion. I wouldn't have thought of that in a million years. Perhaps if my more traditional approach doesn't work out, I'll have a look. Although, right off the hop, the LTC6990 has a frequency accuracy of ±1.5%, plus whatever the DAQ adds. I haven't run the numbers though, so I don't know if it's significant enough to matter. Either way, something I'll probably prototype up. Work's added a few more battery current measuring projects my way and this seems worth exploring.David,Once again I can't thank you enough for the reply. Specifically the ranging.I had a look at the DM502A schematic's current shunt section, and prototyped a simpler version. It worked well swapping leads around to switch the range. However, in the actual design I'll need the DAQ to do the ranging. So I tried using BJTs as the switches, and got far higher shunt voltages than I should have. I don't fully understand how transistors work, so I suspect I've done something wrong.I looked around for auto-ranging schematics, and came across this:https://lowpowerlab.com/guide/currentranger/specs-architecture/Ironically, it appears to be an auto-ranging clone of the uCurrent.He appears to do what I had thought earlier: shunts in parallel, switched by MOSFETs. I've got some MOSFETs around here somewhere, so I'll have a play with those instead of BJTs and try both shunt topologies.

author: Berni
author_rank: Super Contributor
timestamp: December 19, 2021, 02:37:52 pm
content: Absolute accuracy % is the wrong thing to look for if you are after high levels of precision.When handling quantities like volts, amps, ohms it is difficult to cheaply mass manufacture components with the precision of <1%. However absolute precision can be solved using calibration. As long as you have a known accurate instrument (Such as a calibrated bench DMM) you can "transfer" a large potion of that accuracy onto other instruments by tweaking them to match that. This is how most precision instruments are created in factories and you can do it yourself too. As long as you have a way to tune the response (be it trim pots, software math, laser cutting passives, or even just putting a notch in a shunt with wire cutters...) then you can make it respond like something much more accurate. However this only works as long as your "tweaked value" stays constant over the lifetime. So the actual practical limit to accuracy is how stable with time you can make it. The more stable it is with age, temperature, humidity etc... the more closely it will resemble whatever it was 'calibrated' to. So it doesn't matter how accurate your components are, it matters how stable they are.For the example of current shuts, it is really easy to do a calibration by simply connecting all of them in series along with a bench DMM you trust then use a power supply to push various currents trough it. Grab the data points for offset and slope and as long as your circuit is stable the readings you get out of it are suddenly in the realm of being 0.01% accurate.

author: David Hess
author_rank: Super Contributor
timestamp: December 19, 2021, 04:54:29 pm
content: Quote from: STMartin on December 19, 2021, 09:35:58 amVoltage-to-frequency converters are one of the better ways to achieve high dynamic range (1), but today we have integrated analog-to-digital converters which are almost as good for much lower cost and complexity. A more realistic voltage-to-frequency converter design is shown in figure 10 of the same application note which achieves 20 bits of dynamic range and 17 bits of accuracy, comparable to a 5.5 or 6 digit multimeter. Even the trivial design shown in figure 12b on page 11 ofLinear Technology application note 3achieves 14.9 bits of dynamic range and 14.3 bits of accuracy.I was going to give some examples here of inexpensive integrated modern high resolution analog-to-digital converters, but Analog Devices' online selection guides are completely screwed up.Based on my analysis earlier, with a good precision design, I do not think you need any range switching.(1)Jim William's "King Kong" voltage-to-frequency converterachieves 160 dB or 26.5 bits!

author: Berni
author_rank: Super Contributor
timestamp: December 19, 2021, 05:27:38 pm
content: You can already get a lot of resolution and accuracy from even a more run of the mill measurement ADC. Something like a Microchip MCP3424 that gets you 4 differential input channels on 18bits with a built in Vref, PGA..etc going into I2C (with address select so quite a lot can be put on a single bus). Not the most fancy impressive chip out there, but its reasonably priced and performant enough for most jobs while being a easy single chip solution. For more performance there are also things like a MCP3564 that gets you 24bit (Not all bits usable of course, but still a lot). This is just measuring a battery anyway, those things are all over the place with tolerance and environmental factors anyway.Yes if you want the ultimate in ADC precision the way to go is various voltage to time conversion methods that real bench DMMs use, but that is a ton of work for precision that you most likely don't even need in the first place. And if you are going for ultimate precision then you probably also have the budget for a 8.5 digit DMM.

author: STMartin
author_rank: Contributor
timestamp: December 19, 2021, 08:39:35 pm
content: Everyone,I appreciate all the replies. I've some new understanding, and some new avenues to explore. I'll spend the next couple of days doing some math and seeing how each one shakes out. I'll post the results here for some critiques. Essentially it'll just be an (attempted) error analysis for each technique.I'll explore the following:1) A single shunt sent directly into the DAQ.2) A single shunt with a current sense amplifier3) A single shunt with a precision op-amp4) Multiple shunts sent directly to the DAQ5) Multiple shunts with whichever amplifier turned out better in (2) and (3)