Help selecting DMM for MCU current consumption - Page 1
Forum section: electronics / testgear

author: cbc02009
author_rank: Regular Contributor
timestamp: April 29, 2018, 12:47:45 pm
content: Hello all,I am working with the atmel SAMD21 xplained pro board for a senior project, and because our unit is going to be solar powered, current consumption is fairly important. The board has very helpful leads for monitoring current consumption, and I'm looking to purchase a multimeter (bench or handheld) that can help me with this project.I've looked at the excel spreadsheets, but they are frankly overwhelming, and so I was hoping to get some recommendations from people.Being a student, I don't have much of a budget. Hoping $100 or less, but is that even possible?I found one on amazon, the AMPROBE AM-530, that says it can do uAs, has anyone tried it? Or are there better options?Any advice would be greatly appreciated.Thanks!

author: pigrew
author_rank: Frequent Contributor
timestamp: April 29, 2018, 01:42:59 pm
content: DMMs measure current by measuring the voltage across a resistor inserted in series with your load. If the resistor is too large, it'll have too large of a burden voltage, too little voltage will be supplied, and your MCU will become unhappy. Also, you need to select a DMM range appropriate for the maximum current that your MCU will use while in its active mode (generally around 10 mA), so you'll actually want to be in a 100 mA range when measuring the current consumption.In the 100 mA range, if you want to be able to discern microamps, you'll need a 5.5 digit multimeter, or maybe even 6.5 digits. These do become somewhat pricey, and you may want to look for used 5.5 digit bench meters like the "Fluke 8840", "Fluke 8502a", "HP 3478A", "Keithley 197".But, for cheap, look into a coloumb-counting IC, which is designed to measure the energy that's gone into your MCU from a battery-type source. The first hit on google was a DS2745, but I've never used one. You may be able to find demo-boards on eBay for a chip like this, or bodge one together yourself on a breadboard.EDIT: I forgot to mention that you do not want your DMM to be auto-ranging. Often, in auto-range mode, the DMM disconnects the series resistor while changing ranges, so the MCU's power source will momentarily be disconnected.

author: joeqsmith
author_rank: Super Contributor
timestamp: April 29, 2018, 01:57:49 pm
content: Under $100, maybe a free meter from HF, some resistors and a decent chopper amp would get the job done. Easy enough to construct.https://youtu.be/tgA6Ii_KAPs?list=PLZSS2ajxhiQDhlXQCyoNSDmUjb6lAqC8zThe UT61E that people seem to like so much has one of the worst burden voltages of the meters I have looked at. I attempted to improve this one but it's not something I would recommend doing. It does give you some idea what you can expect when making low current measurements. Good luck in school.https://youtu.be/14eHpHQxm54?list=PLZSS2ajxhiQDhlXQCyoNSDmUjb6lAqC8z

author: cbc02009
author_rank: Regular Contributor
timestamp: April 29, 2018, 02:23:06 pm
content: Quote from: pigrew on April 29, 2018, 01:42:59 pmThank you so much, especially for that last part. That would have driven me crazy! That's really helpful.I think I might have misread the power requirements in the data sheet. It looks like it only runs in the uA range when it's using an external clock, and with the internal clock it's more like ~5mA range. So maybe I don't need such an expensive meter after all? I've attached the two power usage example pages from the data sheet.

author: pigrew
author_rank: Frequent Contributor
timestamp: April 29, 2018, 02:33:30 pm
content: Quote from: cbc02009 on April 29, 2018, 02:23:06 pmBased on my reading of your post, it uses uA-level currents only when in the standby mode. In IDLE mode and above, it uses mA. Note that for the active clock ranges, you have to evaluate the formula they provide, so it ends up being in the mA range. For low-power, you'd have to keep the MCU in standby most of the time.I still like the idea of a coulomb counter for this application, perhaps the Sparkfun LTC4150 board, though you'd need to replace its current shunt and run it in reverse (so that it doesn't count its own power draw). You'd want a second MCU to keep track of the energy count.

author: joeqsmith
author_rank: Super Contributor
timestamp: April 29, 2018, 02:34:31 pm
content: Quote from: cbc02009 on April 29, 2018, 02:25:37 pmRight, you would actually need to watch them. Then let me know if you have any questions.

author: cbc02009
author_rank: Regular Contributor
timestamp: April 29, 2018, 03:39:18 pm
content: Quote from: joeqsmith on April 29, 2018, 02:34:31 pmSorry, I am really not awake this morning, I guess. I watched both videos fully, and they were incredibly helpful.Your shunt circuit is really cool. it looks like it stayed fairly accurate even with 1% parts in your testing.what resistor values did you use for the two non-inverting amplifiers?

author: ataradov
author_rank: Super Contributor
timestamp: April 29, 2018, 03:45:44 pm
content: If you just need a basic idea of a consumed current to double check your settings, then even something like Uni-T UT-136 will works just fine. I use id all the time for this kind of measurements.I don't understand why people suggest some crazy accurate methods.

author: joeqsmith
author_rank: Super Contributor
timestamp: April 29, 2018, 04:05:01 pm
content: Quote from: cbc02009 on April 29, 2018, 03:39:18 pmI left that part up to your education to sort out.I would start with what ever parts you happen to have laying around. Even if you only have a 741 and 10% parts, you should be able to get something working even on that white board stuff. Read the data sheets.I assumed college level but is this perhaps a high school project?

author: nctnico
author_rank: Super Contributor
timestamp: April 29, 2018, 04:07:44 pm
content: Quote from: ataradov on April 29, 2018, 03:45:44 pmLike others pointed out: a DMM has way too much internal resistance to measure currents which can vary a lot (like a microcontroller going in & out of sleep).Dave's uCurrent helps to solve this problem but you can also use a power supply with accurate current measurements like the Agilent 66311B.

author: ataradov
author_rank: Super Contributor
timestamp: April 29, 2018, 04:14:30 pm
content: Yes, you have to work the uA/mA switch. But if you are on an actual budget, then it is not a big deal. Majority of consumption comes from the sleep current in most cases, so that deserves special attention first.Another alternative is to look up Atmel Power Debugger. At $190 it is a bit expensive, but you get quite a bit with it, and it works really well.

author: cbc02009
author_rank: Regular Contributor
timestamp: April 29, 2018, 05:13:50 pm
content: Quote from: joeqsmith on April 29, 2018, 04:05:01 pmI know the ratio I'm supposed to use, I just didn't know anything about the chip your were recommending, and was hoping for a ball park so that the op amps weren't current starved.But yes, to your other question, there are some major issues with the degree program I'm in. It's new to the school, and half the classes in are actually networking classes or systems admin courses, not EE classes. If I had known, I wouldn't have applied here, but since it's my last semester it's a bit late for that.

author: Gandalf_Sr
author_rank: Super Contributor
timestamp: April 29, 2018, 05:32:56 pm
content: If you want to (can afford to) buy one, Dave'suCurrentwill do the job for around $100 US shipped. I just bought one for the same reason you want one.

author: ataradov
author_rank: Super Contributor
timestamp: April 29, 2018, 05:34:53 pm
content: But uCurrent will still require range switching, so you can't easily observe active/sleep modes of the MCU? In that case a regular DMM will work just fine. I doubt this project will need that level of precision in measurements.

author: joeqsmith
author_rank: Super Contributor
timestamp: April 29, 2018, 05:56:36 pm
content: Quote from: cbc02009 on April 29, 2018, 05:13:50 pmMy wife and I went to see Scott Kelly and he told about going to the wrong college as well. Very funny guy. If you ever have a chance to see him, I highly recommend it. Figure you will spend a fair amount of your life at work so it's best to do something you enjoy, what ever that is, so it's good to get that part of your life right.The datasheets for the part I used have recommendations to keep you out of trouble. It's not a bad part if you go that route. It was just what I had on hand, not something I recommended. You could try using LTSPICE to model it. It's only time.

author: Deridex
author_rank: Regular Contributor
timestamp: April 29, 2018, 06:03:59 pm
content: The other guys already said the most stuff about measuring the current of a microcontroller.But if you look for a decent basic DMM you might want to take a look at the brymen BM235. I think i saw it here in germany for 99€.

author: cbc02009
author_rank: Regular Contributor
timestamp: April 29, 2018, 08:08:41 pm
content: Quote from: joeqsmith on April 29, 2018, 05:56:36 pmI love the electrical stuff we're doing, especially the embedded and micro-controller aspects. Networking, on the other hand...I would sooner go back and work in the deli than do IT work.

author: ogden
author_rank: Super Contributor
timestamp: April 29, 2018, 10:26:16 pm
content: Quote from: ataradov on April 29, 2018, 05:34:53 pmExactly. Either you need very specific high dynamic range, fast sampling power analyzer which is way too expensive or you just adapt - craft testing firmware for 1) 100% CPU load consumption measurement and 2) sleep mode. Then you can get away with regular DMM.

author: bugi
author_rank: Regular Contributor
timestamp: April 30, 2018, 06:37:14 am
content: How often would the MCU change the state, or what is the period over which the average current can be calculated giving useful result? (That is, does it wake up once per second, or once per minute, or is it going through various states 100 times per second?)Noobs idea:If its operation states keep repeating rapidly in the milliseconds to max about second range, and if only the average current usage is needed, one could average out the current sense voltage with a simple RC-filter and measure that filtered voltage with single range. With practical components, and considering the filter's resistor should be much less than DMM's input resistance, the maximum period the idea could work would likely be in the 1 second range. Might be able to squeeze more if considering capacitor leakages etc... I tried to estimate in my head and error on the safe side.If the states change rarely, the filter can pretty much hide short and rare events (unless one happened to watch the display just then and notice the small change in the value), but then again, those would then not affect the total power consumption much, either.Rare but longer periods (order of magnitude filter's time constant or longer) in a different state would show up naturally as clearly changing value on the meter, but could then be out of range.

author: ataradov
author_rank: Super Contributor
timestamp: April 30, 2018, 06:43:54 am
content: No need to average or filter anything. You just artificially setup and experiment where MCU sleeps the same way it would sleep normally, but for a long time (enough to get a stable reading). Repeat for active mode.Knowing those two values and active/sleep times, you can calculate total power consumption. Active times can be either guessed, logged, or measured with a logic analyzer.

author: ogden
author_rank: Super Contributor
timestamp: April 30, 2018, 06:47:03 am
content: Quote from: bugi on April 30, 2018, 06:37:14 amNot RC filter but just increased capacity of power supply output capacitors. They shall be sized accordingly so pulsations does not affect desired accuracy of measurements.

author: bugi
author_rank: Regular Contributor
timestamp: April 30, 2018, 02:08:03 pm
content: Quote from: ogden on April 30, 2018, 06:47:03 amI was already assuming an ideal power supply; the filtering idea was supposed to remove the need to switch between measurement ranges and having the analog voltage to be directly theaverage loadand measurable within single range, not to increase accuracy or reduce power supply ripple. Note, the filter would be in parallel with the current sense resistor,notbetween the supply and the sense resistor.Quote from: ataradov on April 30, 2018, 06:43:54 amCertainly valid approach, and I would do it that way, even if just to know more about the operation (which allows better possibilities for optimization in some cases). But that certainly is not "just", compared to adding two passives to the most minimal measurement setup, yet gives basically the same end result as all that artificial setup, multiple measurements at different ranges, resolving the various activity levels and timings, and then making plenty (easy) math...But the filtering idea would only work when assuming that the average over relatively short period is all that is needed; as soon as one wants more data or longer time periods, the filter approach won't do.So, it is perhaps one option to consider, but not the only one.

author: ogden
author_rank: Super Contributor
timestamp: April 30, 2018, 09:33:59 pm
content: Quote from: bugi on April 30, 2018, 02:08:03 pmFor high frequencies like >= 10Hz you can live with increased bulk capacitors of the supply. For very low frequencies like wake-up per 1 minute you will test your RC filter capacitor leakage, not measure anything else. So your solution to add RC filter after current sense could work, but only in very specific consumption pattern frequency range.