34
62562 Sustainable electronic and IT Window comparasition project Danmarks Tekniske Universitet André Daniel Birkkjær Christensen s127098 Anna Hildigunnur Jónasdóttir s117343 Supervisor: Ole Schultz Associate Professor 11th June 2014 1

62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

62562 Sustainable electronic and ITWindow comparasition projectDanmarks Tekniske Universitet

André Daniel Birkkjær Christensen s127098Anna Hildigunnur Jónasdóttir s117343

Supervisor: Ole SchultzAssociate Professor

11th June 2014

1

Page 2: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

Contents1 Introduction 3

2 Project delimitation and methods 32.1 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Problem formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.3 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.4 Milestone plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.5 Theory and methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.5.1 LCA analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.6 Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.6.1 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.6.2 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Problem implementation 63.1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.2 Hardware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.2.1 Xbee Firmware configuration . . . . . . . . . . . . . . . . . . . . . . . . 73.2.2 Iboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2.3 Power and energy consumption . . . . . . . . . . . . . . . . . . . . . . . 93.2.4 Energy harvesting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.3 Software description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.3.1 XBee protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.3.2 Iboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.3.3 Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.3.4 Nimbits Cloud Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.3.5 Programming resources . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4 Testing 194.1 Unit tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

4.1.1 Xbee end device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.1.2 Iboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.1.3 Nimbits server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.1.4 Solar system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

4.2 Test case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.2.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5 Conclusion and discussion 255.1 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.1.1 The result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.1.2 Power/energy consumption . . . . . . . . . . . . . . . . . . . . . . . . . 255.1.3 Energy harvesting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265.1.4 Test period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265.2.1 Conclusion on the LCA . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.3 Possible future improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

2

Page 3: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

6 Appendices 276.1 C++ source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276.2 Matlab code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

6.2.1 The Matlab Temperature Manipulator (MTM) . . . . . . . . . . . . . 336.2.2 Solar cell load calculation . . . . . . . . . . . . . . . . . . . . . . . . . . 34

1 IntroductionThis project is made in connection with the course Sustainable electronic and IT. In the coursewe have been working with methods of reducing energy consumption in electronics, and waysof improving the environment through electronics and IT. The topic in this project has beenself chosen and executed by us students in groups under supervision of the teacher. In thisproject we have tried to captured most of the topics the has been covered in the course.

2 Project delimitation and methods

2.1 GlossaryBelow is a list of keywords relating to this project.

• Sustainable electronic.

• Temperature measurements

• Xbee/Zbee

• IBoard

• Green energy

• Nimbits

• Solar energy

• LCA

• Energy efficiency

• Environmental awareness

2.2 Problem formulationThe idea behind this project is to measure the quality of a given window seen from an environ-mental aspect. That information can give the consumers a better idea over the environmentaleffect which usually is a tough to grasp. With this document we hope to boost the reader’sattention on this matter and give the reader a fundamental understanding on energy saving.

3

Page 4: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

2.3 Requirements1. The system should consist of three(3) measurement points.

2. There should be a central unit that collects all the data.

3. The collected data should be uploaded to a cloud server.

4. The data should be process in Matlab to get a good visual representative.

5. Energy harvesting from alternative sources should be use in the project.

6. A Life Circle Analyse (LCA) should be produced on a sub system in the project.

7. The XBee technology should be use in the project.

8. A power consumption calculation should be produced for the system.

2.4 Milestone plan

Figure 1: Milestone plan

2.5 Theory and methods2.5.1 LCA analysis

An important step in the process of systematic environmental improvement is to gain insightinto the product’s life cycle. By forming a picture of the whole life cycle of the product, wecan ensure that each stage in the product’s life becomes as environmentally benign as possible.This activity is called product life thinking.

Product life thinking involves an active and systematic charting of every product life stage,together with the various stakeholders and situations that the product is likely to meet duringits lifetime. This broad approach to product development gives the company important insightinto life cycle stages, such as the product’s use stage, early on in the project.When the product life cycle is revealed to the product developer, it is possible to identify en-vironmental problems and potential solutions for the whole life cycle. But other stakeholdersfrom the company must also join in. As the environmental demands on a company’s activitiesand products increase, product life thinking can be used to ensure that the company’s envir-onmental responsibility is integrated into the manufacturing processes, logistics and also theactual use of the products which are launched onto the market. It is obvious that by adopting

4

Page 5: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

a focus on the whole product life cycle, new competitive dimensions or even whole businessmodels can be formed. In order to spot potential environmental impacts, it is important tovisualize the product’s life cycle, based on a concept for the various situations and stakeholdersthat the product will meet throughout its lifetime. Each product life stage should describeboth the product and all related activities in order to create a picture of resource consumptionand the root causes of environmental impacts.

LCA stands for Life-cycle Assessment or Life-cycle analysis. It is an ecobalance technique thataims to give an overview over the total environmental footprint of a product. That is from theraw material extraction form earth to the disposal or recycling of the product.

Typical causes and resultant environmental impacts:

• Energy consumption will typically cause acidification, greenhouse effect, nutrients loads,and human toxicity. It will also generate waste types such as slag, ashes, and radioactivewaste.

• Consumption of materials will drain resources and generate certain types of waste.

• Consumption of chemicals will often cause environmental impacts such as toxicity forhuman beings and the environment as well as photochemical generation of ozone.

The use phase analysis is not relevant in the case of the Xbees, since there are no consumablesor cleaning involved. There would though be possible case of maintenance with additionalreplacing of spare parts, but in most cases today electrical hardware is not maintained, it issimply replaced and that would lead us to the disposal phase.

The Danish Institute for Product Development and dk-TEKNIK have developed the MECOprinciple in co-operation with a larger Danish project. The use of the principle is describedin “Handbook for Environmental Assessment of Products” (Pommer et al., 2001), which is in-tended for small and medium-sized companies. The principle divides the assessment into fourareas in accordance with the underlying causes of the product’s environmental impacts. Theseareas, which have given the principle its name, are Materials, Energy, Chemicals and Others(Wenzel et al., 1997).

LCA Input resources[mPR/kg] Production[MJ] Renewable [MJ] Transport[MJ] Netto energy consumptionThe chip 0,0271 1,79779589 0,130634272 0,0042 1,6713616Voltage Regulator 0,0140 0,47186094 0,034201713 nA 0,4376592Antenna 218,4354 7403,59863604 531,79061 nA 6871,808PWB 3,10369E-12 5,32735110 0,386027256 2,52451E-06 4,94E+00Connector pins 0,00000396 0,04931326706 0,0029706 nA 0,0463427Faradays cage 0,0011 0,135286 0,023874 nA 0,111412Total 218,477604 mPR/kg 7411,380243 MJ 532,36832 MJ 0,0042 MJ 6879,0161 MJ

Table 1: LCA analysis of an Xbee chip

5

Page 6: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

2.6 ResourcesThe resources listed below includes all the parts and software used to create or test this project

2.6.1 Software

• Mathworks Matlab 2013

• Atmel Studio 6

• Digi International X-CTU 6.1.0

• TeXworks Version 0.5 r.1286

2.6.2 Hardware

• Agilent VEE DSO 7014A Oscilloscope

• Agilent VEE 33521A Function generator

• B&O SN16A Power supply

• BBC MA5D Digital Multi-meter

• Itead Iboard

• Itead FOCA FT232RL

• Sparkfun XBee Breakout board

• Microchip MCP9700 Linear Active Thermistor

• Digi International XBee S2

• Texas Instruments bq25504 EVM

• Voltaic Systems Large 6V 3.4W Solar panel

• 35F electrolyte capacitor (2.7V)

3 Problem implementationThe implementation of the system consist of two parts namely the data collection part wherethe data is physically collected in a central unit from sensors in different strategically locations.Firstly at the target window, secondly outside the window and finally inside the room. Thesecond part is the data processing part where the collected data is manipulated in order tobe displayed for the user in a visual way so that the user will be able to easily obtain a goodunderstanding and overview over the test. Furthermore the user should be presented with theresult in an energy saving matter through cold facts.

6

Page 7: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

3.1 Block Diagram

Figure 2: Blockdiagram

3.2 Hardware description3.2.1 Xbee Firmware configuration

The four XBees used in this project is configured in digi’s X-CTU tool. This tool allows us toconfigure the Xbee to be in different modes such as coordinator, end device and router mode.We have also access to a numbers of parameters that can change the operative behaviour ofthe xbee. In our system three of the four XBee’s are configured to be end devices and is takingcare of the transmission at the sensor end of the system. On each of the end devices is aanalogue temp sensor connected to one of the four Analogue to Digital Converters (ADC). TheADC converts the voltage from the sensor into a 10 bit digitized representation that can besend. The end device XBee’s are powered by two 1.5V AA batteries so that the total supplyvoltage is between 2.8V to 3.1V. The last Xbee is configured to be a coordinator witch roll isto collect data from all three end devices. The coordinator is inserted directly into the Iboardin a special designed Xbee header socket. In this way we are able to get access to the datapackages from the end devices directly on the Iboard to further processing.

In our system all the end devices are configured to be in sleep mode witch means that they willwake up in a given time interval. When the end device has become awake we control for howlong it shout be awake and what tasks it shout preform during the time it is awake. The enddevise wakes up and sends a ADC sample containing the temperature data, 64byte addressof the Xbee and so informations about the package structure such as length, package typeand a checksum. All this data is wrapped in a predefined API responds called a IO samplewitch is included in the standard Xbee protocol. After the sampled data has been send to thecoordinator, the Xbee sends a request to the coordinator asking if it shout carried out furthertasks, if that isn’t the case the end device goes to sleep again. Each data burst the end devicesends has a transfer time of 108 ms. That means that the end device is making a sample andtransmitting the data in a time window of 108ms. Below it a time domain measurement of one

7

Page 8: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

data burst.

This measurement is made over a 1Ω resistor inserted on the plus side of the power supply.

Figure 3: Xbee

Below is a list containing the parameters we use in our system. Only the parameters thatdifferers from the standard settings are included.

• SM Sleep mode = 04

– Sets the Xbee in cyclic sleep mode

• ST Time before Sleep = 10ms

– Sets the time that the Xbee is awake.

• SP Cyclic Sleep Period = 7D0 = 2000ms

– sets the sleep time (time between wake ups)

• SN Numbers of cyclic = 01E = 29

– This parameter is a multiplier for the SP parameter

• D0 Analog-digital converter enable on channel 1 = 02

– Enable the ADC on channel 1

• IR IO Sampling rate = 3ms

– Controls the time between each ADC samples.

With these settings the end device wakes up every 10 minutes and perform a sample withvoltage returning from the temperature sensor and transmit it wireless to the coordinatorlocated on the IBoard.

8

Page 9: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

3.2.2 Iboard

The IBoard by Itead is a platform that provides a bridge between the XBee domain and theInternet. On the IBoard is a programmable ATMega 328P MCU that takes the roll of placeholder in the system and makes is possible to get data from the end devices through the co-ordinator xBee that is placed in a socked on the IBoard and subsequent process the collecteddata. The Wiznet W5100 chip allows us to send the data over Ethernet and in that way aneasy access to the Internet.

The Iboard can be use as a stand alone unit with a Ethernet connection to the Internetor connected to a host pc that provides the Internet connection. If using the Iboard with ahost pc we have the possibility to do monitoring of the data flow and the updates send to theNimbits Cloud Server.

Basic system informations for the IBoard:

• System Clock frequency: 16MHz

• RAM Capacity: 2Kb

• Flash Capacity: 32Kb

3.2.3 Power and energy consumption

To find the power and energy consumption for the XBee, we have inserted a 1Ω resistor on theplus side of the power supply line and then measured over it illustrated in the circuit in figure 4

By adding the 1Ω resistor and measuring over it, we know that the current is equal to thevoltage over the resistor. the Current is then multiplied by the supply voltage (3.166V ) to findthe power. We use the Agilent VEE DSO 7014A Oscilloscope to find the transmission profile

Figure 4: Xbee measurement circuit

in the time domain showed in figure 5 We see that the total length of the transmission profile is108ms. to get the total power of a transmission profile we now need to split the measurementup in parts that consist of high currents and low currents to do that, we find the exact currentlimits in the profile:

9

Page 10: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

Figure 5: Xbee transmission profile

Figure 6: Measurement of the current in thehigh parts

Figure 7: Measurement of the current in thelow parts

we see in figure 6 and 7 that every time the current is high we measure 29.75mA and when islow we measure 8.57mA so if we multiply the high and low current with the supply voltage,we find the power for the high and low periods:

PHigh = 0.02975A · 3.166V = 94mW (1)

PLow = 0.00857A · 3.166V = 27.133mW (2)

We then need to find the amount of time that the transmission profile is high meaning thedifference between low and high. We need this to find the energy.

10

Page 11: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

Figure 8: Xbee measurement

Figure 9: Xbee measurement

Figure 10: Xbee measurement

The total time that the transmission profile is high is 18ms + 4.9ms + 6.06ms = 28.96ms Tofind the total energy we multiply the power by the time:

EHigh = 94mW · 28.9ms = 2.72mWs (3)

ELow = 27.133 · 108ms = 2.93mWs (4)

11

Page 12: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

And if we add the energy from both the high and the low we get:

Etotal = 2.72mWs + 2.93mWs = 5.65mWs (5)

So the conclusion is that the XBee consumers 5.65mWs every time it transmit. I our systemwe transmit every 10 minute so hourly energy consumption is:

5.65mWs · 6 = 33.9mWs (6)

and in 24 hours it consumers:

33.9mWs · 24hours = 813.6mWs (7)

We have found that this profile is the optimal profile in relation to the power/energy consump-tion. That conclusion is based on a lot of measurements and calculations on other profiles.

3.2.4 Energy harvesting

The end device placed outside is powered by a solar cell if and only if the whether allows it. Thesolar panel is a 6V 3.6W monocrystaline unit with a solar area of 19cm x 10cm It is important

Figure 11: Solar panel

to load the solar cell correctly to get the maximum power out of it. We have conducted a loadexperiment on the solar cell we use, to find the ideal load for the cell under normal conditions.

The experiment is performed by placing the solar cell outside pointing at the sun and thenincreasing the load with a variable resistance in steps of 1Ω at the time starting from 0Ω to 22Ωand then measure the current and the voltage for each steps. All the result was then collectedand imported in to a Matlab script. The graphs y-axis in figure 12 is showing the current (theblack line) and the voltage (the red line) and the x-axis is the increased resistance:The power P is found by: P = I ·U so we multiply I by U to get P . In figure 13 is the Matlaboutput: We find the maximum power when the load is at 10Ω.

The Matlab code can be found in the appendices under Matlab code

12

Page 13: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

Figure 12: Graph from the load test of the solar cell

Figure 13: Matlab output from the load test of the solar cell

13

Page 14: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

The energy from the solar cell is stored in a 35F capacitor and to manage this process we needa unit that do that and also supply load on the cell. To manage this task we use the TexasInstruments BQ25504 Battery Management Evaluation Board(EVM)

Figure 14: The TI bq25504 EVM

The EVM takes the source input from the solar cell and charge the capacitor to about 3V Theoutput from the EVM feeds the end device shown in figure 15

Figure 15: Solar panel system

because the Xbee requires a certain voltage level to operate we can only use the capacitor whenthe charged voltage level is over 2.5V that means that we only have a working span of 500mVon the capacitor. To find the energy in the capacitor in this region we do some calculations:

Energy in a capacitor can by expressed by this equation:

E =1

2· C · V 2 (8)

We find the power for the upper limit by:

Eupper =1

2· 35F · 3V 2 = 157.5Ws (9)

And the power for the lower limit:

Elower =1

2· 35F · 2.5V 2 = 109.37Ws (10)

14

Page 15: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

And then we subtract the lower power limit from the upper power limit to get the range wherewe can use the capacitor to power the end device:

Erange = 157.5Ws− 109.37Ws = 27.83Ws (11)

From the chapter about power and energy consumption we recall that each transmission con-sumed 5.652mWs so if we divide the Erange by this we will get the total amounts of transmis-sions that can be done on a fully charged capacitor:

Number of transmissions =27.83Ws

0.005652Ws= 4923 (12)

3.3 Software description3.3.1 XBee protocol

The XBee module has a variety of options, but overall it’s all about wireless transmission ofdata.

To make the XBee modules accessing the same network, a common PAN ID (personal areanetworks ID)must be shared between all the devices in the network. This measure is to increasesecurity so that unwelcome devices are unable to "sniff" the data transmitted on the network.All XBee devices have an individual 64 bit address corresponding to a hardware address like amac address as we know from other network types.Zigbee protocol consists of 5 layers where the two bottom layers are covered by IEEE 802.15.4standard and the last layer 3 is subject to the so-called "ZigBee alliance" where producers havecome together on a common standard.

Figure 16: TCP vs. OSI Protocol Figure 17: Zigbee Protocol

15

Page 16: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

The ZigBee layers are

Figure 18: ZigBee layers

The advantage of using the Xbee protocol is that it is shorter then e.g. the TCP/IP protocol.The Xbee protocol has no lower limit of size in contrasts to the TCP/IP protocol.Performs modulation on outgoing signals and demodulation for incoming signals

16

Page 17: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

3.3.2 Iboard

The code for the Iboard has been written, compiled, debugged and flashed with use of theAteml Studio 6.1.0 software IDE. In this project we have made use of some pre written classesand functions.

The program is executed in two states firstly a set-up call that initialize some system propertieslike serial communication and starts the Ethernet. After that a loop call is carries out thiscalls is like a main function in a conventional C or C++ program. The only function in theloop() is the getXbeeTemp() function and it is in this function all the magic i happening.

Figure 19: Flow chart for the setup

When the program has been set-up, the setXbeeTemp() is called. This function listens andproceed every time one of the three end devices wakes up and sends data. The data is thenanalyzed to extract the address and the payload containing the 10 bit ADC value . The addressis compared with the three addresses (witch we already know) to identify from witch end devidethe transmission is coming from. The 10 bit ADC value is converted into a temperature readingby an algorithm described in equation 1 and 2. The last part of the function is a call to theupdateNimbits() function. The updateNimbits() function takes a string as argument. Thisstring is a JSON formatted string that is made in the function recordValue() witch takes an IDand a temperature as augments. Additional information is available in the Appendices chapterunder C++ source code.The ADC conversion:The 10 bit ADC value revived from the end devices is formatted in a high and a low byte andwe need to convert this two bytes into one value this is done by:

int adcV alue = (adcHi ∗ 256) + adcLow; (13)

Then we convert the combined ADC value to a temperature in Centigrade:

float xbeeTemp = (((adcV alue ∗ 1.2/1024) − 0.5) ∗ 100) − cal; (14)

17

Page 18: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

First the ADC value is multiplied by 1.2 = 1200mv because this is the maximum voltage theXBee can handle on the analogue GPIO (General-purpose input/output) ADC pins. This isthen dived it by the maximum steps in a 10 bit sampling (1024). Than we subtract 0.5 witch isthe off-set that makes is possible to get negative values. After that we multiply by 100 (0.010v= 10mv) witch represent the voltage differers for each of the 1024 steps.The cal variable is a calibration factor that differers from each end device.

Figure 20: IBoard flowchart

3.3.3 Matlab

The Matlab script takes the data imported from the Nimbits server in 3 text files. The scriptthen uses the timestamp and the temperature data to make a single graph with all 3 sensorsdata as in figure 32 and 33. For more specific details see the comments in the Matlab code inthe Appendices

3.3.4 Nimbits Cloud Server

The Nimbits cloud server is a free platform as a service (PaaS) server that collected data pointsand a timestamp in a Json formatted string. The server itself can be downloaded and locatedon a local clout server or use as a service on Nimbits own server administered through a Gogglelog in. The By using the Json or JavaScript Object Notation we are able to save data in theflow compared with the HTML notation because Json is a more compacted notation form. Thefull Json formatted string is build like this:

"lt":0.0,"lg":0.0,"d":3.3759983,"t":1375830638276,"n":"some annotation text","dx":" any stringdata"

Where

18

Page 19: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

• lt = latitude GPS Coordinates (Not used in our system)

• lg = longitude GPS Coordinates (Not used in our system)

• d = the decimal value (Used for the temperature data in our system)

• n = An annotation for the decimal value (Used to identify the data point in our case IN,OUT or WINDOW)

• t = UTC time stamp / Unix time stamp (Counts from 01.01-1970 00.00.00 UTC)

• dx = String data to by timestamped (Not used in our system)

To summarizer we only make use of 3 in the Json string namely the temperature data theidentification of witch end device it sending and the Unix time stamp.

The String is made in the C code by calling the function recordValue() where all the ele-ments of the string are put together exceped the Unix timestamp witch is previded by theserver. In the string is also the goggle accounts email address and the read/write key for theserver. The string is then send by using the updateNimbits() function that takes the string asan argument.In our system it looks like this:

[email protected]&key=xbeetemp&json="d":"23.36", n":"Window"&id=Window

If the Json string is accepted at the server we get a HTTP/1.1 200 OK return and the connec-tion to the server is closed again. Then the server attaches the Unix time stamp and returnsthe string to us:

"lt":0.0,"lg":0.0,"d":20.08,"t":1401786165160,"n":"","st":0

The UTC time is 2 hours behind the time we use in Denmark, so we need to take that into account, we do that in the Matlab code.

3.3.5 Programming resources

It is vital that the C/C++ program is compact because the memory on the Iboard is limitedto only 2KByte of data memory and 32KByte of program memory. In figure 18 is a resume ofthe resources used on the Iboard in our project.

Figure 21: Blockdiagram

4 Testing

4.1 Unit testsThese unit tests is performed on sub parts of the system.

19

Page 20: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

4.1.1 Xbee end device

This test is performed in X-CTU tool to verify that we have wireless contact to all 3 enddevices. this is done by receiving an IO samples from each of the end devices:

Figure 22: Test measurement with and without the 20 cm connection cable

If figure 23, 24 and 25 is the received data package from the 3 end devices.

Figure 23: End device 1 Figure 24: End device 2

Figure 25: End device 3

20

Page 21: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

4.1.2 Iboard

This test is done in terminal window in Atmels studio 6.1. To test the Iboard we connectedthe board to a Ethernet source to check if the Iboard gets an IP address through DynamicHost Configuration Protocol (DHCP):

Figure 26: Test measurement with and without the 20 cm connection cable

Then we send some data to the Nimbits server to check that we have a connection:

Figure 27: Test measurement with and without the 20 cm connection cable

We see in figure 27 that the data was successfully sent and accepted by the server. The datais then added to a data point already made on the server.

21

Page 22: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

4.1.3 Nimbits server

In the web interface on the Nimbits server we build 3 data point to check that we get the datato the cloud server:

Figure 28: Ninbits web interface off line

After we have sent the data we check that the data is received correctly:

Figure 29: Ninbits web interface on line

In figure 30 is the data graph directly from the Nimbits server page. The graph is the outsidesensor temperature over a period of 4 days.

Figure 30: Ninbits web interface on line

4.1.4 Solar system

The solar cell system is tested by charging it to its fully capacity, in our case 3.1V . Then thesolar cell is disconnected and the end device is connected. The end device has been modified to

22

Page 23: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

do a sample every 500ms and send it to the coordinator. By doing this the end device drainsthe capacitor to the minimum voltage that the end device can operate at which is 2.2V . Thecalculated result is found by:

We know the energy consumption of one data profile from equation5 to be 5.65mWs, so weonly need to find the energy range that the end device is working in:

EHigh =1

2· 35F · 3.12V = 120.125Ws (15)

ELow =1

2· 35F · 2.22V = 60.5Ws (16)

Erange = 120.125Ws− 60.5Ws (17)

And then devide the energy comsumption from equation 5 with Erange

Number of samples on a charge =60.5

0.0056= 10549.4 times (18)

If we look at the test result in figure 31 we see that we actually get more samples then we havecalculated namely 11731 times.

Figure 31: X-CTU tool solar panel stress test

4.2 Test caseThe whole system is tested by running all system elements for 48 Hours to collect data. Duringthe test all data points already recorded can be seen on the Nimbits cloud server web interfaceas in figure 30. The test set-up is done by placing a sensor outside, one at the window on theinside and one in the room. It is important that non of the sensors is exposed of direct sunlight or water. When the test period is over a data dump is done in the Nimbits web interfaceto a local destination to be process and then imported into Matlab so that the user are ableto see all the test data in a graph:

We have found out that certain conditions has to be satisfied to get a accurate test result:

23

Page 24: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

• The test room should be empty during the test period.

• All types of heating in the test room should be turned off during the test period.

• All windows in the test room should be closed during the test period.

• A Internet connection should be present in the test room.

The best results are obtained if the window that is used for the test is facing south so that thesystem is exposed to as little direct sun light a possible.

4.2.1 Results

The result is represented on a graph where all 3 temperature measurement points are includedover a given time period.

Figure 32: Test result from system test

By looking at the graph we see that the outside temperature is pulling the indoor temperaturedown during night time . The peaks that occurs between 06.00 and 09.00 is a result of a timespan where the sun is hitting the sensor and the window directly. In this time span we getabnormal warmth ratings. Non of the data points has been average so what is on the graph isthe raw data.

Figure 33 is a close up of the graph in figure 32.

24

Page 25: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

Figure 33: Test result from system test

5 Conclusion and discussion

5.1 DiscussionIn this section we will be discussing sub parts of the project. All of these points of discussionis topics that the group has been talked about to evaluate the ideal way of execution.

5.1.1 The result

A point that requires discussion is how the results should be interpreted and what informationswe are able to get out of it. Some calculations has to be done if the result is required in a singlenumber. One way of doing this could be integrating the outside with the inside temperatureto get the area between the two graphs which would give a number. The disadvantages withthis method is that if the outside temperature approaches very low temperatures, the numberwill be very large due to the large area. An other way of using the data could be by look atthe indoor data, and then calculate how much energy it would cost to keep this line constant.This number would reflect the quality of the window and of course also the isolation of theroomTo get useful results from this system, we would had to gather a large amount of referencedata from all kinds of windows to be able to make comparisons. unfortunately we have notbeen able to do that due to lag of time.

5.1.2 Power/energy consumption

It is very obvious to discuss the power/energy consumption of the system. The gold was toreduce the consumption especially on the end devices. After conducting a series of tests, wewere able to find the configuration where the overall energy consumption was lowest. We

25

Page 26: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

discovered that the shortest transmission profile not necessarily was the best according toenergy consumption. Tests has also been carried out to measure the energy consumption onthe Board, but the measurement results was so unstable and unpredictable that we found themuseless.

5.1.3 Energy harvesting

The solar cell system we use is very effective and is able to keep the end device alive for a longtime, but under the right circumstances. If the weather is poorly the solar system is inoperableand a other power source is required to continue the tests. It would be possible to build aintelligent switching system that could switch between solar power when available or batterypower in lag of sun light.

5.1.4 Test period

A important topic is the test conditions and the surroundings that the test is executed in. Aobvious conclusion must be that the test result is improved if the test is carried out for a longtime period to get as much data to process as possible. There is also diversity in when the testis done. Our conclusion is that the test result is more convincing if carried out in the wintertime because the changes in temperature is greater than it is in the summer time. In that waythe result margin will be bigger and more transparent.

5.2 ConclusionWe can conclude that the system works after the intentions and the results returning from thesystem are valid. We are able to use Matlab to merge the collected data to make a more userfriendly visual representation of the result. The test window we have used for the test hasall been of very high quality witch the test result reflects. It has been hard to find a suitabletest room without automatic heating system and interfering. The project have meet all therequirements listed in the beginning of this document under requirements.

5.2.1 Conclusion on the LCA

As one can read from the table 1 then the component with the largest economical footprint isthe antenna. The reason for its large impact is the amount of silver and gold that is includedin producing the antenna, on the other hand the antenna has the highest renewable energy butin does not condensate for the high energy consumption in the production phase.

The renewable energy in ratio to the total energy consumption:

The chip =renewable energy

total energy consumption= 0.078160388 (19)

V oltage Regulator =renewable energy

total energy consumption= 0, 078146903 (20)

Antenna =renewable energy

total energy consumption= 0, 077387291 (21)

PWB =renewable energy

total energy consumption= 0, 07812 (22)

26

Page 27: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

Connector pins =renewable energy

total energy consumption= 0, 064100756 (23)

Faradays cage =renewable energy

total energy consumption= 0, 214285714 (24)

From the renewable ratio one can see that the Faraday cage is the component with the leastimpact in terms of energy consumption. One should though note that the information givenfor the Faradays cage was not sufficient, that is no transformation data was available.

5.3 Possible future improvements• Specialized electronic for the concrete task. Build a board that only consist of the elec-

tronics that we need to run the system. This board would replace the Iboard.

• Use more green energy (more solar energy or other sources like soil battery or head).

• A full LCA report for the entire system.

• Better test conditions.

• A monitor system to measure the solar cell power and capacitor charge.

• Data point backup on a SD card inserted into the IBoard.

• Automatic download of data points from the server.

• A embedded Nimbits server on a raspberry pi to lower the energy consumption by notusing the Inter net to transport data.

6 Appendices

6.1 C++ source code

1 // Title: temp_project2.cpp v 1.42 // Authors: Andre Daniel Birkkjaer Christensen and Anna Hildigunnur Jonasdottir3 // DTU Campus Ballerp4 // Copyright (c) 20145 // All rights reserved.6 //7 // This code is strictly devoted to the Itead IBoard hardware.8 // The Program collected data from 3 XBees and converts it into a temperature (C).9 // Then the program connect to the Internet through a Ethernet connection and sends

10 // the data and the id of the XBee to a nimbits server.11 //12 // New in this version: last temp!13 #include "Client.h"14 #include "stdlib.h"15 #include "Arduino.h"16 #include "Dhcp.h"17 #include "Dns.h"18 #include "EthernetServer.h"19 #include "util.h"20 #include "EthernetUdp.h"21 #include "Ethernet.h"22 #include "EthernetClient.h"

27

Page 28: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

23 #include "SPI.h"24 #include "stdio.h"25 #include "Nimbits.h"26 #include "Wire.h"27 #include "Adafruit_Sensor.h"28 #include "Adafruit_TSL2561_U.h"29 #include "XBee.h"303132 //nimbits settings, set the instance name (nimbits−02 is the public cloud on https://

cloud.nimbits.com)33 //the email of the account owner, and a read write key they have created.34 //or if posting to your server on your network, 192.168.1.100:8080/nimbits for

example.35 #define PORT 8036 #define SENDLENGTH 1937 #define DATAPOINT1 "Out"38 #define DATAPOINT2 "Window"39 #define DATAPOINT3 "In"4041 String instance = "nimbits−02";42 String owner ="[email protected]"; //google

account43 String readWriteKey = "xbeetemp"; //read write

key created at nimbits after login44 byte mac[] = 0x90, 0xA2, 0xDA, 0x00, 0x54, 0x36; //this ethernet shield’s MAC

address45 float lasttemp1 = 0;46 float lasttemp2 = 0;47 float lasttemp3 = 0;4849 Nimbits nimbits(instance, owner, readWriteKey);50 ZBRxResponse zbRx = ZBRxResponse();515253 void startEthernet();54 EthernetClient client;55 void getXbeeTemp();56 String recordValue(String strin, float data);57 void updateNimbits(String data);5859 void setup()60 61 Serial.begin(9600); //initialize serial communication for debugging62 startEthernet(); //starting the Ethernet connection with the host (The pc)

and gets a IP address via DHCP63 Serial.println("The IBoard is now Online"); //print to terminal6465 delay(1000); // Wait for 1 sec before running the loop()66 6768 void loop()69 70 getXbeeTemp(); // Starting the main function71 7273 // This function creates a Json string from the temperature and id data. Then is

calls a function that updates the Nimbits server74 String recordValue(String strin, float data)75 76 //int h =(int) data; // use this if the recived data (data)

is of the type int

28

Page 29: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

77 //String hum=String(h,DEC);7879 char tmp[10]; // converting the

input float to a string80 dtostrf(data,1,2,tmp);8182 String hum = tmp;8384 String json;85 json = "\"d\":\"";86 json +=hum;87 json += "\", n\":\"";88 json += strin;89 json += "\"";9091 String content;92 content = "email=";93 content += owner;94 content += "&key=";95 content += readWriteKey;96 content += "&json=";97 content += json;98 content += "&id=";99 content += strin;

100 Serial.println(content);101102 return content;103104 Serial.print("data to send");105 Serial.println(content);106 107108 // Updates the Nimbits server109 void updateNimbits(String content)110 111 const char ∗GOOGLE = "google.com";112 EthernetClient client;113114 if (client.connect(GOOGLE, PORT))115 116 client.println("POST /service/v2/value HTTP/1.1");117 client.println("Host:nimbits−02.appspot.com");118 client.println("Connection:close");119 client.println("User−Agent: Arduino/1.0");120 client.println("Cache−Control:max−age=0");121 client.println("Content−Type: application/x−www−form−urlencoded");122 client.print("Content−Length: ");123 client.println(content.length());124 client.println();125 client.println(content);126 while(client.connected() && !client.available())127 128 delay(1);129 130 while (client.available() )131 132 char c = client.read();133 Serial.print(c);134 135 136 137 void startEthernet()

29

Page 30: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

138 139 client.stop();140 Serial.println("Connecting Iboard to network...");141 Serial.println();142 delay(1000);143 // Connect to network amd obtain an IP address using DHCP144 if (Ethernet.begin(mac) == 0)145 146 Serial.println("DHCP Failed, reset Iboard to try again");147 Serial.println();148 149 else150 151 Serial.println("Iboard connected to network using DHCP");152 Serial.println();153 154 delay(1000);155 156 // This function listens for any sample package from any of the three xbee in the

system.157 // When there is data it collected the id of the end devices gets the data and

converts it to a158 // temperature after thet it sends it to a function that transmit the temp + teh id

to the nimbits server159 void getXbeeTemp()160 161 XBee xbee = XBee(); // making a instance of the class XBee162163 uint32_t xbee1 = 1081711403; // The known 64 byte address for each XBee164 uint32_t xbee2 = 1083949129 ;165 uint32_t xbee3 = 1083949136;166 //uint32_t xbee3 = 10839491282; broken xbee !!! Do not use it167168 float cal = 0;169 xbee.readPacket(400);170 if (xbee.getResponse().isAvailable()) //

Checks if there is a packet from one of the three Xbee171 172 String xbeeIdStr;173 xbee.getResponse().getZBRxIoSampleResponse(zbRx); //Gets the

sample responds174 XBeeAddress64 id = zbRx.getRemoteAddress64(); //Gets the 64

byte address from the data package175 uint32_t inputId = id.getLsb();

//Sort the id so that only the last part of the addressis used

176177178 int adcHi = zbRx.getData(4);

//Gets the high byte that contains thelast 2 bits from the payload

179 int adcLow = zbRx.getData(5);//Gets the low byte that contains the

first 8 bits from the payload180 int adcValue = (adcHi ∗ 256) + adcLow;

//Converts the high and low byte in to one int181 float xbeeTemp = (((adcValue∗1.2/1024)−0.5)∗100)−cal; //

Converts the 10bits ADC value to a temp value. The −0.5 is theoffset found in the data sheet

182 //

The

30

Page 31: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

cal

is

to

calibrate

the

temperature

sensor

183184185186187 if(inputId == xbee1)

//Identify from witch xbee the data is comingfrom

188 189 xbeeIdStr = DATAPOINT1;190 cal = 1.76; // To calibrate the temperature sensors191192193 if((xbeeTemp > lasttemp1 + 50.0) ||(xbeeTemp < lasttemp1 −

50)) // To prevent upload of bad data points to theserver

194 195 xbeeTemp = lasttemp1; //If the xbeeTemp is off with

more than 50 C from the last temp we use the lasttemp value

196 197 else198 199 xbeeTemp = xbeeTemp; // If the xbeeTemp is in the

limit we use the xbeetemp200 lasttemp1 = xbeeTemp; // Update lasttesp201 202203 204205 else if (inputId == xbee2)206 207 xbeeIdStr = DATAPOINT2;208 cal = 1.17;209210 if((xbeeTemp > lasttemp2 + 50.0) ||(xbeeTemp < lasttemp2 −

50))211 212 xbeeTemp = lasttemp2;213 214 else215 216 xbeeTemp = xbeeTemp;217 lasttemp2 = xbeeTemp;218 219 220221 else if (inputId = xbee3)

31

Page 32: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

222 223 xbeeIdStr = DATAPOINT3;224 cal = 0;225226 if((xbeeTemp > lasttemp3 + 50.0) || (xbeeTemp < lasttemp3 −

50))227 228 xbeeTemp = lasttemp3;229 lasttemp3 = xbeeTemp;230 231 else232 233 xbeeTemp = xbeeTemp;234 235236 237 else238 239 Serial.println("The Xbee is not a part of this system !!!");240 241242 updateNimbits(recordValue(xbeeIdStr,xbeeTemp));

//Sends the temp value + the nimbits id string to theserver

243 244

32

Page 33: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

6.2 Matlab code6.2.1 The Matlab Temperature Manipulator (MTM)

12 close all;3 clear all;4 clc;567 %%8 data = importdata(’in.txt’); %importing the data from the text file9 timestamp = fix(data(:,1)/1.e3); % fixing the timestap

1011 tempx = data(:,2); % selecting all the rows in the second column12 date = (timestamp/86400 + datenum(1970,1,1));13 % Since the timestamp is in ms, timestamp/86400 + datenum(1970,1,1) gives14 %the number of days since Jan. 1st 1970.15 % 60∗60∗24=8640016 dateReadable = datestr(timestamp/86400 + datenum(1970,1,1));1718 dateVektor=datevec(date); % Convert the UNIX time to vektor view19 dateVektor(:,4)=dateVektor(:,4)+2; % Adding 2 hours to the 4th column20 %that stores the hours.2122 currentUTCdate=datenum(dateVektor); %Converting back to a number in order23 %to plot it.24252627 %%28 plotHandle=plot(currentUTCdate,tempx,’m’) % plotting the input data in green2930 %Manipulating the plot31 datetick(’x’,’HH:MM’);32 grid on;33 xlabel(’Time’);34 ylabel(’Temperature [C]’);35 title (’Window Data Project’);3637 hold on38 %%39 %%40 data1 = importdata(’out.txt’);4142 timestamp1 = fix(data1(:,1)/1.e3);4344 tempx1 = data1(:,2);45 date1 = (timestamp1/86400 + datenum(1970,1,1));46 % Since the timestamp is in ms, timestamp/86400 + datenum(1970,1,1) gives47 %the number of days since Jan. 1st 1970.48 % 60∗60∗24=8640049 dateReadable1 = datestr(timestamp/86400 + datenum(1970,1,1));5051 dateVektor1=datevec(date1); % Convert the UNIX time to vektor view52 dateVektor1(:,4)=dateVektor1(:,4)+2; % Adding 2 hours to the 4th column53 %that stores the hours.5455 currentUTCdate1=datenum(dateVektor1); %Converting back to a number in order56 %to plot it.5758 %%

33

Page 34: 62562 Sustainable electronic and IT Window comparasition … · 2014. 8. 21. · High = 0:02975A 3:166V = 94mW (1) P Low = 0:00857A 3:166V = 27:133mW (2) We then need to find the

Sustainable electronic and ITWindow comparasition project

596061 plotHandle=plot(currentUTCdate1,tempx1,’b’)% plotting the output data in blue626364 %%65 data2 = importdata(’window.txt’);66 timestamp2 = fix(data2(:,1)/1.e3);6768 tempx2 = data2(:,2);69 date2 = (timestamp2/86400 + datenum(1970,1,1));70 % Since the timestamp is in ms, timestamp/86400 + datenum(1970,1,1) gives71 %the number of days since Jan. 1st 1970.72 % 60∗60∗24=8640073 dateReadable2 = datestr(timestamp/86400 + datenum(1970,1,1));7475 dateVektor2=datevec(date2); % Convert the UNIX time to vektor view76 dateVektor2(:,4)=dateVektor2(:,4)+2; % Adding 2 hours to the 4th column77 %that stores the hours.7879 currentUTCdate2=datenum(dateVektor2); %Converting back to a number in order80 %to plot it.8182 %%8384 plotHandle=plot(currentUTCdate2,tempx2,’g’) % plotting the window data in red8586 %Indoor = green87 %Outdoor= blue88 %Window = red89 legend(’Indoor sensor data’,’Outdoor sensor data’, ’Window sensor data’ )90 %%

6.2.2 Solar cell load calculation

123 clear all;4 close all;567 R=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22]89 V=[0.011 0.559 1.11 1.65 2.19 2.775 3.27 3.86 4.33 4.88 5.25 5.24 5.47 5.62 5.75 5.86

5.933 6.01 6.07 6.11 6.14 6.16 6.11]1011 I=[0.555 0.554 0.55 0.55 0.55 0.55 0.55 0.55 0.55 0.54 0.548 0.528 0.5 0.472 0.446

0.422 0.398 0.379 0.36 0.342 0.325 0.31 0.278]121314 P = times(V,I)151617 figure(1)18 plot(R,V, ’r’)19 hold on;20 plot(R,I, ’k’);21 grid on;22 xlabel(’Resistance [R]’);23 ylabel(’Voltage and currend [V & I]’);

34