Measuring current only

good evening everyone !
Im using the YHDC sct-0013-000 current type CT and the sample code and hardware provided on this site. Can i know what is the meaning of the number inside the bracket based on the provided cosing fromthe open energy monitor… here is the coding

#include "EmonLib.h"
// Include Emon Library
EnergyMonitor emon1;
// Create an instance
void setup()
{
  Serial.begin(9600);

  emon1.current(1, 111.1);             // Current: input pin, calibration.
}

void loop()
{
double Irms = emon1.calcIrms(1480);  // Calculate Irms only
Serial.print(Irms*230.0);	       // Apparent power
  Serial.print(" ");
  Serial.println(Irms);		       // Irms
}

so what is the value 1480 means?

double Irms = emon1.calcIrms(1480)

thank you guys

hopefuly

Look at the code and the comments in emonLib.cpp to see exactly how emonLib works and what is needed.

The number (1480) is no longer optimal. The sampling rates, measured with a standard emonTx V3.4 (and the emonPi is the same processor) are:
calcIrms( ) - approx 5588 current samples per second.
calcVI( ) - approx 2535 pairs of voltage & current samples per second.

See Sampling rate of emonLib for more information.

@Robert.Wall May i ask how did you accomplish the test to know how much samples the emonTx process in 1s ?
In the code , the loop has no clear timing , it only depends on the HEX instructions after compilation of the code !, Have you count the HEX instructions in the loop section to determine the frequency ?

Thank you

I found the answer here

It’s always a good idea to search for the answer BEFORE you post the question.

3 Likes