I’m trying to calculate the energy in KWh on emon and extract this value into variable…
Emon gives each loop the power value, right? But what is the time passed each loop? how could I implement the time value in this code to get the energy?
…
realPower = V_RATIO * I_RATIO * sumP / numberOfSamples;
apparentPower = Vrms * Irms;
powerFactor=realPower / apparentPower;
realEnergy = realEnergy +(realPower ???);
Any help will be welcome!