<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://socialledge.com/sjsu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Matt+s13</id>
		<title>Embedded Systems Learning Academy - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://socialledge.com/sjsu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Matt+s13"/>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php/Special:Contributions/Matt_s13"/>
		<updated>2026-04-29T19:50:16Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3885</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3885"/>
				<updated>2013-05-23T20:05:04Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Pulse Width Modulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solar Panel Tracker ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ProjectFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' Design Flowchart &amp;lt;/div&amp;gt;&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using servo belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 3:''' SjOne Board Schematic &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 4:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pulse Width Modulation ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from 0.2 ms to 3.3 ms.  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 5:''' PWM duty cycle example &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Analog-to-Digital-Converter ====&lt;br /&gt;
ADC, or Analog-to-Digital-Converter, was used to convert the analog photoresistor circuit voltage into a digital value for processing.  The pins ADC-4 and ADC-5 were used in the system, each connected to the output of one of the photoresistor circuits.  The raw value was tough to work with, so a conversion to a more manageable range of values was implemented in higher level code.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 6:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 7:''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 8:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 9:''' PWM Match Register block diagram &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 10:''' getDirection function &amp;lt;/div&amp;gt;&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 11:''' change_direction_withDegree function &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 12:''' Servo Task &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Ultimately, we were not able to make it completely battery powered.  Otherwise, the project turned out well.  The Solar Panel Tracker correctly sensed the light and adjusted accordingly.  The main difficulties were with mounting the servos, keeping the wires protected, and other minor adjustments to the design, which wasted an unfortunate amount of time.  Had we been able to finish the design and made it portable earlier, we would have had time to add other features, such as an LED matrix to display status values.  Despite the structural difficulties, we learned and experienced much from the project, such as FreeRTOS implementation, driver development, how to implement Pulse Width Modulation and Analog-to-Digital Conversion, how to use servo motors and photoresistors.  Overall, it was a successful project without extra functions.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
[http://youtu.be/hmtO0O_00to Demonstration Video]&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3882</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3882"/>
				<updated>2013-05-23T19:59:22Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solar Panel Tracker ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ProjectFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' Design Flowchart &amp;lt;/div&amp;gt;&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using servo belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 3:''' SjOne Board Schematic &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 4:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pulse Width Modulation ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 5:''' PWM duty cycle example &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Analog-to-Digital-Converter ====&lt;br /&gt;
ADC, or Analog-to-Digital-Converter, was used to convert the analog photoresistor circuit voltage into a digital value for processing.  The pins ADC-4 and ADC-5 were used in the system, each connected to the output of one of the photoresistor circuits.  The raw value was tough to work with, so a conversion to a more manageable range of values was implemented in higher level code.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 6:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 7:''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 8:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 9:''' PWM Match Register block diagram &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 10:''' getDirection function &amp;lt;/div&amp;gt;&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 11:''' change_direction_withDegree function &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 12:''' Servo Task &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
Ultimately, we were not able to make it completely battery powered.  Otherwise, the project turned out well.  The Solar Panel Tracker correctly sensed the light and adjusted accordingly.  The main difficulties were with mounting the servos, keeping the wires protected, and other minor adjustments to the design, which wasted an unfortunate amount of time.  Had we been able to finish the design and made it portable earlier, we would have had time to add other features, such as an LED matrix to display status values.  Despite the structural difficulties, we learned and experienced much from the project, such as FreeRTOS implementation, driver development, how to implement Pulse Width Modulation and Analog-to-Digital Conversion, how to use servo motors and photoresistors.  Overall, it was a successful project without extra functions.&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
[http://youtu.be/hmtO0O_00to Demonstration Video]&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3879</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3879"/>
				<updated>2013-05-23T19:36:09Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solar Panel Tracker ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ProjectFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' Design Flowchart &amp;lt;/div&amp;gt;&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using servo belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 3:''' SjOne Board Schematic &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 4:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pulse Width Modulation ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 5:''' PWM duty cycle example &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Analog-to-Digital-Converter ====&lt;br /&gt;
ADC, or Analog-to-Digital-Converter, was used to convert the analog photoresistor circuit voltage into a digital value for processing.  The pins ADC-4 and ADC-5 were used in the system, each connected to the output of one of the photoresistor circuits.  The raw value was tough to work with, so a conversion to a more manageable range of values was implemented in higher level code.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 6:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 7:''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 8:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 9:''' PWM Match Register block diagram &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 10:''' getDirection function &amp;lt;/div&amp;gt;&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 11:''' change_direction_withDegree function &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 12:''' Servo Task &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
[http://youtu.be/hmtO0O_00to Demonstration Video]&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3814</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3814"/>
				<updated>2013-05-23T05:22:41Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solar Panel Tracker ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ProjectFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' Design Flowchart &amp;lt;/div&amp;gt;&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using servo belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 3:''' SjOne Board Schematic &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 4:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pulse Width Modulation ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 5:''' PWM duty cycle example &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Analog-to-Digital-Converter ====&lt;br /&gt;
ADC, or Analog-to-Digital-Converter, was used to convert the analog photoresistor circuit voltage into a digital value for processing.  The pins ADC-4 and ADC-5 were used in the system, each connected to the output of one of the photoresistor circuits.  The raw value was tough to work with, so a conversion to a more manageable range of values was implemented in higher level code.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 6:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 7:''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 8:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 9:''' PWM Match Register block diagram &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 10:''' getDirection function &amp;lt;/div&amp;gt;&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 11:''' change_direction_withDegree function &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 12:''' Servo Task &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
[http://youtu.be/hmtO0O_00to Demonstration Video]&amp;lt;BR/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SoftwareFlowchart.png&amp;diff=3722</id>
		<title>File:CmpE146 S13 SPT SoftwareFlowchart.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SoftwareFlowchart.png&amp;diff=3722"/>
				<updated>2013-05-22T06:24:11Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: uploaded a new version of &amp;amp;quot;File:CmpE146 S13 SPT SoftwareFlowchart.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3718</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3718"/>
				<updated>2013-05-22T06:21:20Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Design &amp;amp; Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solar Panel Tracker ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ProjectFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' Design Flowchart &amp;lt;/div&amp;gt;&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using servo belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 3:''' SjOne Board Schematic &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 4:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pulse Width Modulation ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 5:''' PWM duty cycle example &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Analog-to-Digital-Converter ====&lt;br /&gt;
ADC, or Analog-to-Digital-Converter, was used to convert the analog photoresistor circuit voltage into a digital value for processing.  The pins ADC-4 and ADC-5 were used in the system, each connected to the output of one of the photoresistor circuits.  The raw value was tough to work with, so a conversion to a more manageable range of values was implemented in higher level code.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 6:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 7:''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 8:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 9:''' PWM Match Register block diagram &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 10:''' getDirection function &amp;lt;/div&amp;gt;&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 11:''' change_direction_withDegree function &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 12:''' Servo Task &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_ProjectFlowchart.png&amp;diff=3715</id>
		<title>File:CmpE146 S13 SPT ProjectFlowchart.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_ProjectFlowchart.png&amp;diff=3715"/>
				<updated>2013-05-22T06:18:55Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3693</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3693"/>
				<updated>2013-05-22T05:57:44Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Design &amp;amp; Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solar Panel Tracker ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using servo belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOne Board Schematic &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 3:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pulse Width Modulation ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 4:''' PWM duty cycle example &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Analog-to-Digital-Converter ====&lt;br /&gt;
ADC, or Analog-to-Digital-Converter, was used to convert the analog photoresistor circuit voltage into a digital value for processing.  The pins ADC-4 and ADC-5 were used in the system, each connected to the output of one of the photoresistor circuits.  The raw value was tough to work with, so a conversion to a more manageable range of values was implemented in higher level code.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 5:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 6:''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 7:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 8:''' PWM Match Register block diagram &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 9:''' getDirection function &amp;lt;/div&amp;gt;&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 10:''' change_direction_withDegree function &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 11:''' Servo Task &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3681</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3681"/>
				<updated>2013-05-22T05:47:45Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Design &amp;amp; Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solar Panel Tracker ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using servo belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pulse Width Modulation ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== Analog-to-Digital-Converter ====&lt;br /&gt;
ADC, or Analog-to-Digital-Converter, was used to convert the analog photoresistor circuit voltage into a digital value for processing.  The pins ADC-4 and ADC-5 were used in the system, each connected to the output of one of the photoresistor circuits.  The raw value was tough to work with, so a conversion to a more manageable range of values was implemented in higher level code.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3664</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3664"/>
				<updated>2013-05-22T05:30:31Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Project Title */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Solar Panel Tracker ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3663</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3663"/>
				<updated>2013-05-22T05:28:57Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Hardware Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Structure Design=====&lt;br /&gt;
The structure of the Solar Panel Tracker consists of a 'base' servo to rotate the solar cell to a position in a 180 degree arch, and a 'top' servo which tilts the 'arm' which holds the solar cell and a photoresistor circuit.  A second photoresistor circuit, used for the base direction logic, is located on top of the structure and angled in the same direction of the base rotational range.  The base servo rotates the structure using belts and pulleys which move the structure resting on an old computer fan bearing.  This provides for a smooth rotation.&lt;br /&gt;
&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3655</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3655"/>
				<updated>2013-05-22T05:16:54Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
Our software design centered on using two tasks to pass data used to track the sun.  One task was a Light Sensor task, which is used to load data into the Queue, destined for the other task, a Servo Motor task.  The Servo Motor task then calls a function to change the servo position.  In order to support the tasks, and bridge the gap between them and the drivers, the LightSensors.cpp and ServoMotor.cpp source files were created.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :''' Flowchart of the Software Design &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3654</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3654"/>
				<updated>2013-05-22T05:15:42Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Testing &amp;amp; Technical Challenges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :'''  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motor Mounting challenge ===&lt;br /&gt;
Initially, the base servo was mounted directly to the base, holding up the other servo, solar cell, etc.  The base was unsteady and had a risk of damaging the servo.  To fix this, the top servo, solar cell, etc. were mounted on an old computer fan bearing.  The base servo motor was moved off to the side, with 2 belts and pulleys used to translate the rotation to the structure on the base.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
We tested the system after full integration by using a flashlight as a simulated sun.  The Solar Panel Tracker correctly adjusted for every sun movement.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3649</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3649"/>
				<updated>2013-05-22T05:06:52Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Testing &amp;amp; Technical Challenges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :'''  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
=== Servo Motors Testing ===&lt;br /&gt;
We tested the Servo motors by sending an increasing range of active duty cycle time until the full range was found.  Normally, servo motors have an active duty cycle range of 1.0 ms to 2.0 ms.  Our servo motors had an actual range of 0.2 ms to 3.3 ms.  Once we found this range, we had no  problems with the servo motors.&lt;br /&gt;
&lt;br /&gt;
=== Photoresistor Circuit Testing ===&lt;br /&gt;
We tested the photoresistor circuit by connecting it to an ADC pin and monitoring the digital values.  Varying amounts of light were given to the circuit and appropriate changes in values were observed.  For example, when the photoresistor connected to 5V receives more light than the other photoresistor(connected to ground), the voltage to the ADC pin drops.  A corresponding drop in value was observed with the digital value.  The same comparison was true with a spike in voltage and the spike in digital value, when the other photoresistor receives more light.&lt;br /&gt;
&lt;br /&gt;
=== Integrated Testing ===&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3639</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3639"/>
				<updated>2013-05-22T04:46:44Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Acknowledgement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :'''  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3637</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3637"/>
				<updated>2013-05-22T04:46:19Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Acknowledgement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :'''  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Preet Kang&lt;br /&gt;
Dr. Haluk Ozemek&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3606</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3606"/>
				<updated>2013-05-22T03:53:11Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :'''  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_ServoTask.png‎ |center|frame]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_ServoTask.png&amp;diff=3597</id>
		<title>File:CmpE146 S13 SPT ServoTask.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_ServoTask.png&amp;diff=3597"/>
				<updated>2013-05-22T03:50:27Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3596</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3596"/>
				<updated>2013-05-22T03:42:48Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :'''  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' Pins used for ADC and PWM &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3590</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3590"/>
				<updated>2013-05-22T03:39:21Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Light-sensing Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :'''  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only function that the Light-sensing task needs to use is the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3523</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3523"/>
				<updated>2013-05-22T00:58:40Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SoftwareFlowchart.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure :'''  &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only functions that the Light-sensing task needs to deal with is the &amp;lt;i&amp;gt;getDirectionTop()&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;getDirectionBase()&amp;lt;/i&amp;gt; functions.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SoftwareFlowchart.png&amp;diff=3522</id>
		<title>File:CmpE146 S13 SPT SoftwareFlowchart.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SoftwareFlowchart.png&amp;diff=3522"/>
				<updated>2013-05-22T00:57:01Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:146SoftwareFlowchart.png&amp;diff=3520</id>
		<title>File:146SoftwareFlowchart.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:146SoftwareFlowchart.png&amp;diff=3520"/>
				<updated>2013-05-22T00:51:52Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3519</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3519"/>
				<updated>2013-05-22T00:24:54Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
[[File:146changeDirectionCodeSnippet.png‎ |center|frame]]&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only functions that the Light-sensing task needs to deal with is the &amp;lt;i&amp;gt;getDirectionTop()&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;getDirectionBase()&amp;lt;/i&amp;gt; functions.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3518</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3518"/>
				<updated>2013-05-22T00:23:03Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Servo motor Logic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file contains the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which updates the PWM Match Register for the given PWM signal and the degree. This function takes the degree value, ensures that it is within range, then converts it into milliseconds so it can be written to the respective Match Register, using the &amp;lt;i&amp;gt;PWMUpdateMR()&amp;lt;/i&amp;gt; function defined in the PWM driver file. We used the definitions &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt;, and &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt;, whose values may need to be changed if a different servo motor is used.  &amp;lt;i&amp;gt;Max_degree&amp;lt;/i&amp;gt; is the farthest degree available to the servo motor (180), &amp;lt;i&amp;gt;freq_ms&amp;lt;/i&amp;gt; is the duty cycle (20 ms), and the &amp;lt;i&amp;gt;Servo_Width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Servo_Start&amp;lt;/i&amp;gt; are derived from the duty cycle thresholds (in ms) mapped to the degree range (0 - 180) of the servo motor.&lt;br /&gt;
&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only functions that the Light-sensing task needs to deal with is the &amp;lt;i&amp;gt;getDirectionTop()&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;getDirectionBase()&amp;lt;/i&amp;gt; functions.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:146changeDirectionCodeSnippet.png&amp;diff=3515</id>
		<title>File:146changeDirectionCodeSnippet.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:146changeDirectionCodeSnippet.png&amp;diff=3515"/>
				<updated>2013-05-22T00:12:20Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: uploaded a new version of &amp;amp;quot;File:146changeDirectionCodeSnippet.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:146changeDirectionCodeSnippet.png&amp;diff=3514</id>
		<title>File:146changeDirectionCodeSnippet.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:146changeDirectionCodeSnippet.png&amp;diff=3514"/>
				<updated>2013-05-22T00:11:27Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3509</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3509"/>
				<updated>2013-05-21T23:55:24Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Light sensor Logic ====&lt;br /&gt;
The &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file contains the functions that the Light-sensing task calls.  These functions are &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt;, which reads the referenced Analog-to-Digital Converter pin (ADC-4 or ADC-5), and returns a value which is the new change in direction for the respective servo motor (Top or Base).  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function reads the ADC pin value and uses it to decide which direction the servo should move towards, and returns either a positive &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, a negative &amp;lt;i&amp;gt;degreeChange&amp;lt;/i&amp;gt;, or a 0 for no change.  For this project, we decided to use 5 degrees as the degree change.  The &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; function can be seen below:&lt;br /&gt;
&lt;br /&gt;
[[File:146getDirectionBaseCodeSnippet.png|center|frame]]&lt;br /&gt;
==== Servo motor Logic ====&lt;br /&gt;
&lt;br /&gt;
==== Light-sensing Task ====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only functions that the Light-sensing task needs to deal with is the &amp;lt;i&amp;gt;getDirectionTop()&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;getDirectionBase()&amp;lt;/i&amp;gt; functions.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
==== Servo Task ====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:146getDirectionBaseCodeSnippet.png&amp;diff=3508</id>
		<title>File:146getDirectionBaseCodeSnippet.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:146getDirectionBaseCodeSnippet.png&amp;diff=3508"/>
				<updated>2013-05-21T23:52:31Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: uploaded a new version of &amp;amp;quot;File:146getDirectionBaseCodeSnippet.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:146getDirectionBaseCodeSnippet.png&amp;diff=3502</id>
		<title>File:146getDirectionBaseCodeSnippet.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:146getDirectionBaseCodeSnippet.png&amp;diff=3502"/>
				<updated>2013-05-21T23:41:51Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: uploaded a new version of &amp;amp;quot;File:146getDirectionBaseCodeSnippet.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:146getDirectionBaseCodeSnippet.png&amp;diff=3498</id>
		<title>File:146getDirectionBaseCodeSnippet.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:146getDirectionBaseCodeSnippet.png&amp;diff=3498"/>
				<updated>2013-05-21T23:32:40Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:146ServoPWM.png&amp;diff=3336</id>
		<title>File:146ServoPWM.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:146ServoPWM.png&amp;diff=3336"/>
				<updated>2013-05-20T05:15:21Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: uploaded a new version of &amp;amp;quot;File:146ServoPWM.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3335</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3335"/>
				<updated>2013-05-20T05:13:15Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
The Light-sensing task was very simple.  To keep it this way, all of the 'heavy lifting' was completed in lower level code in the &amp;lt;i&amp;gt;LightSensors.cpp&amp;lt;/i&amp;gt; file.  Therefore, the only functions that the Light-sensing task needs to deal with is the &amp;lt;i&amp;gt;getDirectionTop()&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;getDirectionBase()&amp;lt;/i&amp;gt; functions.    However, there is a small amount of code to prevent the degree values from going out of range (0-180 degrees).  The task reads the &amp;lt;i&amp;gt;getDirection()&amp;lt;/i&amp;gt; values for both the top and base servo motors, which have valid values of negative five (-5), zero (0), or positive five (5).  These values are added to the current positional value to obtain updated values to pass to the Servo Motor task through the Queue.&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
The Servo Task is even simpler.  It takes the top and base positional values from the Queue, then passes the value to the servo motors using the &amp;lt;i&amp;gt;change_direction_withDegree()&amp;lt;/i&amp;gt; function, which is defined in the &amp;lt;i&amp;gt;ServoMotors.cpp&amp;lt;/i&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3275</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3275"/>
				<updated>2013-05-18T20:56:21Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* PWM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
[[File:146ServoPWM.png|center|frame]]&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:146ServoPWM.png&amp;diff=3270</id>
		<title>File:146ServoPWM.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:146ServoPWM.png&amp;diff=3270"/>
				<updated>2013-05-18T20:50:54Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3265</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3265"/>
				<updated>2013-05-18T20:19:22Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Hardware Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
=====Light Sensor=====&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Servo Motor=====&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3261</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3261"/>
				<updated>2013-05-18T20:12:00Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Design &amp;amp; Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
Light Sensor&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo Motor&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3260</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3260"/>
				<updated>2013-05-18T20:10:20Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Hardware Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
Light Sensor&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo Motor&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3259</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3259"/>
				<updated>2013-05-18T20:08:56Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Hardware Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
Light Sensor&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo Motor&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PWM ====&lt;br /&gt;
PWM, or Pulse Width Modulation, was used to control the two 180 degree positional servos.  The servos required a 50 Hz (20 ms) duty cycle, and the duration of the high duty cycle (in milliseconds) would control the position to move to.  Typically, the valid high duty cycles are between 1.0 and 2.0 milliseconds, with 1.0 representing '0 degrees', 1.5 representing '90 degrees' and 2.0 representing '180 degrees.'  However, we found that the valid duty cycle range was larger, ranging from [INSERT FULL RANGE].  Knowing this, we expanded the range of the duty cycle and converted the range into a degree range with the &amp;lt;i&amp;gt;change_direction_with_Degree()&amp;lt;/i&amp;gt; function.  The servos were connected to a 5V power supply and were controlled by PWM1-4(P1.23)and PWM1-5(P1.24).&lt;br /&gt;
&lt;br /&gt;
==== ADC ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SjOneIO.png&amp;diff=3215</id>
		<title>File:CmpE146 S13 SPT SjOneIO.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SjOneIO.png&amp;diff=3215"/>
				<updated>2013-05-17T23:19:12Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: SjOneIO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SjOneIO&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3214</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3214"/>
				<updated>2013-05-17T23:17:52Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Design &amp;amp; Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
Light Sensor&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo Motor&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardSchematic.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneIO.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3213</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3213"/>
				<updated>2013-05-17T23:13:56Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
Light Sensor&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo Motor&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_FreeRTOS.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' FreeRTOS &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3212</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3212"/>
				<updated>2013-05-17T23:12:31Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Hardware Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
Light Sensor&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:CmpE146_S13_SPT_LightSensorConnection.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 1:''' LightSensorConnection &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Servo Motor&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S13_SPT_SjOneInterface.png|center|frame]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;'''Figure 2:''' SjOneInterface &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SJOneBoardSchematic.png&amp;diff=3211</id>
		<title>File:CmpE146 S13 SPT SJOneBoardSchematic.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SJOneBoardSchematic.png&amp;diff=3211"/>
				<updated>2013-05-17T23:09:29Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: SJOneBoardSchematic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SJOneBoardSchematic&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png&amp;diff=3210</id>
		<title>File:CmpE146 S13 SPT SJOneBoardPWMblockDiagram.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SJOneBoardPWMblockDiagram.png&amp;diff=3210"/>
				<updated>2013-05-17T23:08:45Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: SJOneBoardPWMblockDiagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SJOneBoardPWMblockDiagram&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_FreeRTOS.png&amp;diff=3209</id>
		<title>File:CmpE146 S13 SPT FreeRTOS.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_FreeRTOS.png&amp;diff=3209"/>
				<updated>2013-05-17T23:07:54Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: FreeRTOS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;FreeRTOS&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_LightSensorConnection.png&amp;diff=3208</id>
		<title>File:CmpE146 S13 SPT LightSensorConnection.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_LightSensorConnection.png&amp;diff=3208"/>
				<updated>2013-05-17T23:06:59Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: LightSensorConnection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LightSensorConnection&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SjOneInterface.png&amp;diff=3207</id>
		<title>File:CmpE146 S13 SPT SjOneInterface.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S13_SPT_SjOneInterface.png&amp;diff=3207"/>
				<updated>2013-05-17T23:05:46Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: Interface&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Interface&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3206</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3206"/>
				<updated>2013-05-17T22:50:06Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
Light Sensor&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
//======================&lt;br /&gt;
Light Sensor Connection jpeg&lt;br /&gt;
//=======================&lt;br /&gt;
&lt;br /&gt;
Servo Motor&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
//====================&lt;br /&gt;
devtutorial_SjOneInterface jpeg&lt;br /&gt;
//====================&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3205</id>
		<title>S13: Solar Panel Tracker</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S13:_Solar_Panel_Tracker&amp;diff=3205"/>
				<updated>2013-05-17T22:46:53Z</updated>
		
		<summary type="html">&lt;p&gt;Matt s13: /* Hardware Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Project Title ==&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
The objective of this project is to create a solar panel that tracks the sun. The project will consist of two stepper motors that control the position of the solar panels by using the photo resistors to detect the sun location.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
Solar Panel Sun tracker uses the inputted voltage from photo resistors in order to adjust the position of the solar panel.   The project uses  and Analog to digital converter.  The servo motors are controlled using a pulse; this controls the position of various angles.   The servo uses in this project is a standard servo which can only position between 0 and 180 degrees. &lt;br /&gt;
 &lt;br /&gt;
The project required the following objectives to be accomplished:&lt;br /&gt;
*	Read the voltage from photo resistors&lt;br /&gt;
*	Control servo to move from 0 to 180 degrees&lt;br /&gt;
*	Compute the location which has the greatest light intensity&lt;br /&gt;
*	Determine algorithm to convert digital value into servo position&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Arturo Montoya&lt;br /&gt;
**   Light Sensors (PWM driver) , Servo motor(ADC driver) , and Matrix (Spi driver)&lt;br /&gt;
*  Matthew Balhorn&lt;br /&gt;
**   FreeRTOS Software Design&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Week&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Planned Tasks&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Status&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
1&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Order parts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Look over datasheet(s)&lt;br /&gt;
* Test Servos&lt;br /&gt;
* Design System Logics&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
3&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test Light-sensing circuit&lt;br /&gt;
* Create System Schematics&lt;br /&gt;
* Code Servo Task&lt;br /&gt;
* Create Structure Design (Autodesk Inventor)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
* Completed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Code Light-sensing Task&lt;br /&gt;
* Build/Machine Structure&lt;br /&gt;
* Code Glue Logics (Directional Logic)&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* pending&lt;br /&gt;
* pending&lt;br /&gt;
* pending&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Integrate system&lt;br /&gt;
* Test System&lt;br /&gt;
* Project report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* pending&lt;br /&gt;
* pending&lt;br /&gt;
* pending&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt; &amp;lt;center&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/center&amp;gt; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* Finalize project&lt;br /&gt;
* Finalize report&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&lt;br /&gt;
* pending&lt;br /&gt;
* pending&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Part&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt;Quuantity&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Cost&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Link&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LPC 1758 SJSU Dev Board&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $60 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;180 Degree Servo &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Solar Panel&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;LED Matrix&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Resistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $.25 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Photoresistors &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $1.50 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Jumper wires(x50)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $15 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;Servo belt&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; 2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; $2 &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt;  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
The design section can go over your hardware and software design.  Organize this section using sub-sections that go over your design and implementation.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
Light Sensor&lt;br /&gt;
The Solar Panel Sun Tracker consists of the following hardware:&lt;br /&gt;
* Resistors&lt;br /&gt;
*Photo resistors &lt;br /&gt;
This section is responsible for interpreting the voltage of the photo resistors.   The diagram below shows the circuit needed in order to get a voltage division of the two photo resistors.  This voltage divider consists of two resistors on each side of the voltage divider output (ADC pin). When the top photo resistor has a greater resistance then the bottom resistor the voltage output will drop. When they both have the same resistance will hold in the middle.&lt;br /&gt;
&lt;br /&gt;
//======================&lt;br /&gt;
Light Sensor Connection jpeg&lt;br /&gt;
//=======================&lt;br /&gt;
&lt;br /&gt;
Servo Motor&lt;br /&gt;
The servo section consists of the following hardware:&lt;br /&gt;
*	Servo Motors / Servo Belts&lt;br /&gt;
*	Solar Panel&lt;br /&gt;
 &lt;br /&gt;
This section is responsible for positioning the solar panels perpendicular to the light source.  The panel is mounted to a frame that pivots according to the top servo. In order to perform a full scan the top servo motor was mounted on pivoting bases that is controlled by the second motor. The diagram below describes the complete setup in order to properly track the sun from sun rise to sun set.&lt;br /&gt;
&lt;br /&gt;
//====================&lt;br /&gt;
devtutorial_SjOneInterface jpeg&lt;br /&gt;
//====================&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class = &amp;quot;wikitable&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt; SJSU Dev Board Pin&amp;lt;/th&amp;gt; &amp;lt;th&amp;gt; Destination Pin&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.4(p1.23)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Base Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  PWM1.5(p1.24)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Servo Top Control &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Set pivot  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.4(p1.30)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Base&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;  AD0.5(p1.31)  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Light Sensor Top &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td align = &amp;quot;right&amp;quot;&amp;gt; Analog Input &amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
===== Servo Task =====&lt;br /&gt;
&lt;br /&gt;
===== Light-sensing Task =====&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
This section includes implementation, but again, not the details, just the high level.  For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash.  You can include sub-sections for each of your component implementation.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
Describe the challenges of your project.  What advise would you give yourself or someone else if your project can be started from scratch again?&lt;br /&gt;
Make a smooth transition to testing section and described what it took to test your project.&lt;br /&gt;
&lt;br /&gt;
Include sub-sections that list out a problem and solution, such as:&lt;br /&gt;
&lt;br /&gt;
=== Wifi Connection Issues ===&lt;br /&gt;
Many wifi connection issues were encountered.  To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Upload a video of your project and post the link here.&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
Send me your zipped source code and I will upload this to SourceForge and link it for you.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Any acknowledgement that you may wish to provide can be included here.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Matt s13</name></author>	</entry>

	</feed>