In this tutorial Dave demonstrates the seldom used and often little understood mathematical integration function available on your modern digital oscilloscope. And demonstrates a practical example use for it in accurately measuring the total power consumption of a microcontroller that sleeps and then wakes up and does some processing before shutting down again. By getting the total area under the current curve.
Forum: http://www.eevblog.com/forum/blog/eevblog-662-how-why-to-use-integration-on-an-oscilloscope/'>http://www.eevblog.com/forum/blog/eevblog-662-how-why-to-use-integration-on-an-oscilloscope/
EEVblog Main Web Site: http://www.eevblog.com
The 2nd EEVblog Channel: http://www.youtube.com/EEVblog2
EEVblog Amazon Store (Dave gets a cut):
http://astore.amazon.com/eevblogstore-20
Donations:
http://www.eevblog.com/donations/
Projects:
http://www.eevblog.com/projects/
Electronics Info Wiki:
http://www.eevblog.com/wiki/

Hi. Modern digital scopes are wonderful tools and can have very powerful analysis and software capabilities. In particular, they have lots of math functions. Now, if we take a look at the math function over here, you'll notice that all of these are transforms and operators.

Look at what we can do in one of these modern scopes. add subtract, multiply, divide. We can differentiate and it shows you the data in real time. We can actually apply these operators and transforms to our captured data not only in stop mode, but also in real time as well and we can differentiate.

Integrate We can do FFTs You're familiar with likely familiar with FFTs to get the frequency domain of your signal or make it work like a spectrum analyzer, but we can square square root Absolute value, can do all sorts of logarithms, and we can even that low-pass filter our signal, and to all sorts of weird and wonderful mathematical stuff for this. But you're probably thinking what what actual practical use is having something like an integral here. Why would you want to integrate your signal well? I'll show you a real practical example where this is very useful and how you can use this and do it. Let's go now.

A really good example of where integrals will come in handy is for example, measuring the power consumption of a modern micro controller like this Energy Micro Arm Micro we have here now. I'm using my micro current here and I've got it in series. A couple of jumpers in there in series with the power supply of the micro controller. I've set the range so that we're able to measure this on our multimeter.

but in this case we're going to what. Take it out to the oscilloscope and actually look at the waveform. and the micro control is actually going to sleep here. and then every second it's waking up and then you know, changing the message on the LCD there.

So we need to measure the total power consumption. This micro controller let's see how integrals and the integral function helps us do this. So if we have a look in real-time at the output from our micro current here, we can see our current waveform. You see that every second its popping up with.

you might be able to capture it there, a current pulse when it wakes up and displays something on that microcontroller. Well, we can of course single-shot capture that bang. There it is. and there's our current waveform when it powers up.

So we want to look at and calculate the total energy or current that's being used by our microcontroller over time. Now our waveforms a little bit noisy there. So what we want to do in this sort of situation? When you're looking to get higher resolution and as much accuracy as possible, you basically want to go in. and you want to turn on your boxcar average in your high resolution mode here.

And we should be able to get a nice cleaner and higher fidelity waveform in there. And now. Bingo will captured that and we can see our waveform in pretty good detail. You can see how it powers up here.
There's a little bit of you know, weird stuff happening here when it powers up and then it goes. Got a few little Wiggles in there and we've got all of our data in there and slowly charging up. That'll be due to you know, the decoupling on the power supply. It's doing its operation and it's basically shutting back down right down to the sleep current right down the bottom right there.

So most of the time is going to be spent in sleep mode of course. and you can see in this case, 500 milliseconds per division. it powers up every two seconds. Basically an update.

see: LCD So we want to get the total current consumption over that time. How do we do it? Well, The integral is the key. So when you're talking about power consumption when you have effectively a current a draw graph like this, the area under the curve represents the total current consumption of your product. And of course, if you zoom right out and you get it over time, for example, then you're only drawing very small current Peaks Like that with lots of you know, dead period like this where they're still current drawing there, but you've got to add it all up over time over one full cycle so that you can get a a true measured value of the total current consumption and the way to do that.

The way to find out what the area under that curve is is with an integral. So just what is an integral? Well, if you're familiar with integral calculus or if you're not, I'll tell you Now it. Well, it can be a relatively complex mathematical subject, but what it comes down to is an integral is essentially the integral function is the area under any particular curve. So we've got our yellow a yellow data waveform here.

So all of that in there, all that area under the curve. There is the integral of that particular waveform. and the purple waveform we've got here is basically just adding up each little bit of that as we go along and then increase in increase in all the way up until we get a total figure right at the end. So over a particular time period, it'll always.

it'll rise like this, representing the maximum value of all the each individual segments. If you want to visualize it all broken up into little segments, add in those all up until you get to a final value. So sorry, the colors aren't working out very well, but basically that green area in there. that total area is going to be a representative of the total area under that yellow curve there.

So we end up with a final figure up here from the bottom to here when we turn on our measurement function of our total area under the curve. and that's how integrals can be really useful. So what we get here When we select the integrate function here, we can select our source of course, our sources coming from our channel 1, the yellow waveform and then we get different scales and there's two other controls on the oscilloscope that then operate the scale of that integral calculation waveform just like you have another vertical scale there. So we said it.
so it's on screen like that and we can also offset that like that so we can put it down and line it up with the graticule like that. and then we can. you know, take our measurements from there like that if we want. and of course being an integral, it's going to be overtime.

So rather than just being a voltage, going to be voltage with respect to time. So we got a different units here of a hundred micro volts seconds. So it's a hundred micro volts over one second total value, peak value there over a one-second period. But of course we don't have one second on the screen, they're just the units.

Okay, what we want to do first is pretty much get the area under this entire curve here. So I've expanded it out so that you know it pretty much is decayed away back down to zero. Here, we care about all the energy content under that and you can see how the waveform is slowly tapering out until it's pretty much flat. so you know that's going to be good enough.

Let's get the area under that current pulse peak there, so we can, of course, just you know, move that up manually and just count the number of there until we get to that maximum value we want there. But hey, this is a modern scope. We can turn on curses and we can go into Y here and we can set our Y cursor right down to the bottom there. That's where it starts.

and then we want the pig value right up the top here. So y2, there's our second cursor value, so we want it over that particular time period there. We don't have to worry about the X1 and X2 cursors. That just gets us the difference there.

But here is our value Delta Y Between those two values ie. that peak value up there. six hundred and ninety seven point, nine micro volts seconds. Li Let's round it up to seven hundred micro volt second, shall we? Now, if we actually expand this out, we can and a readjust our scale for our math function for our integral.

you can see that we can see the accumulation of the value over the time, so we can actually measure it directly from here. If our scope had the correct you know enough dynamic range ie. you know a big enough a high order enough arm, analog to digital converter to actually accurately measure this small sleep current down in here. Income you know, in the same range as our big Peaks Here at every two second mark, you can see the accumulation and you see the small step function in there.

You can see how it sort of just steps up a little bit at each pulse and then it accumulates all of this sleep current here and you get a final value. Look where it's changed our scale a bit to millivolt seconds here. but it's showing twelve Point One, Six millivolt seconds, which are, of course, because of the microcurrent we can translate that to were twelve point one milliamps average over an entire second. But and I think it's reading a bit higher because there's noise down in here.
It's going to have too much noise down in there, which you know it's just that may not be the device under test. so you just have to be careful when you're doing these sorts of measurements to. You know, if you want to do this period here, you would have to sample that separately and add it up. but we're going to use just the multimeter to get our average figure right down at that value.

And then. so we're only using our Silla scope to get these current pulses here. so there's several different ways to do it. You've got to be careful that you're not being trapped into reading that directly because you could find that there were.

We will find that that value is are much higher than what it realistically would be. So we can use our multimeter here just to get like an average figure and like, over the macroscopic time scale. and we can set like min max if we really wanted to. And then we could like take the average value four point, seven.

Something like that. We could maybe round it up to five millivolts, for example, over the macro time period because we're talking about a very large difference between that very short current pulse and the rest of it. So let's just say it's five millivolts. And of course, the micro current here is set to one milli volt per micro amp.

So that translates to four Point Six. Or let's as we said, round it up to our five micro amps. Just you know, a generic sleep power consumption. And by the way, with these integral units of volts seconds.

or in this case, micro volt seconds. don't confuse that with volts per second. they are actually different. Volts per second means a rate of change.

You know, a differential DV DT You know, a capacitor or charging or something like that. A volt second like we're talking about here is entirely different. It's we're talking about accumulated energy over time. That's basically what it is entirely different to a rate of change over time volts per second.

So just don't confuse them. Be careful it can you know It's very easy to mix the two up. So with the value of 700 micro volts seconds, what that basically means if we spread all of the energy under that curve there, which we're getting in 4 milliseconds, if we spread that over 1 second, 1 full second, it would average a value of 700 micro volts for that one second. Now, because we got units of micro volts seconds there.

Well, we've got our unit of time 1 second. so it makes sense to deal with 1 second from here on end as our defined time period for calculating our total current. So that's what we'll do now. You could convert over other time periods, but it just makes sense to go over a second.

So that's what we'll do now. So at this point, all we're doing is looking at the total value. They're effectively the peak value, which is the accumulation of all that area over time. so it doesn't actually matter if we choose a longer time period.
Assuming that this thing flattens out, it doesn't matter. We're only talking about that peak value there. We could go a bit long and see it's still trying to ramp up a bit, but we're pretty close. Just for argument sake.

Today, we'll say that we've got our 700 micro volt second mark, so that's all the energy in our pulse. So now all we have to do is add that energy to the energy that we measured average with the multimeter over the rest of the time period And bingo, we can get our total current consumption. So what have we got here? We got 700 microvolt seconds and because we're using the micro current, it's equivalent and translates to micro S because we're using the 1 mil volt per micro amp range. So 700 micro volts second is equivalent to 700 nano amp seconds, or an average figure of 700 nano amps.

That energy we saw is spread over an entire second. So what we can do is now draw a graph because our microcontroller only wakes up every 2 seconds as we saw. Then effectively, we measured the average current of photo you know, around about 5 micro amps there. We could measure it more accurately and get more fussy and stuff like that.

But let's just say for argument's sake, 5 micro seconds average current over that time. Then during that 1 second, then assuming a one-second period, we've got to add on that 700 nano amps that we got from the energy consumed during that big pulse when the microcontroller started up. So you can see it's not a very large percentage, but you know it's a reasonable error if you didn't sort of take that into account and you can see that that's over one second and then for the next second. Just for Argument's sake, we're going to there was no pulse we're not accounting for the pulse there, so we only get our 5 micro amps it.

You know it's just a way to look at it. It's just like a visualization tool. There's different ways to do this. But anyway.

Um, so we can say that 700 nano amps is going to average to half that value or 350 nano amps over the two-second period before that pulse starts again. So our total current consumption of our micro controller we can say is five Point Three five my cramp. So you can see that that rather large pulse really didn't have a huge effect in the power consumption in the average total power consumption of our device. So I Guess this wasn't the best example.

Because our pulse, you know we didn't we could measure it as accurately as we wanted. We use the integration method which gets us the total area under the curve and it turns out to be you know, a relatively small percentage of our overall power consumption. But hey, you know this is just the technique used and this is the proper way to do it if you want to measure your total power consumption for your product like this that uses these types of pulses. Now I was showing you how to do this using the integration function math function here.
But as it turns out, this Agilent X-series actually has a measurement function. Not a math function, but a measurement function If we go in there and you're used to all these, you know you can measure your peak to peak maximum amplitude. You know, average, blah blah blah Rms, all that. sort of.

Just if you go right down here, check this out. look area over the full screen, look at area over number of cycles or area over full screen. So area over the number of cycles is would basically give you an instant read out of your microcontroller of the total power consumption in your microcontroller if you had Aa the if you had the dynamic range as I said. But so we can go in there and we can choose what.

Let's go in there and go full screen. but then we can actually choose the value that we actually want and there you go at the moment. it's giving us a readout of 525 micro volt seconds there. and of course we can expand the time base and actually get the full figure just like we got before it.

Actually there's another neat thing. we can go into the zoom function here and then we can expand that window because we've selected measure over the full window. So then we could go in there and choose our window. and if you wanted to, you can press that and go into your Vernier and actually get exactly the time period that you wanted to so over the full screen so you can adjust that just you know.

Rather, finally say if you wanted the pulse, you know from there to there or whatever, you could go in and actually tweak that and get a full value there. And they go. it might be you know, four hundred and something, but well, it does exactly the same thing that we did before. So as you can see, we've got our math functions completely turned off.

so it's not getting the integral, it's actually calculating the area under the curve and it knows how to do that. It's a very similar time period to what we had before. I Think and look, we're getting very similar to the accumulated value we got before it's 663. There might be a bit error because I haven't exactly got the same period or something like that, but there you go.

you can get exactly pretty much that. Well, you can get exactly the same reading using that area under the curve measurement function if your scope supports that. This one happens to, but not all do that. So although we had a relatively large current spike here of in this case are around about 1.4 million, switch is actually quite large for the microcontroller startup do that sort of processing compared to our average our you know value which is down in the noise here of five microns which we measured on our multimeter and that current pulse is relatively high.
but it overall over the span of that two seconds doesn't really add a huge amount to the overall current consumption of the thing. And yes, with the calculations, I just did. Technically, I should have subtracted the time taken from that, but we were like, you know, the pulse that was only four milliseconds is like a couple of orders magnitude less than the total time period, so you know you wouldn't bother adding that sort of stuff in. So there you go.

That's some reasonably accurate calculations of total power consumption of a micro controller. So I hope you found that useful. And then you can. You know a play around with these integration functions.

They're not just there for looks, they actually have these sorts of mathematical operators Can really have some useful practical applications like this and other ones you might get like the half power point in a communications system or something like that. There's various other uses for the integration method which I won't go into, but this is one particularly nice example. So I hope you enjoyed that. And if you want to discuss it, there will be the Eevblog forum link down below or leave it in the comments.

and if you liked the video, please give it a big thumbs up. Catch you next time you you.

Avatar photo

By YTB

21 thoughts on “Eevblog #662- how why to use integration on an oscilloscope”
  1. Avataaar/Circle Created with python_avatars sirixman says:

    Speech very chaotic. This movie is disappointing.

  2. Avataaar/Circle Created with python_avatars PMKKO says:

    current or coulombs?

  3. Avataaar/Circle Created with python_avatars jagau says:

    Charge over time Q/T is accurate and usefull to mesure power, thanks Dave great video

  4. Avataaar/Circle Created with python_avatars ooltimu says:

    You gave me a little heart attack with that marker on the scope screen. Only after I realized that you used a transparent sheet.

  5. Avataaar/Circle Created with python_avatars k4qdex says:

    really bad explanation of integral/power consumption…

  6. Avataaar/Circle Created with python_avatars Phasor Systems says:

    Build your electrical circuits on the go! hunt for androidcircuitsolver on google

  7. Avataaar/Circle Created with python_avatars JTB says:

    Fascinating

  8. Avataaar/Circle Created with python_avatars Dean Greenhough says:

    Great help to get me started, thank you

  9. Avataaar/Circle Created with python_avatars kay bhee says:

    thank u again ,,, no one else including keysight can explain this

  10. Avataaar/Circle Created with python_avatars ziplock9000 says:

    Integral on the DS1054Z is almost useless. It's horizontal resolution is so low it always seems to be a linear line no matter what waveform you have.

  11. Avataaar/Circle Created with python_avatars Matthias H. says:

    Thank you very much for this video.

  12. Avataaar/Circle Created with python_avatars Alex C says:

    In this video Dave will show us how to draw on your oscilloscope with a whiteboard marker.

  13. Avataaar/Circle Created with python_avatars Nick Hill says:

    For this specific purpose, it may be easier, cheaper and more accurate to calculate the integral using a large capacitor and suitable resistor. For example, a 4700uf capacitor and a 10K resistor has a 47 second time constant. It'll take 5 minutes to stabilise. Measure steady state voltage across resistor without circuit connected to zero capacitor leakage. Connect circuit, give a few minutes to stabilise then read off voltage delta. Use Ohm's law to calculate current.
    This would not be effective for larger currents and longer times, where the technique shown would be better.

  14. Avataaar/Circle Created with python_avatars Derun Karabeyoglu says:

    Great !!!

  15. Avataaar/Circle Created with python_avatars mrnuke says:

    Instead of the fluke, why not use your vintage HP 3457A with 100NPLC. That gives an integration time of 2 seconds (how convenient), with essentially 25 bits of resolution.

  16. Avataaar/Circle Created with python_avatars Kevin Pilgrim says:

    I would like to know if I integrade the voltage at CH1 I will have a function f(t) . Now I have need to get the integraded from on a x-y plot . I have the same Oscilloscope as you

  17. Avataaar/Circle Created with python_avatars Dean Greenhough says:

    Very helpful. Just bought a scope and have looked with interest at the math functions. Does anyone know if a good tutorial explaining these functions and how to apply them in the real world, much like this one exists?

    I'm mainly interested in micro controllers and power consumption of these devices.

    I thank you in advance, Dave video was a real help. Thank you

  18. Avataaar/Circle Created with python_avatars PIXscotland says:

    Marker pen on your scope = WIN.

  19. Avataaar/Circle Created with python_avatars Ryan Vasquez says:

    LOL i started to smell the expo marker when you started to draw on the transparency LOL

  20. Avataaar/Circle Created with python_avatars Shitmusket says:

    could someone explain to me why dave took in the discharging of the capacitor to calculate the power consumption ? or did i get something wrong ? since i am a noob at this wizardry

  21. Avataaar/Circle Created with python_avatars kibi15 says:

    I deal with this sort of thing daily in the Amps range. The 12W magnetic door lock on my lab is a real problem in terms of energy consumption over 24 hours on my off-grid solar powered lab. However, and 800W circular saw, 1KW reflow oven, 900W drill press and 500W lathe are absolutely no worry due to the very short timespan that they actually draw that energy.

Leave a Reply

Your email address will not be published. Required fields are marked *