HI,
So, i work in an industrial setting, and have a powder mixer connected to a magnetic Amp meter which is connected to one leg of a three phase supply via an 80A/5A CT. This is just to get general idea of current draw. When more precise information is needed, i just hook up a DMM in series to measure the amps.
Recently i got the idea of connecting a Grove ±5A DC/AC Current Sensor permanently in series with the analogue meter, so that I could data log I've used these in a few single phase AC and DC applications, and has always agreed with the DMM. However, when connecting it up to the CT it reads almost ( but not quite) 3X as much as the DMM.
this is the AC current sensing code from the supplier:
[ code ]
#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
#define RefVal 3.3
#define SERIAL SerialUSB
#else
#define RefVal 5.0
#define SERIAL Serial
#endif
//An OLED Display is required here
//use pin A0
#define Pin A5
// Take the average of 500 times
const int averageValue = 500;
long int sensorValue = 0;
float sensitivity = 1000.0 / 200.0; //1000mA per 200mV
//float Vref = 244;
float Vref = 1494;
void setup()
{
SERIAL.begin(9600);
}
static float tempval;
void loop()
{
// Read the value 500 times:
for(int i=0;i<20;i++)
{
for (int i = 0; i < averageValue; i++)
{
int temp;
temp= analogRead(Pin);
if(temp>sensorValue)
{
sensorValue=temp;
}
delayMicroseconds(40);
}
tempval+=sensorValue;
}
sensorValue=tempval/20.0;
tempval=0;
// The on-board ADC is 10-bits
// Different power supply will lead to different reference sources
// example: 2^10 = 1024 -> 5V / 1024 ~= 4.88mV
// unitValue= 5.0 / 1024.01000 ;
float unitValue= RefVal / 1024.01000 ;
float voltage = unitValue * sensorValue;
//When no load,Vref=initialValue
SERIAL.print("initialValue: ");
SERIAL.print(voltage);
SERIAL.println("mV");
// Calculate the corresponding current
float current = ((voltage - Vref) * sensitivity)*0.707;
// Print display voltage (mV)
// This voltage is the pin voltage corresponding to the current
voltage = unitValue * sensorValue-Vref;
SERIAL.print(voltage);
SERIAL.println("mV");
// Print display current (mA)
SERIAL.print("current: ")
SERIAL.print(current);
SERIAL.println("mA");
SERIAL.print("\n");
// Reset the sensorValue for the next reading
sensorValue = 0;
// Read it once per second
delay(1000);
}
[ /code ]
I'm aware I could simply divide the result by 3, to get a rough approximation; but this is a gap in my knowledge id like to fill. Does anyone know what changes I'd need to make to the code, or at least some ideas for me to tinker with.
Additionally, I can see the *0.707 and am aware this is to do with RMS of single phase, but as I say I'm not sure if that needs to be (1.73? if I remember) or if that is irrelevant for what I'm looking at.
Thanks for at least reading my post.