Top Banner

of 27

Design Project 3 Report

Apr 07, 2018

Download

Documents

dimplepatel289
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/4/2019 Design Project 3 Report

    1/27

    1

    1

    Team Foxtrot

    04 November 2010

    Solar CollectionProjectABE3042C Design 1Flora Vinson, Jason Ressler, Kathryn Chinn, Sandra Nakasone, Dimple Patel

  • 8/4/2019 Design Project 3 Report

    2/27

    2

    Table of Contents

    Abstract ...3

    Introduction 3

    Problem Statement..3

    A. Process Scheme...4

    Figure 1.4

    B. Preliminary Device. 5

    Figure 2..6

    C. Prototype Device.7

    Figure 3......8

    D. Photovoltaic Cells.. 8

    E. Stepper Motors........ 9

    F. Circuit Board... 9

    G. 1208LS USB computer control... 9

    H. Computer Programming.... 10

    I. Materials and Costs....... 10

    Table 1.....10J. Simulation..... 10

    Figure 4...... 11

    Figure 5.......................... 12

    K. Limitations.... 12

    L. Appendix... 14

    Figure 6...14

    Programming...15

    M.References. 27

  • 8/4/2019 Design Project 3 Report

    3/27

    3

    Abstract

    This project's primary objective was to construct a solar collection device using materialssuch as photovoltaic cells, a 1208LS USB computer control interface, two stepper motors, and acircuit board. After the mechanical failure of a preliminary device that attempted to rotate a

    plurality of solar cells atop pylons, a prototype device was developed with lighter materials thatexperienced less friction. This prototype device rotated a single Teflon pylon holdingphotovoltaic cells. The Teflon pylon was anchored to an angled plexiglass support, which wasthen secured to a plexiglass base. A stepper motor was attached to the plexiglass support and theplexiglass base in order to aid in biaxial rotation. A code in the C sharp program guided the 180degree rotation of the upper stepper motor from sunrise until noon, upon which the stepper motorwas deactivated. Then for one hour, the lower stepper motor aided in the 180 degree azimuthrotation of the pylon in order to allow the photovoltaic cells follow the solar elevation angle untilsunset. A brief simulation confirmed the efficiency of the prototype device against a supine,stationary photovoltaic cell. However, the collection of sunlight could have been maximized ifseasons, weather, automated programming, and simultaneous rotations could have been

    incorporated.Introduction

    The vast majority of the energy generated in the United States is dependent onnonrenewable resources like fossil fuels and nuclear power1. The use of these increasingly costlyresources has resulted in environmental repercussions such as release of atmospheric pollutants,accidental oil spills, deleterious emissions, and release of greenhouse gases. Therefore,alternative energy resources like wind or geothermal energy should be utilized; however, theefficiency of such energy sources should also be considered.

    This project will focus on solar power. The amount of energy provided by the sun is

    boundless and essentially limitless1

    . Currently, the application of solar energy includes standardcalculators and off-grid homes1. Moreover, there is no pollution associated with the productionand consumption of solar energy1. However, in the collection of solar energy, the mechanism ofsolar power collection should consider effectiveness in order not to increase the costs andmaterials needed for solar energy production1.

    In this case, the project will explore the optimization of the collection of solar energywith tools such as solar panels.

    Problem Statement

    This project aimed at collecting solar radiation. Nonetheless, as with most practicalapplications, there were constraints on the materials available for this project. Specifically, a1208LS USB Computer control interface, small photovoltaic cells, two stepper motors, and acircuit board were used. Also, a time frame of one day was imposed for the window allowed forsolar collection.

  • 8/4/2019 Design Project 3 Report

    4/27

    4

    A. Process Scheme

    The engineering design group followed a plan of action that is illustrated in Figure 1.Unfortunately, the preliminary design consumed most of the time allowance. Problemsencountered with its materials and computer programming forced abandoning the preliminary

    design. Therefore, after a brainstorming session, the group formulated a new device that wouldboth employ new materials and programming. However, because of some initial concern withthe new devices potential mechanical failure, the engineering design group was prepared toreport a device that did not meet its design goals. Fortunately, the engineering design groupprocured an efficient prototype that can be easily replicated.

    Figure 1: Process Scheme of Solar Collection Project

    Purpose: To design a device thatwill collect the most amount of sunradiation using stepper motors,solar cells and 1208LS USB

    controller.

    Brainstorming Session

    Original idea: to use wood pylons tohold 3 solar panels that willsimultaneously rotate to maximize solarcollection.

    Testing Process

    FAIL: wooden pylonsand platform were tooheavy to move, excessfriction against steppermotors. Problems

    occurred with theprogramming.

    Final idea: Teflon pylon supported 1 arrayof solar panels. Biaxial rotation with 2stepper motors and 2 two-step gears.Base and support made in plexiglass.

    Testin Process

    SUCCESS: plexiglassmaterial was thelightweight for thestepper motors to movethem. Programming inC# worked efficiently.

    Brainstorming Session

    SUCCESS: TestSimulation succeededwith Microsoft Visual.

    Completedprogramming. Realsimulation with artificiallight.

    Final Presentation and a report.

    FAIL: Explainmechanical orcomputer deficienciepresentation and repNo time for third devi

  • 8/4/2019 Design Project 3 Report

    5/27

    5

    B. Preliminary Device

    A solar collection device was constructed in order to test the efficiency of the solar panelsand the stepper motors. As indicated by Figure 2, four panels of solar cells, or photovoltaic cells,were implemented. One of the four solar cells acted as a reference cell. The other three

    photovoltaic cells were situated on top of three wooden pylons, which were propped, in turn, by2-inch long PVC pipes. The three wooden pylons had slanted faces at an angle of sixty degreesto the horizontal. These wooden pylons were then anchored into an 18-inch long wooden boardat a slight angle. This wooden board was, in turn, attached to a slightly smaller wooden board,which served as the base.

    During a trial of the preliminary device, the stepper motors, which were intended to rotatethe pylons and base board, failed to procure any movement. The ambitious preliminary devicewas speculated to be too heavy for the relatively weak stepper motors to move. In addition, loadsof the heavy materials were directly situated on top of the stepper motors. Also, the steppermotors may have experienced excess friction as they were directly attached to the wooden

    pieces.

    Therefore, the entire design was rebuilt to ease movement provided by the steppermotors. First, the device was reduced in scale to decrease its weight; only one solar panel andpylon were used. Also, the wooden base and the wooden board were replaced by plexiglass, alightweight, sturdy material with a density of 1.17 g/cm32. Although plexiglass is denser thanwood (spruce has a density of 0.7 g/cm3), the platforms and base were scaled down enough tooffset the possible increase in weight3. Likewise, the PVC pylons were replaced by a slightlydenser Teflon material (density of 2.2 g/cm3)4. This material change was done to reduce thefriction; Teflon has an extremely low coefficient of 0.054. Also, in order to ease the loads on thestepper motors, the pylons stepper motor was positioned at a 59 degree elevation angle, and the

    other stepper motor was placed adjacent to the platform. Moreover, in order to solve the problemof creating enough torque to rotate the pylon and its base, two-step gears were utilized with eachstepper motor. The gears created enough mechanical advantage to smoothly rotate the pylon andits platform without overstraining the stepper motors.

  • 8/4/2019 Design Project 3 Report

    6/27

    6

    Figure 2: Sketch of the preliminary solar collection device

    Key: Brown-wooden board; light blue-solar panels; green-wooden pylons; grey-stepper motor.

  • 8/4/2019 Design Project 3 Report

    7/27

    7

    C. Prototype Device

    In the project, two panels of solar cells, or photovoltaic cells, were implemented in theprototype device. One of the two solar cells acted as a reference cell. As indicated by Figure 3,the experimental photovoltaic cell was situated on top of one Teflon pylon at an elevation

    angle of 59 degrees (with the bottom plexiglass platform serving as the reference frame). TheTeflon pylon itself was buttressed by a plexiglass platform. The Teflon pylon was also connectedto a stepper motor (which is attached to another plexiglass support) with a two-step gear.

    In regards to the plexiglass platform, a second Teflon pylon was connected to theaforementioned platform to the much larger plexiglass base. The second, upright Teflon pylonwas connected to the second stepper motor with another two-step gear.

    In terms of the mechanism of the device, the experimental solar panel was positioned at

    an elevation angle of 59 degrees in order to mimic the solar elevation angle at sunrise

    5

    . The solarpanel pylon itself was set at an azimuth angle of 90 degrees (the angle is based on a north-basedazimuth system). With the initial position set, the angled stepper motor rotated the pylon attachedto the solar panel. From 8:00 A.M to noon, this angled stepper motor moved every 5.22 minutes;each of the successive 46 steps resulted in a slight rotation of 3.915 degrees. As a result, oncenoon struck, the solar panel was parallel to the plexiglass base (rather, the solar panel wasorthogonal to the Zenith direction in the spherical coordinate system). Also, at that time, theangled stepper motor stopped moving.

    From noon until 1:00 P.M., the upright stepper motor rotated the upright pylon attachedto the base. This upright motor moved every 1.305 minutes; each successive step resulted in aslight rotation of 3.915 degrees. This stepper motor served to move the solar panel to an azimuthangle of 270 degrees. After 1:00 P.M., the upright motor stopped moving; the angled steppermotor resumed its motion by moving every 5.22 minutes until five oclock in the afternoon.However, in contrast to its morning run, the angled stepper motor moved downwards so that thesolar panel was again at an elevation angle of 59 degrees. Also, the input of the experimentalphotovoltaic cells was compared to the energy input of the reference cell.

  • 8/4/2019 Design Project 3 Report

    8/27

    8

    Figure 3: Sketch of the solar collection prototype

    Key: Brown-plexiglass base; light blue-plexiglass platform/support; light grey-Teflon pylons;dark grey-stepper motor; black-solar panel; dark blue-gear.

    D. Photovoltaic cells

    Small squares of photovoltaic cells were used to capture solar energy. Typically,photovoltaic cells are made up of semi-conducting materials6. Within the solar cells, an electric

    field is created such that incident light on the solar cells can form an electric circuit6

    . This directcurrent electricity can then be harnessed into input energy for other appliances6.

  • 8/4/2019 Design Project 3 Report

    9/27

    9

    E. Stepper Motors

    Stepper motors are essentially electronic motors that can split a single rotation intoincremented steps. The stepper motor consists of a stator, a rotor with a shaft, and coil windings7.The stator is the stationary part of the device that encases the motor7. The rotor rotates in

    response to the commands made by the microcontroller, or the 1208LS USB computer control

    7

    .Also, the shaft helps rotate the rotor. The stepper motors course of motion is dictated by twothings: direction and step7. The controllers commands guides the direction to either beclockwise counter-clockwise. The step is associated with the degree of rotation. The entirestepper motor is powered by an H-bridge circuit.

    In this project, one stepper motor was connected to the angled Teflon pylon which holdsthe photovoltaic cells. This stepper motor is active from 8:00 A.M. until noon. Upon noon, theupright stepper motor, which is attached to the bottom Teflon pylon connected to the plexiglassbase, is then activated for one hour, upon which the angled stepper motor returns the solar panelto its initial position.

    F. Circuit board

    An H-bridge circuit board was used for the project in order to guide electrical current thatwill power the stepper motors rotating separate components of the photovoltaic-cell device. TheH-bridge circuit has the unique ability of applying a voltage across a load in any of twodirections.

    In this project, the H-bridge circuit had six components. Pins are connected to ToshibaTA8409S/SG Driver chips, which are sensitive to excess current. Also, there are two componentsthat act as outputs to the individual stepper motors. Next, there are two sets of terminals for dataacquisition (DAQ), or Digital I/O Input, which is dictated by the microcontroller. The circuit ispowered by two power inputs of five volts.

    G. 1208LS USB computer control

    The 1208LS USB computer control is a low-speed device supported by MicrosoftWindows compatible with 1.1 USB ports and 2.0 USB ports. Essentially, the USB-1208LScomputer control device provides commands for the stepper motors which dictate the movementof the device holding the photovoltaic cells.

    The USB-1208LS features eight analog inputs, two 10-bit analog outputs, 16 digital I/Oconnections, and one 32-bit external event counter8. The USB-1208LS does not need anyexternal power since it is powered by the +5 volt USB supply from the computer8. Essentially,the USB-1208LS computer control device provides commands for the stepper motors whichdictate the movement of the device holding the photovoltaic cells.

    After the USB 1208LS was calibrated, wires were used to connect the control interface tothe circuit board and the solar cell panels. The first eight analog input connectors were used toobtain data from the solar cell panels. Pins 1 and 2 are connected to the experiment photovoltaiccell, and pins 7 and 8 are connected to the reference solar cell panel.

  • 8/4/2019 Design Project 3 Report

    10/27

    10

    The I/O connections in the controller were used to send information to the circuit board.These connections are also called DAQ pins, for Data Acquisition. Pins 21 through 24 areconnected to the circuit board via small wires to the left most I/O ports and pins 25 through 28are connected to the right most ports. This connection feeds information to the circuit boardwhich later sends the command to the stepper motor for the motor to move.

    H. Computer Programming

    The program that directed the USB computer control was C sharp (C#), a programminglanguage by Microsoft. This program was used instead of the recommended Visual Basic due tothe incapability of the latter with available computer equipment.

    The program was created to control the prototype device in a predetermined sun path andto capture the most sunlight in a solar cell. The program was created for an operator to controlthe different commands manually. First, the start button needs to be pressed to begin moving theangled stepper motor from 8:00 A.M to 12 P.M. At noon, the stepper motor is halted, and theupright stepper motor begins its azimuth rotation at noon, which finishes rotating 180 degrees at1:00 P.M. To complete the simulation, the operator has to restart the angled stepper motor for the

    solar cell return to its initial position, at which point the program is terminated at 5:00 PM.

    I. Materials and Costs

    The following budget provides an overall cost analysis of the project. The most expensivematerial was the Teflon pylons. Ancillary items like wires and screws added negligibly to theoverall cost. The costlier materials, like the 1208LS USB control and the circuit board, wereprovided by the instructor and therefore not counted in the cost of this prototype.

    Table 1: Estimated costs of materials of the prototype device

    Cost of MaterialsPlexiglass platform $1.5 x 4

    Plexiglass base $3.50

    2-step gears $0.90 x 2

    Screws $0.08 x 8

    Teflon pylons $20.00

    Drill rod $4.99

    Estimated Total Cost $ 34.49

    This prototype proved to be extremely economical. At this low cost and efficiency, the

    device is very practical for larger-scale applications such as houses and commercial buildings.

    J. SimulationA simulation was conducted on the device. Instead of natural sunlight, incandescentand

    fluorescent light bulbs were manually rotated to provide light. The entire testing window for thedevice was reduced from nine hours to 4.5 minutes. As a result, the angled stepper motor movedevery 2.61 seconds; each of the successive 46 steps resulted in a slight rotation of 3.915 degrees.This aforementioned step was intended to mimic the movement of the solar panel in the morning.

  • 8/4/2019 Design Project 3 Report

    11/27

    11

    Then, in order to simulate movement from noon until 1:00 P.M., the upright steppermotor rotated the upright pylon attached to the base. This upright motor moved every 0.6525seconds; each successive step resulted in a slight rotation of 3.915 degrees. This stepper motormoved the solar panel to an azimuth angle of 270 degrees. After the pivot of the pylon was

    accomplished, the upright motor stopped moving; the angled stepper motor resumed its motionby moving every 2.61 seconds for two minutes in order to return the solar panel to its initialposition.

    As indicated by Figure 4, the experimental solar cell was successful in harnessing moresolar power than the reference cell. However, it was expected that the peak in solar output wouldoccur at 169.25 seconds into the simulation, which corresponds to noon in a real trial. Also, asapparent in Figure 5, the abrupt changes in the difference in the voltage outputs between theexperimental and solar cells were due to the mechanical errors by the operator of the artificiallight. Also, the solar elevation angle may not have been precisely replicated. Another possibleexplanation for the uneven differences could be in the human error involved in parallax.

    Nonetheless, as expected, the difference in voltage output between the reference cell and theexperimental cell increases from time 275 seconds until the end of the simulation. This trend isdue to the position of the reference cell near the base of the device such that the afternoon sun

    was measurably closer to the experimental cell than the reference cell.

    Figure 4: Voltage outputs of experimental and reference solar panel during simulation

    0

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    0 50 100 150 200 250 300 350 400

    Voltage

    (volts)

    Time (Seconds)

    Voltage Output Vs. Time

    experimental cell

    reference cell

  • 8/4/2019 Design Project 3 Report

    12/27

    12

    Figure 5: Difference in voltage outputs of experimental and reference solar panel duringsimulation

    K. Limitations

    Although this solar panel device was effective, the design did pose some limitations. Theprogramming involved with controlling the stepper motors was not automated. Therefore, if thedevice were to become large-scale, an employee would have to manually direct the programmingto rotate specific motors at the desired times.

    In addition, the reference solar cell used for the device was situated on the plexiglass

    base. The angled pylon may have cast a shadow during its rotations onto the reference solar cell,thereby affecting the readings.

    Also, the experiment assumed that sunrise occurred at eight oclock in the morning and

    sunset occurred at five oclock in the afternoon. However, the actual sunrise in Gainesville,Florida, is at 7:45 a.m.; the sunset, at 6:30 p.m9. Moreover, as the sun intensity is the highest atnoon, perhaps the device should have been simultaneously elevated in the zenith direction as itwas being rotated in the azimuth direction10. Also, the suns rotation is much more stratified thanthe small rotor motor was directed to be; perhaps an increase in the amount of steps for asmoother rotation would have yielded better results10.

    In addition, the solar collection devices programming did not account for any seasonalchanges, as the solar elevation angle is markedly different in each of the four seasons11.Similarly, the programming did not take obstructions like clouds, fog, and storms intoconsideration. Also, the use of a solar tracking device could have optimized the device12. A solartracker would have reduced the angle of incidence between the light and the cells12.

    -0.5

    0

    0.5

    1

    1.5

    2

    2.5

    0 25 50 75 100 125 150 175 200 225 250 275 300 325 350 375

    Voltage

    (volts)

    Time (seconds)

    Difference Voltage between Reference & Experimental

    Solar Cells

  • 8/4/2019 Design Project 3 Report

    13/27

    13

    Moreover, by using a combination of the two stepper motors operating in a synchronizedfashion, the solar tracker would be able to properly account for the declination of the sun at anypoint in the year. The same multi-axis rotation is used to in telescope movement. The solar cellwould then be allowed to move in its original 120 degree arc with a slight variation in each weekto account for the change in declination. The variation would be weekly due to the limited

    number of positions the motors can take. The variations would need to be governed by aalgorithm that takes into account the following parameters: position on the earth, time of day andtime of year. With theses three variables represented, an equation could be written to account forthe exact movement of the sun and concurrently counteract any obstructions such as clouds.

  • 8/4/2019 Design Project 3 Report

    14/27

    14

    L. AppendixFigure 6: Photograph of the Prototype Device

  • 8/4/2019 Design Project 3 Report

    15/27

  • 8/4/2019 Design Project 3 Report

    16/27

    16

    public Label voltage2;public Label voltage1;public Label voltage0;public Label MessageBox;private MccDaq.Range RangeSelected;

    private ErrorInfo ULStat;private DigitalPortType PortNumA = DigitalPortType.FirstPortA;private Timer timer1;private Timer timer2;private DigitalPortDirection Direction = DigitalPortDirection.DigitalOut;private Timer timer3;private CheckBox Reverse;public int currentpos = 0;public int countdownenabled = 0;private Timer timer4;private Timer timer5;

    private Button step2;private Button stop2;public int count;public int EngVolts;private TextBox textBox1;public int Chan;public frmDataDisplay(){

    // This call is required by the Windows Form Designer.InitializeComponent();// Create a new MccBoard object for Board 0DaqBoard = new MccDaq.MccBoard(0);

    RangeSelected = MccDaq.Range.Bip5Volts;

    ULStat = DaqBoard.DConfigPort(PortNumA, Direction);

    ULStat = DaqBoard.DBitOut(PortNumA, 0, DigitalLogicState.Low);

    }

    // Form overrides dispose to clean up the component list.protected override void Dispose(bool Disposing){

    if (Disposing){

    if (components != null){

    components.Dispose();

  • 8/4/2019 Design Project 3 Report

    17/27

    17

    }}base.Dispose(Disposing);

    }#region Windows Form Designer generated code

    /// /// Required method for Designer support - do not modify/// the contents of this method with the code editor.///

    private void InitializeComponent(){

    this.components = new System.ComponentModel.Container();this.ToolTip1 = new System.Windows.Forms.ToolTip(this.components);this.cmdStartConvert = new System.Windows.Forms.Button();this.cmdStopConvert = new System.Windows.Forms.Button();

    this.tmrConvert = new System.Windows.Forms.Timer(this.components);this.lblValueRead = new System.Windows.Forms.Label();this.voltage3 = new System.Windows.Forms.Label();this.voltage2 = new System.Windows.Forms.Label();this.voltage1 = new System.Windows.Forms.Label();this.voltage0 = new System.Windows.Forms.Label();this.MessageBox = new System.Windows.Forms.Label();this.timer1 = new System.Windows.Forms.Timer(this.components);this.timer2 = new System.Windows.Forms.Timer(this.components);this.timer3 = new System.Windows.Forms.Timer(this.components);this.Reverse = new System.Windows.Forms.CheckBox();this.timer4 = new System.Windows.Forms.Timer(this.components);this.timer5 = new System.Windows.Forms.Timer(this.components);this.step2 = new System.Windows.Forms.Button();this.stop2 = new System.Windows.Forms.Button();this.textBox1 = new System.Windows.Forms.TextBox();this.SuspendLayout();//// cmdStartConvert//this.cmdStartConvert.BackColor = System.Drawing.SystemColors.Control;this.cmdStartConvert.Cursor = System.Windows.Forms.Cursors.Default;this.cmdStartConvert.Font = new System.Drawing.Font("Arial", 8F,

    System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.cmdStartConvert.ForeColor = System.Drawing.SystemColors.ControlText;this.cmdStartConvert.Location = new System.Drawing.Point(296, 224);this.cmdStartConvert.Name = "cmdStartConvert";this.cmdStartConvert.RightToLeft = System.Windows.Forms.RightToLeft.No;this.cmdStartConvert.Size = new System.Drawing.Size(52, 26);this.cmdStartConvert.TabIndex = 5;

  • 8/4/2019 Design Project 3 Report

    18/27

    18

    this.cmdStartConvert.Text = "Start";this.cmdStartConvert.UseVisualStyleBackColor = false;this.cmdStartConvert.Click += new System.EventHandler(this.cmdStartConvert_Click);//// cmdStopConvert

    //this.cmdStopConvert.BackColor = System.Drawing.SystemColors.Control;this.cmdStopConvert.Cursor = System.Windows.Forms.Cursors.Default;this.cmdStopConvert.Font = new System.Drawing.Font("Arial", 8F,

    System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.cmdStopConvert.ForeColor = System.Drawing.SystemColors.ControlText;this.cmdStopConvert.Location = new System.Drawing.Point(296, 224);this.cmdStopConvert.Name = "cmdStopConvert";this.cmdStopConvert.RightToLeft = System.Windows.Forms.RightToLeft.No;this.cmdStopConvert.Size = new System.Drawing.Size(52, 26);this.cmdStopConvert.TabIndex = 6;

    this.cmdStopConvert.Text = "Quit";this.cmdStopConvert.UseVisualStyleBackColor = false;this.cmdStopConvert.Visible = false;this.cmdStopConvert.Click += new System.EventHandler(this.cmdStopConvert_Click);//// tmrConvert//this.tmrConvert.Interval = 500;this.tmrConvert.Tick += new System.EventHandler(this.tmrConvert_Tick);//// lblValueRead//this.lblValueRead.BackColor = System.Drawing.SystemColors.Window;this.lblValueRead.Cursor = System.Windows.Forms.Cursors.Default;this.lblValueRead.Font = new System.Drawing.Font("Arial", 8F,

    System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.lblValueRead.ForeColor = System.Drawing.SystemColors.WindowText;this.lblValueRead.Location = new System.Drawing.Point(12, 123);this.lblValueRead.Name = "lblValueRead";this.lblValueRead.RightToLeft = System.Windows.Forms.RightToLeft.No;this.lblValueRead.Size = new System.Drawing.Size(184, 16);this.lblValueRead.TabIndex = 3;this.lblValueRead.Text = "reference voltage channel";this.lblValueRead.TextAlign = System.Drawing.ContentAlignment.MiddleRight;//// voltage3//this.voltage3.Font = new System.Drawing.Font("Arial", 8F);this.voltage3.ForeColor = System.Drawing.Color.Blue;this.voltage3.Location = new System.Drawing.Point(208, 192);

  • 8/4/2019 Design Project 3 Report

    19/27

    19

    this.voltage3.Name = "voltage3";this.voltage3.Size = new System.Drawing.Size(144, 16);this.voltage3.TabIndex = 9;this.voltage3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;//

    // voltage2//this.voltage2.Font = new System.Drawing.Font("Arial", 8F);this.voltage2.ForeColor = System.Drawing.Color.Blue;this.voltage2.Location = new System.Drawing.Point(222, 156);this.voltage2.Name = "voltage2";this.voltage2.Size = new System.Drawing.Size(144, 16);this.voltage2.TabIndex = 10;this.voltage2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;//// voltage1

    //this.voltage1.Font = new System.Drawing.Font("Arial", 8F);this.voltage1.ForeColor = System.Drawing.Color.Blue;this.voltage1.Location = new System.Drawing.Point(222, 123);this.voltage1.Name = "voltage1";this.voltage1.Size = new System.Drawing.Size(144, 16);this.voltage1.TabIndex = 11;this.voltage1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;//// voltage0//this.voltage0.Font = new System.Drawing.Font("Arial", 8F);this.voltage0.ForeColor = System.Drawing.Color.Blue;this.voltage0.Location = new System.Drawing.Point(222, 92);this.voltage0.Name = "voltage0";this.voltage0.Size = new System.Drawing.Size(144, 16);this.voltage0.TabIndex = 12;this.voltage0.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;//// MessageBox//this.MessageBox.BackColor = System.Drawing.SystemColors.Window;this.MessageBox.Cursor = System.Windows.Forms.Cursors.Default;this.MessageBox.Font = new System.Drawing.Font("Arial", 8F,

    System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.MessageBox.ForeColor = System.Drawing.SystemColors.WindowText;this.MessageBox.Location = new System.Drawing.Point(12, 92);this.MessageBox.Name = "MessageBox";this.MessageBox.RightToLeft = System.Windows.Forms.RightToLeft.No;this.MessageBox.Size = new System.Drawing.Size(184, 16);

  • 8/4/2019 Design Project 3 Report

    20/27

    20

    this.MessageBox.TabIndex = 13;this.MessageBox.Text = "voltage channel 1";this.MessageBox.TextAlign = System.Drawing.ContentAlignment.MiddleRight;//// timer1

    //this.timer1.Enabled = true;this.timer1.Tick += new System.EventHandler(this.timer1_Tick);//// timer2//this.timer2.Interval = 1305;this.timer2.Tick += new System.EventHandler(this.timer2_Tick);//// timer3//

    this.timer3.Interval = 20;this.timer3.Tick += new System.EventHandler(this.timer3_Tick);//// Reverse//this.Reverse.AutoSize = true;this.Reverse.Location = new System.Drawing.Point(15, 224);this.Reverse.Name = "Reverse";this.Reverse.Size = new System.Drawing.Size(72, 18);this.Reverse.TabIndex = 16;this.Reverse.Text = "Reverse";this.Reverse.UseVisualStyleBackColor = true;//// timer4//this.timer4.Interval = 326;this.timer4.Tick += new System.EventHandler(this.timer4_Tick);//// timer5//this.timer5.Interval = 25;this.timer5.Tick += new System.EventHandler(this.timer5_Tick);//// step2//this.step2.Location = new System.Drawing.Point(157, 224);this.step2.Name = "step2";this.step2.Size = new System.Drawing.Size(75, 23);this.step2.TabIndex = 17;this.step2.Text = "step2";

  • 8/4/2019 Design Project 3 Report

    21/27

    21

    this.step2.UseVisualStyleBackColor = true;this.step2.Click += new System.EventHandler(this.step2_Click);//// stop2//

    this.stop2.Location = new System.Drawing.Point(157, 224);this.stop2.Name = "stop2";this.stop2.Size = new System.Drawing.Size(75, 23);this.stop2.TabIndex = 18;this.stop2.Text = "stop2";this.stop2.UseVisualStyleBackColor = true;this.stop2.Visible = false;this.stop2.Click += new System.EventHandler(this.stop2_Click);//// textBox1//

    this.textBox1.Location = new System.Drawing.Point(13, 13);this.textBox1.Name = "textBox1";this.textBox1.Size = new System.Drawing.Size(100, 20);this.textBox1.TabIndex = 19;this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);//// frmDataDisplay//this.AcceptButton = this.cmdStartConvert;this.AutoScaleBaseSize = new System.Drawing.Size(6, 13);this.BackColor = System.Drawing.SystemColors.Window;this.ClientSize = new System.Drawing.Size(400, 277);this.Controls.Add(this.textBox1);this.Controls.Add(this.stop2);this.Controls.Add(this.step2);this.Controls.Add(this.Reverse);this.Controls.Add(this.MessageBox);this.Controls.Add(this.voltage0);this.Controls.Add(this.voltage1);this.Controls.Add(this.voltage2);this.Controls.Add(this.voltage3);this.Controls.Add(this.cmdStartConvert);this.Controls.Add(this.cmdStopConvert);this.Controls.Add(this.lblValueRead);this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold,

    System.Drawing.GraphicsUnit.Point, ((byte)(0)));this.ForeColor = System.Drawing.SystemColors.WindowText;this.Location = new System.Drawing.Point(182, 100);this.Name = "frmDataDisplay";this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;

  • 8/4/2019 Design Project 3 Report

    22/27

    22

    this.Text = "Universal Library Voltage Input";this.Load += new System.EventHandler(this.frmDataDisplay_Load);this.ResumeLayout(false);this.PerformLayout();

    }

    #endregion/// /// The main entry point for the application./// [STAThread]static void Main(){

    Application.Run(new frmDataDisplay());}private void cmdStartConvert_Click(object eventSender, System.EventArgs eventArgs) /*

    Handles cmdStartConvert.Click */

    { if (timer2.Enabled == false)timer2.Enabled = true;

    cmdStartConvert.Visible = false;cmdStopConvert.Visible = true;tmrConvert.Enabled = true;

    }private void cmdStopConvert_Click(object eventSender, System.EventArgs eventArgs) /*

    Handles cmdStopConvert.Click */{

    if (timer2.Enabled == true)timer2.Enabled = false;

    tmrConvert.Enabled = false;Application.Exit();

    }private void frmDataDisplay_Load(object eventSender, System.EventArgs eventArgs) /*

    Handles base.Load */{

    MccDaq.ErrorInfo ULStat;// Initiate error handling// activating error handling will trap errors like// bad channel numbers and non-configured conditions.// Parameters:// MccDaq.ErrorReporting.PrintAll :all warnings and errors encountered will be

    printed// MccDaq.ErrorHandling.StopAll :if an error is encountered, the program will stopULStat = MccDaq.MccService.ErrHandling(MccDaq.ErrorReporting.PrintAll,

    MccDaq.ErrorHandling.StopAll);}

  • 8/4/2019 Design Project 3 Report

    23/27

    23

    private void tmrConvert_Tick(object eventSender, System.EventArgs eventArgs) /*Handles tmrConvert.Tick */

    {MccDaq.ErrorInfo ULStat;float DataValue;

    MccDaq.VInOptions Options;//tmrConvert.Stop();// Collect the data by calling VIn memeber function of MccBoard object// Parameters:// Chan :the input channel number// Range :the Range for the board.// DataValue :the name for the value collectedChan = 0; // set input channelOptions = VInOptions.Default;ULStat = DaqBoard.VIn(Chan, RangeSelected, out DataValue, Options);

    if (ULStat.Value == MccDaq.ErrorInfo.ErrorCode.BadRange){//MessasgeBox.Show( "Change the Range argument to one supported by this board.",

    "Unsupported Range", 0);}voltage0.Text = DataValue.ToString(); // print the countsChan = 1; // set input channelOptions = VInOptions.Default;ULStat = DaqBoard.VIn(Chan, RangeSelected, out DataValue, Options);if (ULStat.Value == MccDaq.ErrorInfo.ErrorCode.BadRange){

    //MessasgeBox.Show("Change the Range argument to one supported by this board.","Unsupported Range", 0);

    }voltage1.Text = DataValue.ToString(); // print the counts// Write the string to a file.System.IO.StreamWriter file = new

    System.IO.StreamWriter("C:\\Users\\flora\\Desktop\\example.txt",true);file.WriteLine(voltage0.Text + ", " + voltage1.Text + ", " + textBox1.Text);

    file.Close();}private void cmbRange_SelectedIndexChanged(object sender, System.EventArgs e){

    // RangeSelected = (MccDaq.Range)(cmbRange.SelectedItem);}private void timer1_Tick(object sender, EventArgs e){

    textBox1.Text = DateTime.Now.ToLongTimeString();}

  • 8/4/2019 Design Project 3 Report

    24/27

    24

    private void lblClock_Click(object sender, EventArgs e){}private void timer2_Tick(object sender, EventArgs e){

    ULStat = DaqBoard.DBitOut(PortNumA, currentpos, DigitalLogicState.Low);if (Reverse.Checked == false){

    switch (currentpos){

    case 0:currentpos = 3;break;

    case 1:currentpos = 2;break;

    case 2:currentpos = 0;break;

    case 3:default:

    currentpos = 1;break;

    }}else{

    switch (currentpos){

    case 0:currentpos = 2;break;

    case 1:currentpos = 3;break;

    case 2:currentpos = 1;break;

    case 3:default:

    currentpos = 0;break;

    }}ULStat = DaqBoard.DBitOut(PortNumA, currentpos, DigitalLogicState.High);timer3.Enabled = true;

  • 8/4/2019 Design Project 3 Report

    25/27

    25

    if (countdownenabled == 1){

    count = count - 1;if (count

  • 8/4/2019 Design Project 3 Report

    26/27

    26

    currentpos = 6;break;

    case 6:currentpos = 4;break;

    case 7:default:currentpos = 5;break;

    }}ULStat = DaqBoard.DBitOut(PortNumA, currentpos, DigitalLogicState.High);timer5.Enabled = true;if (countdownenabled == 1){count = count - 1; if (count

  • 8/4/2019 Design Project 3 Report

    27/27

    M. References1. Solar Power Organization. "Alternative Energy." Cooler Planet, n.d. Web. 4 Nov 2010.

    .

    2. MakeItForm. "Compare 2 Materials." N.p., n.d. Web. 4 Nov 2010.

    .

    3. "Wood Densities."Engineering Tool Box. N.p., n.d. Web. 4 Nov 2010.

    .

    4. "Fluoropolymer Comparisons: Typical Properties."DuPont Teflon fluoropolymer resins.

    DuPont Corporation, n.d. Web. 4 Nov 2010.

    .

    5. NOAA ESRL, . "Solar Position Calculator." National Oceanic & Atmospheric Association, n.d.

    Web. 4 Nov 2010. .6. Lorenzo, Eduardo. "Solar electricity: engineering of photovoltaic systems." Progensa, 1994.

    Web. 4 Nov 2010.

    7. Kuphaldt, Tony. "Stepper Motors."Motors. N.p., n.d. Web. 4 Nov 2010.

    .

    8. "User's Guide." USB-1208LS. Measurement Computing, n.d. Web. 4 Nov 2010.

    .

    9. Edwards, Steve. "Custom Sunrise Sunset Calculator." N.p., 2002. Web. 4 Nov 2010.

    .

    10.Pidwirny, Michael. "Earth-Sun Relationships and Insolation." Physical Geography.net.

    University of British Columbia Okanagan, n.d. Web. 4 Nov 2010.

    .

    11."Seasonal Changes and Predictions." Environmental Literacy Council, n.d. Web. 4 Nov 2010.

    .

    12.Lundahl, Rob. "Solar Tracking Panel." ATR, n.d. Web. 4 Nov 2010.

    .