Académique Documents
Professionnel Documents
Culture Documents
APPENDIX A
Source Code
#include <LiquidCrystal.h>
int relay_1 = 7;
int relay_2 = 8;
float nano = 1 * pow (10, -6); // Multiplication factor to convert nano seconds into
seconds
float pf;
float angle;
float pf_max = 0;
float angle_max = 0;
int ctr;
65
void setup()
pinMode(pin, INPUT);
pinMode(relay_1, OUTPUT);
pinMode(relay_2, OUTPUT);
Serial.begin(9600);
lcd.begin(16, 2);
void loop() {
// 1st line calculates the phase angle in degrees from differentiated time pulse
// Function COS uses radians not Degree's hence conversion made by dividing
angle / 57.2958
pf = cos(angle / rads);
}
66
//profiling part
digitalWrite(relay_1, LOW);}
digitalWrite(relay_1, LOW);
digitalWrite(relay_2, LOW);
digitalWrite(relay_2, LOW);
67
digitalWrite(relay_2, LOW);
delay(5000);}
Serial.println(pf_max, 5);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("PF=");
lcd.setCursor(4, 0);
lcd.print(pf_max);
lcd.print(" ");
delay(500);
angle_max = 0;
}
68
APPENDIX B
Reference
[1] Y. Gao, A. Schay and D. Hou, "Home appliance detection from aggregated
energy consumption data on a single circuit," 2017 IEEE
(SmartWorld/SCALCOM/UIC/ATC/CBDCom/IOP/SCI), San Francisco, CA, 2017,
pp. 1-8
[4] M. Ito, R. Uda, S. Ichimura, K. Tago, T. Hoshi and Y. Matsushita, "A method
of appliance detection based on features of power waveform," 2004 International
Symposium on Applications and the Internet. Proceedings., Tokyo, Japan, 2004, pp.
291-294
[5] Alexander, C.; Sadiku, M. 2013. Fundamentals of Electric Circuit, fifth edition.
Mc Graw hill companies Inc., 1221 avenue of the Americas, New York, NY. ISBN
978-0-07-338057-5