Energy Measurement Techniques

Helllo people,

What is a good technique in energy measurement? I'm going for the Amp-hour calculation. Right now my technique is to get the loop time (loop_time = millis() - last_loop_time;) and then multiplying the time(converted to hours) with current(amps). It is like sampling current every loop time. Is this correct? Or is there a better solution?

Thanks

Basically you are "integrating". Do you remember Calculus from school-days?

There are basically three methods:

  • You sample, and assume the value is constant between sample times: (tb-ta)*x(tb)
  • You interpolate between sample values: (tb-ta)*(x(tb)+x(ta))/2

The second method is generally not worth the effort. The sample time should rather be selected so that there is LITTLE change between the samples. This can also be enforced by external hardware (low pass filter).

If you know more about the expected shape of the signal you can sample less often, using methode 2, or a variant.

A third methode (FFT) is mathematically more demanding. It allows to know arbitrary signals upto a frequency of f by sampling with 2/f only. If you had to scan a sine correctly with method 1 or 2, you would need 20 to 100 samples in a period.

Thanks for those methods. Currently I'm using method 1 and I think method 2 would be enough to give more accuracy especially during current ramps. Well for method 3, I don't know if we covered Fourier in calculus or I'm just asleep or not paying attention :-[, thanks for the info anyway.

Just a remark: If you have changing voltage, or even a more or less standard AC signal you must consider the exactly timed product of voltage and current, not current only.

From a higher point of view this is called phase relation.
In another context you touch something here called (true) RMS....

You only actually pay for the power that you use that is projected onto the real axis of the phaser diagram (nothing to do with Star Trek). This means that if you measure the phase between current and voltage you have two powers, one that you pay for and the other you actually use.

In a domestic environment you are not monitored for the phase angle or power factor. In an industrial set up you are and the electricity company makes you pay more for power drawn at a large phase angle. They have phase angle measuring meters and many factories have banks of capacitors so they can correct the phase angle to minimise the tariff paid.

You only actually pay for the power that you use that is projected onto the real axis of the phaser diagram

Like Grumpy Mike said, you'll need to measure the power factor of the load in order to get accurate results. The product of the amp and voltage is only correct for pure resistive load (power factor = 1).

The product of the amp and voltage is only correct..

The momentary product of voltage and current is always correct....

Depends on what you mean by 'correct', it is not a measure of the power but it is a measure of the power projected on the real axis, that is the power you pay for. But that momentary measurement has to be aggregated over the whole of a mains cycle to get anything meaningful from it. Then you run into the choice of a scaler product or a vector product.

By far the easiest and most accurate way to measure energy use is to 'read' the actual meter(s). The power factor is presorted for you. I gave up trying to get sane readings from measuring current and voltage a long time ago. Both the electric and gas(try measuring that with voltage and current :wink: ) on my system are within 1% of what the meters read in the long term

http://pluggy.is-a-geek.com/

@Pluggy: This is true. It will be not enough to connect "something" to the Arduino's analogue pins. You have to consider a lot of factors, especially when higher frequencies (and I should say >10kHz) are involved.
A main factor rarely consider is, that the USB gives you hardly 5 Volts but rather 4.8 to 4.9V. This can be easily compensated for but I think very few do it. To measure voltages with 1% accuracity on the Arduino is very, very good.

@Grumpy - Also true. You have the magnetic field and Ohm's dissipation... Except for really high current and some switching applications, of RF, the "real" impedance" is overwhelming. Luckily 160 years ago a certain Mr. Joule had THE idea: The energy transfered from electrical current is equivalent to the rise of temperature in an insulated pot of water through which this current flows...

This looks like a (wet) challenge for Arduino addicts...

You've got some great discussion over there, but I'm actually measuring a DC signal from a switch mode power supply. I will be using this data to know what battery size(Ah rating) could replace the current power supply if in case I need to in the future. Thanks.. :slight_smile: