Now I think I’m getting somewhere. There appears to be a port of the emonLib library for the Photon device I’m using.
I’ve had a play but am a little unsure about the values I should be passing in to the functions.
I currently have this which I’m not sure is quite right:
void setup()
{
emon1.current(0, 900);
}
void loop()
{
double Irms = emon1.calcIrms(112);
Particle.publish("current:", String(Irms));
Particle.publish("watts:", String(Irms*230.0));
}
I’m in the UK so from my understanding the mains here is approx 230V 50Hz. After reading another one of your posts (Sampling rate of emonLib) I’ve set the value of calcIrms to 112. When initially testing this with the default calibration value of 111.1 the results were way to low when compared to the load being generated, therefore I’ve had to increase this considerably to 900 in order to match the load I’m using for testing. Is this normal or am I doing something wrong here?