Hi, nice to meet you all here.
Working on a smart energy meter project using the Arduino Mega 2560. Currently able to sense the input current from a normal wall socket outlet using ACS712 current sensor.
I was scratching my head through the calculation of the I_rms from each cycle of a input power supply. Problems come in when:
1. As far as I concerned, calculation of I_rms= (I_peak)/(sqrt2) for half a cycle but I noticed that the result I am getting are discrete signals. Is the formula appropriate for this situation?
2. .txt file attached bellow is the source code use in Arduino IDE to read the current and calculate the I_rms. I am pretty sure there are errors in writing the code between the "if (amps > 0).....till... Serial.print(I_rms);" Feel free to point out my error and correct my mistakes.
TQ.
Working on a smart energy meter project using the Arduino Mega 2560. Currently able to sense the input current from a normal wall socket outlet using ACS712 current sensor.
I was scratching my head through the calculation of the I_rms from each cycle of a input power supply. Problems come in when:
1. As far as I concerned, calculation of I_rms= (I_peak)/(sqrt2) for half a cycle but I noticed that the result I am getting are discrete signals. Is the formula appropriate for this situation?
2. .txt file attached bellow is the source code use in Arduino IDE to read the current and calculate the I_rms. I am pretty sure there are errors in writing the code between the "if (amps > 0).....till... Serial.print(I_rms);" Feel free to point out my error and correct my mistakes.
TQ.
Attachments
-
912 bytes Views: 22
-
37.2 KB Views: 25
-
283.9 KB Views: 18