[[TOC(Hardware*, depth=3)]] == '''Orbit Power Monitoring''' == ''(By: Pavan A. Desai)'' ---- '''Goal:''' The overall goal of this project is to measure and monitor the power consumption across each node in the ORBIT test bed by effectively mapping each node to the proper breaker switch on the breaker board. [[BR]] ---- '''Requirements:''' - Mega Arduino Board (Need both Arduino hardware & software for processing purposes) - Arduino Ethernet Shield (Need to connect the Arduino Board to different networks) - ORBIT Power Sensing Platform (Need to measure power) - PuTTY Pageant Software (Used to connect to ORBIT's "Grid Network" from ones PC to observe the collection of data) - PuTTY SSKEY (Used to create a secure shell key for secure data communication, PuTTY Pageant will require it for all ORBIT network connections) - Ruby (Will be needed to parse XML output) [[BR]] ---- '''Overall Operation:''' || [[Image(Overview1.PNG, 600px)]] || || Figure 1: Full View || [[BR]] 1) Total of 4 nodes are connected to one outlet.[[BR]] 2) 2-3 Outlets are connected to a single breaker switch.[[BR]] 3) On the breaker board there is a toroid connected behind each breaker switch.[[BR]] 4) A Brultech Micro-40 Donut Style toroid is used to scale down the current at a ratio of 40A to 26.23mA.[[BR]] 5) The ends of the toroid sensors are connected to the ORBIT Power Sensing Platform.[[BR]] 6) The ORBIT Power Sensing Platform is connected to the Arduino board and shield.[[BR]] ---- '''Power Sensing Platform:''' [[BR]] || [[Image(powersensor.PNG, 600px)]] || || Figure 2: Sensor Board || [[BR]] Once the current is stepped down by the toroid, a 42Ω resister is used to convert the AC current into AC voltage at the entrance of the Power Sensing Platform. Then the AC voltage is converted to DC voltage by going through AD737JNZ chip with a average off-set of 3.364mV between the input and output of the chip. The voltage regulator is used to lower the voltage that powers the AD737JNZ chip to values of ± 2.5V from ± 3.3V. The inverting amplifier with a gain of 4.7 is used to convert the negative voltage value outputted from the AD737JNZ chip to a positive value because the Arduino does not accept negative inputs. Once the signal enters the Arduino analog pins, the Arduino will read the signal at the analog pin and output a resolution reading between 0 to 1023. The Arduino has a 10-bit analog to digital converter so it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. In this project I have used the internal built in voltage of 1.1V instead of the normal 5V in the Arduino board. This change will map the resolution reading between 0 to 1023 for 0 to 1.1V. Then the software part of this project will fix the off-set of the AD737JNZ chip and the scaling factor of the toroid along with adjusting the Arduino to covert the resolution readings to power readings. ---- '''Procedure:''' 1) Connect the Arduino board and Arduino Ethernet Shield to the ORBIT Power Sensing Platform. The Arduino board will be connected to the bottom of the ORBIT Power Sensing Platform and the Arduino Ethernet Shield will be place on the top of the ORBIT Power Sensing Platform as shown below: || [[Image(board.PNG, 400px)]] || || Figure 3: Connection || [[BR]] 2) Upload the following code to the Arduino board from the attachments: {{{PowerSensingCode.ino}}} Note: MAC & IP Address will have to be changed for future sensors along with AD737JNZ chip off-set for each analog pin and proper toroid scaling ratio. [[BR]] 3) Calculations inside the code: [[BR]] {{{ if (analogChannel == 0) {double d= 0.0; d = static_cast(sensorReading); double power = 42 * square((((((((sensorReading/1024.0)*1100.0)/4.700)+2.468)/42)*40)/0.02623)/1000); client.print(power); // Prints out Power Reading in Watts //double voltage = (((sensorReading/1024.0)*1100.0)/4.700+2.468); //Prints out Voltage Reading //client.print(voltage); // Prints out Voltage Reading in Volts } }}} [[BR]] The calculations shown above are only for analog pin 0 out of 12 analog pins, the rest of the pins have similar calculations. When the output from the Power Sensing Platform enters the input of the Arduino board its resolution reading is called the "sensorReading." The sensorReading value is a resolution reading between 0 to 1023 for 1100mV (1.1V), that needs to be converted to double datatype from a integer datatype to proceed with further calculations which are in double datatype.[[BR]] {{{((((sensorReading/1024.0)*1100.0)/4.700)+2.468)}}}[[BR]] First convert the resolution reading into voltage reading by taking the ratio of the resolution reading and multiplying it by 1100mV internal Arduino voltage. Then by dividing out the inverting amplifier gain of 4.7 and adding the AD737JNZ chip off-set of 2.468mV gives us a final voltage reading of the input signal. The off-set for the AD737JNZ chip was calculated individually for each analog pin by testing 10 different AC signals and measuring the input and output of the AD737JNZ chip.[[BR]] || [[Image(IndepPinOff-Set.PNG, 600px)]] || || Figure 4: Chip Off-Set || [[BR]] To view rest of the off-sets download {{{Off-Set-Chart.xlsx}}} from the attachments. The next step is to convert this voltage reading to a current reading by dividing the voltage by 42Ω. Now the current has to be scaled back again by applying the inverse ratio of 40A to 26.23mA to the code and lastly converting the proper current reading to a power reading by the applying the following equation: P = I*I*R. This code will output the data on the web server in XML format. [[BR]] 4) Use PuTTY Pageant Software to double tunnel to the proper network within the ORBIT network. PuTTY SSKEY will be required.[[BR]] 5) Locate the sensor by the IP address in the network and parse its XML with Ruby began to collect data. ---- '''Current Progress:''' The ORBIT grid has total of 400 nodes out of them 301 are functional and 99 are not functional. All nodes are connected to total of 34 breaker switches, approximately 12 nodes to a breaker switch. One Power Sensing Arduino board can only take in 12 breaker switches out of 34, therefore the current sensor has only the first 12 breaker switches connected covering the area shown in the black box below: [[BR]] || [[Image(Node Mapping.PNG, 400px)]] || || Figure 5: The Grid || [[BR]] The numbers in the blue circle above represent each outlet, approximately 3 outlets are connected to a single breaker switch. The outlets are numbered because the outlets have to be mapped to the proper breaker switch. Because 4 nodes are connected to a single outlet, the mapping was done by turning on/off 4 nodes at a single outlet and reading & recording the power the spike at any breaker switch to determine which breaker switch was connected to which outlet. [[BR]] || [[Image(Mapping Results.PNG, 300px)]] || || Figure 6: Node Mapping Results || [[BR]] To view the full results of mapping the first 12 breaker switches download {{{Mapping Data.xlsx}}} from the attachments. The chart shown above displays the results of the first 12 breaker switches mapped to their proper outlets. As shown above except for breaker switch 12, switches 1-11 have total of 3 outlets connected to each of them. This is because outlets 2, 6, 10, 14, 35 and 36 are not connected to any of the first 12 breaker switches. Total of 24 nodes are connected to those outlets that will be mapped to the remaining 22 breaker switches. ---- '''Future Work:''' For future work and development of this project, 3 more sensor circuits will be required to cover rest of the ORBIT grid and the remaining 22 breaker switches will have to be mapped to their proper outlets. Once the entire ORBIT grid is connected the power reading will have to be deaggregated to determine the power status of each node individually. This is because each breaker switch has up to 12 nodes connected to it, deaggregting this data will help answer the following questions and many more: [[BR]] 1) Total displacement for all nodes.[[BR]] 2) Individual power status at a node.[[BR]] 3) Power consumption by user.[[BR]] 4) Power cycle event times per node.[[BR]] 5) Power used during a period of time.[[BR]]