Good day, apologies if the title is confusing as I'm not yet knowledgeable about Arduino Uno's functions.
A project I'm doing for school involves using an Arduino UNO, an OLED, and a CT and PT to create an energy meter but the issue is, is that the current and voltage input readings are out of phase and I am unable to reach my desired wattage for the load I've connected it to. Attached below is the voltage and current waveforms with voltage and current being blue and red respectively.
I wish to know if it is possible to phase shift the Current readings to be able to make it in-phase with voltage without adding additional components?
I had the idea that perhaps I could be able to phase shift the current by delaying its analog readings by a certain amount but so far I've no luck.
Attached is the code for obtaining the analog readings:
void setup() {
Serial.begin(115200);
}
void loop() {
int sensorValue = analogRead(A0);
delay(500);
int sensorValue2 = analogRead(A1);
float voltage = (sensorValue - 87.978) * (5.0 / 1023.0); // -87.978 to center the voltage to 0
float current = (sensorValue2 - 484.902) * (5.0 / 1023.0); // -484.902 to center the current to 0
Serial.print(voltage); Serial.print(",");
Serial.println(current);
delay(1);
}
Do tell if I shouldve posted other essential details as this is my first time using this forum. Thank you!
It was my attempt but when observing the serial plotter, it took a long time to see a plot of the waveforms and wondered if I was approaching the problem the wrong way
Hi,
If your phase shift needs to be 180degres, then swap the coil connections on the current transformer.
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
I needed to shift readings to be able to accurately obtain Real Power without any losses, the problem being was how much time I needed to delay for current to be in-phase with voltage
You are taking a single reading of the voltage/current at some random point in the 60Hz mains cycle, and expecting that single reading to be "representative" of the 60Hz waveform.
What you need to do is take multiple readings in quick succession throughout at least one whole mains cycle, and from those readings calculate the rms value of the voltage/current.