# Calculating energy from an oscilloscope plot of a current spike

#### dvears

Joined Feb 19, 2019
3
Can any one help me with this? I have a plot of a short current surge on my oscilloscope. The surge was measure by sampling the voltage across a shunt resistor using a differential scope probe. I want to calculate the total energy in Joules over the period of the surge. I know the energy is power over time and power is I^^2R or V^^2/R where R is the shunt resistance. I discovered the scope does have an integration maths function. How can I do this correctly?
Any comment or suggestion will be appreciated.

Joined Mar 10, 2018
4,057
Do a visual approximation using the graticle to integration. or cut
out a strip of paper of fixed narrow width and do the integration
segment by segment over time. Or use Simpsons rule.....

Regards, Dana.

Last edited:

#### AlbertHall

Joined Jun 4, 2014
11,401
You have the information to calculate the energy from the spike dissipated in the shunt resistor.
If the shunt resistor is added in series with a load and you want the total energy in the spike then you will also need a plot of the total voltage.

#### dvears

Joined Feb 19, 2019
3
Thanks for your responses.The resistor is 0.1 ohms in series with an LED load running off 240V mains. Duration is short in microsecond range. Attached is a capture with a x1/100 probe attenuation setting. And the layout I use. Can I use the integration function of the scope somehow.

#### pmd34

Joined Feb 22, 2014
520
As you say the Energy is Power x Time. So in your case you need the sum of all the little strips of Power x duration added up
This is however the integral of V^2/R (dt). I suppose you could calculate it by: ( the integral under your voltage curve/R)^2/(total time)
(Dividing it by t will remove the extra t you baked in when you squared the whole integral).

Ah I see from your scope trace, the problem will be that it goes negative also, so the total integral your scope will give you will be almost zero (the negative peaks canceling out the positive ones).

You could export the data as CSV (I see the option!). Load it into a spread sheet, calculate the your voltage squared with time, divide it by R, plot it and then get your computer to integrate under the curve. Then you should get the answer!

(or to avoid the need for the graphing.. take the average value of two adjacent points, and multiple it by the time interval between them, then sum all these values).

Last edited:

#### dvears

Joined Feb 19, 2019
3
Yes that makes sense - thank you.

#### sparky 1

Joined Nov 3, 2018
565
Can any one help me with this? I have a plot of a short current surge on my oscilloscope. The surge was measure by sampling the voltage across a shunt resistor using a differential scope probe. I want to calculate the total energy in Joules over the period of the surge. I know the energy is power over time and power is I^^2R or V^^2/R where R is the shunt resistance. I discovered the scope does have an integration maths function. How can I do this correctly?
Any comment or suggestion will be appreciated.
Very few people ever question the oscilloscope's math function for measuring this.
In helping people discover if there was energy gain in a spike circuit I made an ultra simple spike circuit.
The circuit begins with a symmetrical sine wave then converts it to a spike, which I call this spike the depleted wave.
The goal of the project is to visually detect when the depleted wave absorbs energy. Other applications could be
derived for someone interested in exploring the nature of spikes. #### MrAl

Joined Jun 17, 2014
8,382
Can any one help me with this? I have a plot of a short current surge on my oscilloscope. The surge was measure by sampling the voltage across a shunt resistor using a differential scope probe. I want to calculate the total energy in Joules over the period of the surge. I know the energy is power over time and power is I^^2R or V^^2/R where R is the shunt resistance. I discovered the scope does have an integration maths function. How can I do this correctly?
Any comment or suggestion will be appreciated.
Hi,

If the waveform follows some simple geometric figure like a triangle or is very close to that shape then you can calculate that easily. But if it has an unusual shape then you have to break it down into pieces and do each piece individually and sum the results.

Since the power is I^2*R and we will know the time from the horizontal axis, we can do small pieces of the waveform and sum those results.
The easiest way is to use rectangular sections but you could use triangular sections and then get quadratic accuracy over bigger sections.

So say the first segment is rectangular and is 2 amps high and 1ms wide and the resistance is 0.1 Ohms. The power is:
P1=2^2*0.1=4*0.1=0.4 watts
The time is 0.001 so the energy for that one segment is:
W1=0.4*0.001=0.000400 Joules.

Now say the second segment current is 3 amps, and the time is 0.002 seconds.
The power is:
P2=3^2*0.1=9*0.1=0.9
The time is 0.002 so the energy for this segment is:
W2=0.9*0.002=0.001800 Joules.

The total so far is:
WT=W1+W2=0.000400+0.001800=0.002200 Joules

As you do more and more segments this will rise.
For a segment that goes negative, it does not change the sign of the energy because we square the current.
So say the 3rd segment is -2 amps for time 0.001 second, then the power is:
P3=(-2)^2*0.1=4*0.1=0.4 watts
and the energy is the same as it was when the current was positive:
W3=0.4*0.001=0.000400 Joules

Make sense?

Another way to do it is to take down a bunch of points (x,y) and really you have to do that anyway, but then do a curve fit. Once you have the curve you can handle it as a function. This takes a little more work but is very useful if you encounter the same unusual shape over and over again where only the amplitude or total time (or both) changes but not the shape.

I remember having to actually do this a few times long time ago when we had converters that had low efficiency and we had to investigate why. We had to look at power in the bridge transistors to see if the switching times were causing too much dissipation in the transistors. We had to extract that information from the current and voltage waveshapes.

Also, to do a sloping section you could take the average of the two endpoint readings and use that as the reading just to keep it simple, or do a piecewise calculation of a true sloping section and use that as your template for the other sloping sections.

Last edited: