solar home management

Upload: saa21

Post on 08-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 Solar Home Management

    1/16

    Skip to main content

    Cornell University Project Search:

    go

    Pages Peoplemore options

    Smart House Introduction High Level Design Hardware/Software Tradeoffs Program Details Hardware Details Results of Design Conclusion Ethical Considerations Legal Considerations Appendix

    Smart HouseJulia Sciarello, Mauricio Munoz, Carla Quiller

    http://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://www.cornell.edu/http://www.cornell.edu/search/http://www.cornell.edu/search/http://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://www.cornell.edu/http://www.cornell.edu/http://www.cornell.edu/search/http://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mhthttp://e/New%20Folder%20(2)/our%20projects/Finally%20decided%20projects/solar%20home%20management.mht
  • 8/7/2019 Solar Home Management

    2/16

    IntroductionOur project implements a smart algorithm in order to power a house with a photovoltaic, batteries or the power grid. For this project, we worked closely with a research team whose is to power a home with minimal power from the power grid. In order to form this smart howe needed to monitor the voltage and current flow from each of the sources (photovoltaic, batteries, and the grid) and the home.We implemented these current and voltage monitors. Thenext step was to come up with an algorithm that would determine what source should be powering the house and when the battery should be charged. The final step was to send out to a home display module so that the data can be analyzed.

    High Level Design

    Our project idea came from a research team focusing on building a smart home, since one ofgroup members is working with the team. In order to decide how to power the house, it isnecessary to find the power demand of the house and the available power from each source. power can be found by the following equations: P=IV, P=V^2/R, P=I^2R.For AC power calculations we needed to find average power instead of instantaneous power

  • 8/7/2019 Solar Home Management

    3/16

    Therefore we needed to find the root-mean-squared value for the current and the power, andalso needed to find the phase difference between the voltage and the current.

    I(t)=Ipeak*cos(2ft)V(t)=Vpeak*cos(2ft + )

    Pavg=I*V=Irms*Vrms*cos() => Vrms=Vpeak/2 and Irms=Ipeak/2For our project we are using the HCPL-7520 Linear Opto-isolator in order to determine thevoltage drop across a resistor. These isolators can be modeled by the equation below, where is the differential input.

    Vin=.512/Vref*(Vout-Vref/2)

    The voltages that we are measuring exceed 5V, therefore we used voltage dividers to scale dothose voltages. For calculations, we found the actual voltage on the line by using the followiequation, where the input to the microcontroller would be Vscale and the actual voltage wou

    Vhigh.

    Vscale=R1/(R1+R2)*Vhigh

    The diagram below shows the layout of the power sources, relays, and the load. The solar pagenerates DC power and when Relay 1 is closed, that power is sent to an inverter, whichtransforms the power to AC. The inverter outputs a 120AC signal, which is then stepped-dow12VAC using a transformer for safety purposes. The 12VAC is then sent to the home. Thenickel-cadmium batteries generate DC power, which is also sent to the inverter when Relay 3

    closed in order to power the home. These batteries can be charged by the grid when Relay 4 closed and by the photovoltaic when Relay 2 is closed. A DC to DC converter is needed whecharging the battery with the photovoltaic in order to charge the battery properly. When charthe batteries with the grid power, we need to transform the AC power into DC. We achieved by passing the signal through a full-wave rectifier and a DC to DC converter. In order to powthe house with the grid, Relay 5 must be closed. In order to determine which relays are closemonitored the available power from the battery and the PV. Using the power measurements wran an algorithm that decided the most efficient way to power the house.

  • 8/7/2019 Solar Home Management

    4/16

  • 8/7/2019 Solar Home Management

    5/16

    Software/Hardware Tradeoffs

    Some software tradeoffs we made involved our calculations of the voltage, current, and powWhen using a microcontroller, fixed-point math is the best way to go to make sure thecalculations get done as quickly as possible. However, we are more concerned with the accu

    of these numbers and chose to use floating point instead. Since we are only doing major calculations every ten seconds, we were not concerned with the delay this floating-pointarithmetic would have on our design. Another tradeoff that we made was to step down thevoltages using a current divider in order to measure current and voltages. This is because wusing 12 V, and the opto-isolator we used could only handle inputs of up to 5V. We saw that previous project had used this opto-isolator successfully so we decided to use it and risk havsmall percent of error from scaling down. We decided to use TinyRealTime instead of interrservice routines because we had to accurately schedule our tasks due to deadlines. Another tradeoff involved finding the charge of the batteries. Instead of following the discharge behavof the batteries or integrating the current, we chose to simply measure the voltage and dividevoltage by the maximum voltage of the batteries to find the charge percentage. We could do

    because nickel-cadmium has a nearly linear relationship between charge and voltage. This issoftware tradeoff because it saved us time in calculations and proved an approximate result.

    In terms of hardware tradeoffs, we had to decide how to accurately measure current witholosing power to the house. We had two options: use a current divider, an opto-isolator, and anoperational amplifier or use a current-sensing resistor and a differential opto-isolator. Weattempted to use the first option, however the opto-isolator needed 1.8V across it. This voltagdrop results in a decrease in power delivery to the house. Choosing the proper resistance valuto get this 1.8V drop was difficult. The output of the op-amp was a voltage that we used to fithe current flowing through the house, but we could not find the appropriate scaling factor between the voltage and current. The voltage output was on the milli-volt range, so we did n

    think the ADC converter would understand how to scale this small voltage. Therefore wedecided to use the second option, which will be described in the Program Detail section.There are many products on the market for saving energy and measuring the power consumpof your house. There are even companies that are devoted to producing the Smart Home ware trying to create. IEEE standards for sizing nickel cadmium batteries for a photovoltaic, Istandards for utility interface of residential and intermediate photovoltaic systems.

    There are many products on the market for saving energy and measuring the power consumpof your house. These products include the Kill-A-Watt and various other surge protector based power conservation devices. There are even companies that are devoted to producing the SHome we are trying to create. For this type of product, we must satisfy IEEE standards for sizing nickel cadmium batteries for a photovoltaic as well as IEEE standards for utility interfof residential and intermediate photovoltaic systems.

    Program Details

    Our code consisted of four main tasks. The first task, getInput(), is a continuous task used tomonitor the inputs from the user. In order to initiate the program, the user is required to inpustart time (hour in military time, minute, second) for accurate time keeping. This function th

  • 8/7/2019 Solar Home Management

    6/16

    continuously watches for inputs from the user in order to signify a demand response event haoccurred. A demand response event is one in which the power company would signal that thhome needs to reduce its power consumption. In order to represent this, the user would inpthe maximum power the house can use and the length of this power restriction.

    The updateClk() task simply keeps track of time. It has a release and deadline time of 1.0 seand increments the second of the clock. When the second reaches 60, it is reset to 0 while thminute variable is incremented. The minute variable is incremented until it reaches 60 as wewhere it is reset and the hour variable is incremented. The hour is in military time, so instearolling over to 24 it will reset to zero. Time keeping is very important in our project becauseneed to keep track of the price of energy, which varies throughout the day. The price of ener plays a role in our decision-making algorithm.

    PVmonitor() is the monitoring task that calculates the power of the PV, power demand of thehome, the battery charge, and the power being produced by or sold back to the grid. To get t power, we need to find the voltage and current for each source. We do this by reading in the

    outputs of the four opto-isolators into the ADC on the microcontroller, as well as the voltagefrom our voltage dividers. The voltage is calculated based on the voltage divider, as well as calibration factor. In order to find the current, we calculate the actual voltage drop across oucurrent sensor by using the equation from the opto-isolator and a factor from our voltagedivider.

    Vdiff=0.512/Vref(Vout-Vref/2)

    The ADC is an analog-to-digital converter, which takes in an analog value and converts it to number between 0 and 255. We can retreive the original analog number by multiplying theADCH number by 5/255, where 5 is the reference voltage.

    Then we use Ohms Law to get the current by dividing Vdiff by 2. The power can then becalculated by multiplying this current by the previous voltage we found.In order to get the AC power, we measured the current 1000 times in order to find the peak current. Once we found the peak current, we could calculate the Vrms by dividing the peak current by 2. When looking at the output signals of the opto-isolator and the AC power sigwe saw that there was no phase difference. This means we can simply multiply Vrms and Irtogether to get the power. After collecting all the power data, we sent it out using the RS232Uart.In case the PV is not in use, we have a check that occurs every ten minutes so that we can ge power of the PV. To do this we close the relays so that the PV can charge the battery, and wcan get a power reading for it. Otherwise we wouldnt know how much the PV can supply sthere isnt current flowing through the resistor at all times. After the measurement has beenmade, we turn off the PV and return the circuit to its previous state. If the PV is supplyingenough power, the algorithm will decide to turn it back on.

    Algorithm() was the biggest portion of the project. We sat down with the research group in to discuss the most efficient way to power the home under various circumstances. There are

  • 8/7/2019 Solar Home Management

    7/16

    main conditions in this algorithm: whether or not there is a demand response signal from theutility. If there is no demand response signal, our algorithm progresses in the following orde

    If the battery is at 20% of full charge or less, perform an emergency charge back up to75% and proceed through the rest of the algorithm

    If PV power is greater than the power demand of the home, let the PV power the hous If PV power and battery can provide enough power for the home, then they power thehouse

    If PV power is greater than the home demand, battery charge is greater than 80%, and price of energy is in the upper 50%, we sell energy from the PV back to the grid

    If PV power is greater than 70% of home demand, its before 12 PM, the price of eneris in the lower 50%, and the battery is less than 95% full, we power the house with thegrid and charge the batteries with the PV.

    Otherwise, just power the house with the grid.

    If there is a demand response signaled, then the algorithm proceeds in the following way:

    Check to see if the power from the PV and the battery exceed the power demand If so, proceed to check if the PV and battery can sustain the homes power demand for

    the length of the demand response If so, check to see if the PV power is greater than the power demand.

    o If it is, sell back power to grid.o Otherwise, use the grid to power the house and PV to charge the battery

    If not, use the grid to power the home and charge the battery with the PV.

    We keep track of the time, so that once the demand response is over we can return to the origalgorithm.

    The trickiest part of our project was trying to measure current. The opto-isolators we used wvery sensitive to voltage changes and for some reason our voltage dividers did not work quitexpected. In order to calculate the correct current, we needed to measure multiple times in oto find the correct scaling factor between the voltage output of the opto-isolator and the actuavoltage drop across the current sensing resistor. It was also frustrating that for each of the focurrent sensing circuits, the scaling factor did not remain the same. When measuring AC sigwe needed to make sure that we were getting the peak value for current in order to calculate average power.

    Hardware Details

    Our project consisted of a few different circuits. Since we couldnt demo with a real photovoltaic, it was necessary for us to build a circuit that effectively represented theexponential I-V curve of a photovoltaic. We found the circuit seen below from a rese paper (see appendix). It can be made with a current source, which we made using an amp, three LEDs and a couple of resistors. As the current increases, the voltage outpudoes as well. Because the LEDs are different colors and have different on-voltages

  • 8/7/2019 Solar Home Management

    8/16

    they will turn on at different times, providing three different linear regions in the I-Vcurve. This creates a somewhat exponential effect for the current.

    Our current monitoring circuits can be seen in the pictures below. We have one design for thDC voltages of the battery and PV and another for the AC signals of the grid and the home. only real difference is the resistors used for the voltage divider. For both circuits, a signal cothrough the 2 resistor, and the voltages are scaled down on both sides of the resistor. For tDC circuit, we scaled the voltages down by a factor of ten and the AC signals were scaled do by a factor of four. The scaled down voltages on both sides of the resistor get sent into the oisolator, which sends a voltage to the ADC of the MCU that corresponds to the voltagedifference of the two inputs. This voltage is then used to find the current through the resistoWe also send the scaled down voltage on the output of the resistor to the MCU so that we ca

  • 8/7/2019 Solar Home Management

    9/16

    calculate the voltage on the output of the PV and calculate the power.

    The other part of our circuit includes the five relays. Each of these relays has four connectioTwo are for the MCU ground as well as a signal from a pin on the MCU and the other two arfor the two connecting or disconnecting the power source to the rest of the circuit. When theMCU sends out a 5V signal to the relay, the switch will close allowing current to flow througthe circuit.

  • 8/7/2019 Solar Home Management

    10/16

    In doing research for this project, weve been closely referencing the ECE 4760 PowerBox project from a couple years ago. They used the same opto-isolators we are using and a simil power averaging technique. We did not copy their design or code, but did use it as a referenfor our circuit and code.Over the course of this project, we have tried several different ways of measuring current andsending data. We had originally tried to use an H11F1 opto-isolator along with a current divand an LM 358 operational amplifier as described earlier, however we were not able toeffectively determine the I-V curve. We did some research and found the PowerBox projectdecided to attempt their method of measuring current. As for sending data, we had set up th port so that we could send data via pin B.5, but we realized that for the amount of data we hasend it would take a large amount of time to transmit. The receiver would also have to decoour message in a specific way. We did all of our calculations in floating-point so they were m

    accurate, but in order to send them over this SPI port we would have had to convert them tofixed-point. This may have caused some inaccuracy in the readings. After talking to the othteam that is working with our research group, we decided to just print the data out through pD0 and D1. That made it easier for us to send data and for them to receive it.

    Results of Design

  • 8/7/2019 Solar Home Management

    11/16

    For our design, we were not concerned with the speed of the execution as long as all of the tawere executed by the deadlines and as long as all the calculations could get done by thedeadline. Because our main tasks execute every 10 seconds, we were able to use floating-po

    calculations without running into timing issues. We were not able to notice any sort of hesitaor flickering within our program. It seems to work as desired.In terms of accuracy, we used voltage and current values from the multi-meter to compare wthe calculated voltages and currents. We then applied an appropriate calibration factor to achthe right voltage and current. However, these scaling factors varied by device, workstation, arandomly; therefore our calculations will always have some error associated with them.Initially, the research wanted us to scale the power to the full 120VAC. However we decidedthis voltage was too dangerous to be handling in lab. Therefore we used 120V to 18Vtransformers. We also used isolators to separate the power sources to ensure that themicrocontroller is protected from voltages exceeding 5V. Our design was safe and did notinterfere with other design projects.

    We aimed to make this device as user-friendly as possible. Therefore the product only needs be installed and initialized, and then the program will run by itself. In the real world, the utilcompany, not the user, will issue any demand response signal directly to the device. The onlyinput needed from the user is the time of day at the initial set-up.

    Voltage

    Actual(V)

    CodeMeasurement(V)

    Error (%)

    10.38 10.364 .15414.07 13.968 .734.34 4.281 1.38

    Current

    Actual(mA)CodeMeasurement(mA)Error(%)

    4.45 5.11 14.97.8 7.14 8.428.5 9.17 7.30

    Conclusions

    We changed our design several times. We wanted to use SPI, however that was too timeconsuming. Instead the RS232 proved to be more simple and efficient. If we were to do this project again, we would have used opto-isolators that could handle higher voltages, so that w

  • 8/7/2019 Solar Home Management

    12/16

    would not have had to use voltage dividers. This would have decreased the error in our curreand voltage calculations. Another feature we would have liked to implement is weather forecasting. If our algorithm function could receive the daily weather updates, we would be ato more accurately predict the power from the PV, which would be useful in demand responssituations. The behavior of the nickel cadmium batteries did not meet our expectations. The

    discharge rate was faster than we anticipated and the charging rate was slower than expectedTherefore we could not incorporate the batteries into our demo. Instead we used another powsupply to simulate the battery voltage.We did not use any other code. However we did use a similar design for calculating current avoltage as in the SmartBox design. We also referenced code written for the ECE 4760 lecturefor using SPI, ADC, and TRT. This project was not aimed at reverse-engineering a patented trademarked design, but there are many people who are working on solving the same problemPower conservation is a very significant issue in America. Our project utilizes environmentafriendly power sources, which decreases the dependence on the power grid. Therefore our project has the possibility of getting a patent or being published.

    We did our best to follow the IEEE standards for sizing Nickel Cadmium Batteries for use wPhotovoltaic as well as IEEEs recommended practice for the Interface of Residential andIntermediate Photovoltaic Systems. Our research group had already picked out the batteriesthe photovoltaic for us, so they had looked into this. In making our circuits we had to make our PV wouldnt have excessive voltage flickers and we also made sure that the power from PV was converted to 60 Hz AC, to match the grids AC frequency. For the batteries, our codmade sure that if the battery supply dipped below a certain value, we would have an emergencharge to bring the battery power back up to a certain percentage.

    Ethical ConsiderationsWhile working on this project, we followed the IEEE Code of Ethics. While we referenced projects and informational sites, we wrote our own code and gave all credit where it was dueOur group has always tried to help other students in the lab, especially the other group who wtrying to use the same opto-isolator as us. Our ECE 4760 class consists of students of all racgenders, and religions, and we have treated each and every one of them fairly.On our report we have accurately portrayed our design and our results, as to give an honestreview of our project. We also sought out help for circuit design because there were many wto implement current and voltage measurers. We respected the property of the other studentsnot touching things that werent ours, by following safety rules, and by avoiding horseplay inlab. Safety was our highest priority, which is why we used transformers to step down the ACsignal from 120V to 18V. We had to solder the opto-isolators, so we used goggles to protect eyes.Throughout this project we learned how to properly opto-isolate, use SPI, measure current anvoltage, rectify AC signals, operate relays, and make current sources. Therefore we broadenour knowledge of circuit design and the capabilities of microcontrollers.

    Legal Considerations

  • 8/7/2019 Solar Home Management

    13/16

    Our project is just for research purposes in order to simulate a home, so there are no legalconsiderations.

    Appendix

    Final Project Code Appendix: Schematics

  • 8/7/2019 Solar Home Management

    14/16

    Appendix: Cost

    Product Quantity Cost Each TotalAvago Technologies HCPL 7520 4 $6.02 $24.08Inverter from research group2 Transformers from Research GroupPower Supply 1 $5.00 $5.00White Board 5 $6.00 $30.00STK500 1 $15.00 $15.00 Ni-Cad Batteries2 Ohm Resistors from LabLM358 Op-Amp from LabVarious Capacitors and Resistors

    from lab

    Total $74.08

    Appendix: Tasks

    Julia Sciarello

  • 8/7/2019 Solar Home Management

    15/16

    Circuit design and experimentation Software coding Testing and debugging Report Soldering

    Carla Quiller

    Circuit design and experimentation Software coding Testing and debugging Report Webpage creation Soldering

    Mauricio Munoz

    Circuit design and experimentation Testing and debugging Soldering Software coding Webpage creation

    References:

    Datasheet: FairchildLM 358Research paper on PV simulator circuitAC Resistor Behavior Avago Technologies HCPL-7520 Linear Optoisolator ECE 476 Website Wikipedia AC power article Atmel Mega644 Microcontroller Datasheet PowerBox Bruce Land

    OPTO-ISOLATOR:

    http://www.fairchildsemi.com/ds/LM%2FLM358.pdfhttp://hyperphysics.phy-astr.gsu.edu/hbase/electric/acres.html#c2http://instruct1.cit.cornell.edu/courses/ee476/http://en.wikipedia.org/wiki/Ac_powerhttp://courses.cit.cornell.edu/ee476/FinalProjects/s2008/cj72_xg37/cj72_xg37/index.htmlhttp://www.nbb.cornell.edu/neurobio/land/http://www.nbb.cornell.edu/neurobio/land/http://www.fairchildsemi.com/ds/LM%2FLM358.pdfhttp://hyperphysics.phy-astr.gsu.edu/hbase/electric/acres.html#c2http://instruct1.cit.cornell.edu/courses/ee476/http://en.wikipedia.org/wiki/Ac_powerhttp://courses.cit.cornell.edu/ee476/FinalProjects/s2008/cj72_xg37/cj72_xg37/index.htmlhttp://www.nbb.cornell.edu/neurobio/land/
  • 8/7/2019 Solar Home Management

    16/16

    "An electronic device designed to transfer electrical signals by utilizing light wavesto provide coupling with electrical isolation between its input and output". The mainpurpose of an opto-isolator is "to prevent high voltages or rapidly changing voltageson one side of the circuit from damaging components or distorting transmissions onthe other side

    http://en.wikipedia.org/wiki/High_voltagehttp://en.wikipedia.org/wiki/File:Optoisolator_Pinout.svghttp://en.wikipedia.org/wiki/High_voltage