<?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=146+user5</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=146+user5"/>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php/Special:Contributions/146_user5"/>
		<updated>2026-05-05T22:36:51Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34529</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34529"/>
				<updated>2016-12-21T18:39:57Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Team Members &amp;amp; Responsibilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
TEAM 5&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
**Programmed pre-determined objects for Pixy to recognize&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Pixy_Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Servo_Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 BaudRate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Pixy ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 UART Flow Chart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the data is retrieved from the SJOne board, an application was added to where the SJOne board would be able to identify objects based on the bytes it had received from the Pixy Camera. Utilizing this application the SJOne board was able to recognize a pair of green scissors, an orange, and a blue box.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/OeIFKckJA0c&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
https://github.com/nsarras/Object_Detector&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34521</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34521"/>
				<updated>2016-12-21T18:15:05Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Pixy_Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Servo_Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 BaudRate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Pixy ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 UART Flow Chart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the data is retrieved from the SJOne board, an application was added to where the SJOne board would be able to identify objects based on the bytes it had received from the Pixy Camera. Utilizing this application the SJOne board was able to recognize a pair of green scissors, an orange, and a blue box.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/OeIFKckJA0c&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
https://github.com/nsarras/Object_Detector&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34520</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34520"/>
				<updated>2016-12-21T18:10:38Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Pixy Camera Software Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Pixy_Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Servo_Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 BaudRate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Pixy ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/OeIFKckJA0c&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
https://github.com/nsarras/Object_Detector&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_UART_Flow_Chart.png&amp;diff=34516</id>
		<title>File:CmpE146 F16 T5 UART Flow Chart.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_UART_Flow_Chart.png&amp;diff=34516"/>
				<updated>2016-12-21T18:01:06Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: UART communication flow chart between Pixy Camera and SJOneboard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;UART communication flow chart between Pixy Camera and SJOneboard&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Servo_Control.png&amp;diff=34515</id>
		<title>File:CmpE146 F16 T5 Servo Control.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Servo_Control.png&amp;diff=34515"/>
				<updated>2016-12-21T17:59:57Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: Pixy Servo Controls&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pixy Servo Controls&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34507</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34507"/>
				<updated>2016-12-21T17:45:21Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Pixy Camera Software Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Pixy_Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Servo_Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 BaudRate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Pixy ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/OeIFKckJA0c&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
https://github.com/nsarras/Object_Detector&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Pixy_ObjectBlock.png&amp;diff=34506</id>
		<title>File:CmpE146 F16 T5 Pixy ObjectBlock.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Pixy_ObjectBlock.png&amp;diff=34506"/>
				<updated>2016-12-21T17:44:31Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: Pixy Object Block output&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pixy Object Block output&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34504</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34504"/>
				<updated>2016-12-21T17:42:55Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Software Design SJOne Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Pixy_Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Servo_Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 BaudRate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/OeIFKckJA0c&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
https://github.com/nsarras/Object_Detector&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34503</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34503"/>
				<updated>2016-12-21T17:26:28Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Pixy_Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Servo_Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/OeIFKckJA0c&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
https://github.com/nsarras/Object_Detector&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_BaudRate.png&amp;diff=34502</id>
		<title>File:CmpE146 F16 T5 BaudRate.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_BaudRate.png&amp;diff=34502"/>
				<updated>2016-12-21T17:06:12Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: Baud Rate Calculation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Baud Rate Calculation&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34496</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34496"/>
				<updated>2016-12-21T16:39:29Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Design &amp;amp; Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146 F16 T5 Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Pixy_Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: CmpE146_F16_T5_Servo_Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/gaMJuxoMcQs&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
https://github.com/nsarras/Object_Detector&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Servo_Motor.jpg&amp;diff=34495</id>
		<title>File:CmpE146 F16 T5 Servo Motor.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Servo_Motor.jpg&amp;diff=34495"/>
				<updated>2016-12-21T16:37:38Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: CmpE146_F16_T5_Servo_Motor.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CmpE146_F16_T5_Servo_Motor.jpg&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg&amp;diff=34493</id>
		<title>File:CmpE146 F16 T5 Pixy Camera Mount.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Pixy_Camera_Mount.jpg&amp;diff=34493"/>
				<updated>2016-12-21T16:36:48Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: CmpE146_F16_T5_Pixy_Camera_Mount.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CmpE146_F16_T5_Pixy_Camera_Mount.jpg&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Pixy_Camera.jpg&amp;diff=34492</id>
		<title>File:CmpE146 F16 T5 Pixy Camera.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Pixy_Camera.jpg&amp;diff=34492"/>
				<updated>2016-12-21T16:35:01Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: CmpE146_F16_T5_Pixy_Camera.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CmpE146_F16_T5_Pixy_Camera.jpg&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Hardware_Diagram.png&amp;diff=34491</id>
		<title>File:CmpE146 F16 T5 Hardware Diagram.png</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_F16_T5_Hardware_Diagram.png&amp;diff=34491"/>
				<updated>2016-12-21T16:31:13Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: Hardware interface between SJOne Board, Pixy Camera, and the PWM servos.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hardware interface between SJOne Board, Pixy Camera, and the PWM servos.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34145</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34145"/>
				<updated>2016-12-21T01:59:37Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Project Source Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/gaMJuxoMcQs&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
https://github.com/nsarras/Object_Detector&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34142</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34142"/>
				<updated>2016-12-21T01:58:32Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
&lt;br /&gt;
https://youtu.be/gaMJuxoMcQs&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34141</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34141"/>
				<updated>2016-12-21T01:58:11Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
|https://youtu.be/gaMJuxoMcQs&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34139</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=34139"/>
				<updated>2016-12-21T01:57:50Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video.&lt;br /&gt;
https://youtu.be/gaMJuxoMcQs&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33818</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33818"/>
				<updated>2016-12-20T23:33:38Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     // 0xaa55 means Pixy has recognized the object and the following 12bytes sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33814</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33814"/>
				<updated>2016-12-20T23:32:21Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Implementation Pseudo Code''&lt;br /&gt;
 &lt;br /&gt;
  init(Baud_Rate); // initialize Baud Rate and UART registers&lt;br /&gt;
  while(1){&lt;br /&gt;
     data_byte1 = read_byte();&lt;br /&gt;
     data_byte2 = read_byte();&lt;br /&gt;
&lt;br /&gt;
     if (data_byte1 &amp;amp; data_byte2 == 0xaa55){     //When 0xaa55 is grabbed the Pixy has recognized the object and the following 12bytes of information sent will describe that object. &lt;br /&gt;
       for (i &amp;lt; 11) // Allows the following 12 bytes of object information to be grabbed   &lt;br /&gt;
       grab_object_data = read_byte();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33793</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33793"/>
				<updated>2016-12-20T23:21:24Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33792</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33792"/>
				<updated>2016-12-20T23:20:44Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| border|400px|center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
[[&amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33769</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33769"/>
				<updated>2016-12-20T23:14:03Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Software Design SJOne Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receiving and sending bytes of information. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33758</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33758"/>
				<updated>2016-12-20T23:06:30Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy to SJOne board UART flowchart.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 9. Pixy to SJOne board UART flowchart''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33755</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33755"/>
				<updated>2016-12-20T23:05:26Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Objectives &amp;amp; Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the UART Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop UART Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop UART Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33740</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33740"/>
				<updated>2016-12-20T22:58:59Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Implementation ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initially, the Pixy Camera is programmed to recognize a specific object that appears into its view. The UART hardware connections are then made between the Pixy Camera and the SJOne board. The SJOne board registers are initialized and the baud rate is set to match the baud rate of the Pixy Camera. The task then continuously runs the read function in order to continuously grab data from the Pixy Camera. The SJOne board then continuously checks to see if the received data from the Pixy Camera matches the sync byte 0xaa55. This tells the SJOne board that the camera has picked up on an object. Once this byte is received the following bytes will include information regarding the recognized object. Below is the flow of the UART communication, as well as the Pseudo Code behind the implementation.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33698</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33698"/>
				<updated>2016-12-20T22:27:18Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we were able to complete necessary for our project. All though we done what was needed, we believe that it isn't enough and we could've have done more. When we were testing we ran into problems like every other group, but we able to navigate past them successfully. We are glad we took this Embedded Systems class, because we able to learn how FREE RTOS operating system works and how we can implement it for our project. We have also learned how to implement different types of communication protocols and how to program their drivers. The main part we learned from this project is to make sure to set a team leader and make sure people follow their lead to finish the tasks. Within a group project, you have to hold your teammates accountable, make sure you set deadlines, make sure people are getting their work done and this is pretty important in real work place situations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33693</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33693"/>
				<updated>2016-12-20T22:25:05Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The SJOne board is also able to control information to the Pixy Camera in order to control the pan and tilt of the servos, LED color, and camera brightness. However, the pan and tilt byte information is our area of concern with respect to control information being sent to the Pixy Camera. If the correct bytes are sent then the SJOne board acts as a master driving the pan and tilt servos of the Pixy Camera. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Pan &amp;amp; Tilt-Servo Control.png| frame |  center| &amp;lt;center&amp;gt; '''Figure 8. Pan &amp;amp; Tilt Byte information''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=33638</id>
		<title>Realtime OS on Embedded Systems</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=33638"/>
				<updated>2016-12-20T22:06:05Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /*  Fall 2016 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Program History ==&lt;br /&gt;
My contribution in Embedded System courses started with CmpE146.  This course teaches students on how to write UART, SPI, and I2C Drivers and interface their drivers to peripherals.  There are about 8 weekly labs in which students not only write drivers, but also learn the core of Real-time Operating Systems including threading (tasks), and inter-task communication using Queues and Semaphores.  FreeRTOS is the operating system used with C/C++ Compiler based on GNU.&lt;br /&gt;
&lt;br /&gt;
When the course was started by Dr. Ozemek @ SJSU (sometime before 2005), not many resources were out there.  Still, with helpful guidance from Dr. Ozemek, interesting projects were created.  This is when I started to help out in Embedded System Courses, and by collecting and sharing knowledge, we've raised the bar at SJSU!  &lt;br /&gt;
&lt;br /&gt;
There have been many great projects at SJSU, but since no one knew about them, the hard work went to a waste for anyone but the creator.  But now we've got the infrastructure to share the projects, which turn out as great references for future students.  Here is my project that started around 2007, and turned into Bachelor's Senior Design Project: &amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.youtube.com/watch?v=QEadXdRl3ws&amp;amp;feature=plcp YouTube Video of Self-Navigating Car]&lt;br /&gt;
&lt;br /&gt;
As of 2013, I have broadened my contribution to other embedded system courses like CmpE240, CmpE243 and CmpE244.&lt;br /&gt;
&lt;br /&gt;
== Lab Assignments ==&lt;br /&gt;
This article contains laboratory assignments and resources.  The assignments are under construction as we move towards SJ-One development board.&lt;br /&gt;
*  [[Embedded System Tutorial GPIO | Lesson 1 : GPIO]]&lt;br /&gt;
*  [[Embedded System Tutorial UART | Lesson 2 : UART]]&lt;br /&gt;
*  [[Embedded System Tutorial SPI  | Lesson 3 : SPI]]&lt;br /&gt;
*  [[Embedded System I2C Tutorial  | Lesson 4 : I2C]]&lt;br /&gt;
*  [[Embedded System Tutorial Interrupts | Lesson 5 : Interrupts]]&lt;br /&gt;
*  [[Embedded System Tutorial FreeRTOS | Lesson 6 : FreeRTOS Tasks]]&lt;br /&gt;
*  [[Embedded System Tutorial File I/O | Lesson 7 : FreeRTOS Application Programming]]&lt;br /&gt;
&lt;br /&gt;
==Other reference articles==&lt;br /&gt;
*  [[Bitmasking Tutorial]] (+ GPIO Example)&lt;br /&gt;
*  [[ LPC17xx Memory Map &amp;amp; Interrupts]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Senior Design Projects ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Semester Projects ==&lt;br /&gt;
Every semester, students are given about 7-10 weeks to complete their projects.  During this short time-span, students form groups, order parts, and begin working on their projects.  The work performed during the semester is documented at this Wiki.&lt;br /&gt;
&lt;br /&gt;
Here is the list of Preet's documented projects:&amp;lt;BR/&amp;gt;&lt;br /&gt;
*  [[Preet's Relay Controller Project]]&lt;br /&gt;
*  [[Nordic Low Powered Mesh Network stack]]&lt;br /&gt;
*  [http://www.youtube.com/watch?v=QEadXdRl3ws&amp;amp;feature=plcp Senior Design Project (MS-CmpE) Video]&lt;br /&gt;
&lt;br /&gt;
Here is another resource for good project references :&lt;br /&gt;
[http://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/ Cornell EE476 Projects]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
=== [[Fall 2016 | Fall 2016]] ===&lt;br /&gt;
&lt;br /&gt;
CMPE146:&lt;br /&gt;
* Add Your Group on Here, then follow the link to add more to your template *&lt;br /&gt;
* [http://www.socialledge.com/sjsu/index.php?title=F16:_Seismograph F16: Seismograph]&lt;br /&gt;
* [[F16: Piano Glove]]&lt;br /&gt;
* [[F16: Object Detector]]&lt;br /&gt;
* [[F16: Autonomous Nautical System]]&lt;br /&gt;
* [[F16: Autonomous Fire Extinguishing Vehicle]]&lt;br /&gt;
* [[F16: Autonomous Runaway Alarm Car]]&lt;br /&gt;
* [[F16: E-Bike]]&lt;br /&gt;
* [[F16: NotifyBox]]&lt;br /&gt;
* [[F16: Wireless Tilt Controlled Camera Arm]]&lt;br /&gt;
* [[F16: OBD2 Reader]]&lt;br /&gt;
* [[F16: Micro Watch Monitoring System]]&lt;br /&gt;
* [[F16: Door Alarm System]]&lt;br /&gt;
* [[F16: I2Coffee]]&lt;br /&gt;
* [[F16: Real Time Traffic Control System (RTTCS)]]&lt;br /&gt;
&lt;br /&gt;
=== [[Spring 2016 | Spring 2016]] ===&lt;br /&gt;
*  [[S16: Fantastic Four]]&lt;br /&gt;
*  [[S16: Simpsons]]&lt;br /&gt;
*  [[S16: Mars 1]]&lt;br /&gt;
*  [[S16: OpenSJ Bluz]]&lt;br /&gt;
*  [[S16: Motion Copy Bot]]&lt;br /&gt;
*  [[S16: Biker Assist]]&lt;br /&gt;
*  [[S16: Helios]]&lt;br /&gt;
*  [[S16: Sound Buddy]]&lt;br /&gt;
*  [[S16: Warriors]]&lt;br /&gt;
*  [[S16: Expendables]]&lt;br /&gt;
*  [[S16: Ahava]]&lt;br /&gt;
*  [[S16: Number 1]]&lt;br /&gt;
*  [[S16: SkyNet]]&lt;br /&gt;
*  [[S16: SmartDoorLock]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cmpe 146:&lt;br /&gt;
*  [[S16: Camera Gimbal]]&lt;br /&gt;
*  [[S16: Laser Harp]]&lt;br /&gt;
*  &amp;lt;strike&amp;gt;[[S16: Laser Cutter Motor Controller]]&amp;lt;/strike&amp;gt;&lt;br /&gt;
*  [[S16: Sprinkler]]&lt;br /&gt;
*  [[S16: The Jatrick Car]]&lt;br /&gt;
*  [[S16: Dan]]&lt;br /&gt;
*  [[S16: Robolamp]]&lt;br /&gt;
*  [[S16: Pinball]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2015 | Fall 2015]] ===&lt;br /&gt;
&lt;br /&gt;
CmpE146:&lt;br /&gt;
* [[F15: Autonomous Mobile]]&lt;br /&gt;
* [[F15: Car Report]]&lt;br /&gt;
* [[F15: Electronic Piano]]&lt;br /&gt;
* [[F15: Doorknock over Bluetooth]]&lt;br /&gt;
* [[F15: Smart Car]]&lt;br /&gt;
* [[F15: Plant Control]]&lt;br /&gt;
* [[F15: Laser Security System]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE244 Spring 2015 | Spring 2015]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[S15: Quadcopter - It flies]]&lt;br /&gt;
* [[S15: Remote Learner]]&lt;br /&gt;
* [[S15: Protocol Interface: I2C - CAN Bridge]]&lt;br /&gt;
* [[S15: Vision RC Car]]&lt;br /&gt;
* [[S15: SJeight Octocopter]]&lt;br /&gt;
* [[S15: Swarm Robots]]&lt;br /&gt;
* [[S15: Smart Sparta Parking System]]&lt;br /&gt;
* [[S15: Touch Navigator]]&lt;br /&gt;
* [[S15: Wizard's Chess System]]&lt;br /&gt;
* [[S15: Bug Rider]]&lt;br /&gt;
* [[S15: Real Time Brake Assist (RTBA)]]&lt;br /&gt;
* [[S15: Wireless Mesh Network]]&lt;br /&gt;
* [[S15: Wireless Power Transfer System]]&lt;br /&gt;
* [[S15: Drone]]&lt;br /&gt;
* [[S15: Tree Node using Google Protocol Buffers]]&lt;br /&gt;
* [[S15: Multi-media Car]]&lt;br /&gt;
* [[S15: Hand Gesture Recognition using IR Sensors]]&lt;br /&gt;
* [[S15: CAN controlled RGB LED cubes]]&lt;br /&gt;
* [[S15: Rubik's Cube Solver]]&lt;br /&gt;
* [[S15: RFID Security Box]]&lt;br /&gt;
* [[S15: Automated Meeting Room Reservation]]&lt;br /&gt;
* [[S15: Patient Buddy System (PBS)]]&lt;br /&gt;
&lt;br /&gt;
CmpE146:&lt;br /&gt;
* [[S15: Hovercopter]]&lt;br /&gt;
* [[S15: Triclops: Smart RC Car]]&lt;br /&gt;
* [[S15: Connect Four - Robotic Player]]&lt;br /&gt;
* [[S15: Self-Balancing Robot]]&lt;br /&gt;
* [[S15: MP3 Player with Graphic Equalizer Display]]&lt;br /&gt;
* [[S15: Motion-Controlled RC Car]]&lt;br /&gt;
* [[S15: MENL (Monster Encounter Night Light) ]]&lt;br /&gt;
* [[S15: Tilt Motion Controlled LED Alarm Clock]]&lt;br /&gt;
* [[S15: Alarm Based Coffee Maker]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE244 Spring 2014 | Spring 2014]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*  Senior Project: [[Project Advising: Remote Security System]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[S14: Quadcopter]]&lt;br /&gt;
* [[S14: Smart Weather Clock]]&lt;br /&gt;
* [[S14: Divine WINd]]&lt;br /&gt;
* [[S14: Data Acquisition using CAN bus]]&lt;br /&gt;
* [[S14: E-Ink Display for Shopping Tags]]&lt;br /&gt;
* [[S14: Spectrum Analyzer for Audio Frequency Signals]]&lt;br /&gt;
* [[S14: CAN Firmware Uploader]]&lt;br /&gt;
* [[S14: Asset Management and Location System]]&lt;br /&gt;
* [[S14: Location  Tracker]]&lt;br /&gt;
* [[S14:  Androbot]]&lt;br /&gt;
* [[S14: Virtual Dog]]&lt;br /&gt;
* [[S14: Android based Automation]]&lt;br /&gt;
* [[S14: FaceTime Robo]]&lt;br /&gt;
* [[S14: Wireless Control Car]]&lt;br /&gt;
* [[S14: Power Efficient Security Door System for Light-rail using CAN Bus]]&lt;br /&gt;
* [[S14: Android based home monitoring system]]&lt;br /&gt;
* [[S14: Need For Speed]]&lt;br /&gt;
&lt;br /&gt;
CmpE146&lt;br /&gt;
* [[S14: Hyperintelligent NFC Locker of the Future]]&lt;br /&gt;
* [[S14: Smart Planter]]&lt;br /&gt;
* [[S14: Modular Security System]]&lt;br /&gt;
* [[S14: Autonomous Control System]]&lt;br /&gt;
* [[S14: Anti-Crash Car]]&lt;br /&gt;
* [[S14: Tricopter]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE240 Fall 2013 | Fall 2013]] ===&lt;br /&gt;
&lt;br /&gt;
* [[F13: POV Display]]&lt;br /&gt;
* [[F13: Line Following Robot]]&lt;br /&gt;
* [[F13: LED Display]]&lt;br /&gt;
* [[F13: Bulb Ramper]]&lt;br /&gt;
* [[F13: Garage Parking Assistant]]&lt;br /&gt;
* [[F13: Quadcopter]]&lt;br /&gt;
* [[F13: BarkMaster2000]]&lt;br /&gt;
* [[F13: Remote Control Car]]&lt;br /&gt;
* [[F13: Obstacle Avoidance Robot]]&lt;br /&gt;
* [[F13: Vehicle On Board Diagnostics]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Spring 2013 | Spring 2013]] ===&lt;br /&gt;
&lt;br /&gt;
* [[S13: 2D Plotter]]&lt;br /&gt;
* [[S13: Smart Cube]]&lt;br /&gt;
* [[S13: Garage Parking Aid]]&lt;br /&gt;
* [[S13: Smart Security]]&lt;br /&gt;
* [[S13: Door Alarm System]]&lt;br /&gt;
* [[S13: Solar Panel Tracker]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Fall 2012|Fall 2012]] ===&lt;br /&gt;
&lt;br /&gt;
* [[F12: Evil Watchdog]]&lt;br /&gt;
* [[F12: Smart Bulb]]&lt;br /&gt;
* [[F12: All Your Base are Belong to You]]&lt;br /&gt;
* [[F12: Android Controlled MP3]]&lt;br /&gt;
* [[F12: Unified Wireless Health Monitoring System]]&lt;br /&gt;
* [[F12: OBD-II Android Monitor]]&lt;br /&gt;
* [[F12: Self-Driving GPS Following Car]]&lt;br /&gt;
* [[F12: Android Door Lock]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Spring 2012|Spring 2012]] ===&lt;br /&gt;
*  [[S12: FreeRTOS based QuadCopter]]&lt;br /&gt;
*  [[S12: Web-based MP3 Player]]&lt;br /&gt;
*  [[S12: Self Drive Car]]&lt;br /&gt;
*  [[S12: VAndroid]]&lt;br /&gt;
*  [[S12: Traffic Light Sensing Vehicle]]&lt;br /&gt;
*  [[S12: Sound Reader]]&lt;br /&gt;
*  [[S12: Remote Controlled MP3 Player]]&lt;br /&gt;
*  [[S12: Android Controlled Robot]]&lt;br /&gt;
*  [[S12: Eyes-Free GPS]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Handy References ==&lt;br /&gt;
*  [[Sample Project Report]]&lt;br /&gt;
*  [[Project Proposal Guidelines]]&lt;br /&gt;
*  [[CmpE146 Lab. Resources]]&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=33635</id>
		<title>Realtime OS on Embedded Systems</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=33635"/>
				<updated>2016-12-20T22:05:33Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /*  Fall 2016 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Program History ==&lt;br /&gt;
My contribution in Embedded System courses started with CmpE146.  This course teaches students on how to write UART, SPI, and I2C Drivers and interface their drivers to peripherals.  There are about 8 weekly labs in which students not only write drivers, but also learn the core of Real-time Operating Systems including threading (tasks), and inter-task communication using Queues and Semaphores.  FreeRTOS is the operating system used with C/C++ Compiler based on GNU.&lt;br /&gt;
&lt;br /&gt;
When the course was started by Dr. Ozemek @ SJSU (sometime before 2005), not many resources were out there.  Still, with helpful guidance from Dr. Ozemek, interesting projects were created.  This is when I started to help out in Embedded System Courses, and by collecting and sharing knowledge, we've raised the bar at SJSU!  &lt;br /&gt;
&lt;br /&gt;
There have been many great projects at SJSU, but since no one knew about them, the hard work went to a waste for anyone but the creator.  But now we've got the infrastructure to share the projects, which turn out as great references for future students.  Here is my project that started around 2007, and turned into Bachelor's Senior Design Project: &amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.youtube.com/watch?v=QEadXdRl3ws&amp;amp;feature=plcp YouTube Video of Self-Navigating Car]&lt;br /&gt;
&lt;br /&gt;
As of 2013, I have broadened my contribution to other embedded system courses like CmpE240, CmpE243 and CmpE244.&lt;br /&gt;
&lt;br /&gt;
== Lab Assignments ==&lt;br /&gt;
This article contains laboratory assignments and resources.  The assignments are under construction as we move towards SJ-One development board.&lt;br /&gt;
*  [[Embedded System Tutorial GPIO | Lesson 1 : GPIO]]&lt;br /&gt;
*  [[Embedded System Tutorial UART | Lesson 2 : UART]]&lt;br /&gt;
*  [[Embedded System Tutorial SPI  | Lesson 3 : SPI]]&lt;br /&gt;
*  [[Embedded System I2C Tutorial  | Lesson 4 : I2C]]&lt;br /&gt;
*  [[Embedded System Tutorial Interrupts | Lesson 5 : Interrupts]]&lt;br /&gt;
*  [[Embedded System Tutorial FreeRTOS | Lesson 6 : FreeRTOS Tasks]]&lt;br /&gt;
*  [[Embedded System Tutorial File I/O | Lesson 7 : FreeRTOS Application Programming]]&lt;br /&gt;
&lt;br /&gt;
==Other reference articles==&lt;br /&gt;
*  [[Bitmasking Tutorial]] (+ GPIO Example)&lt;br /&gt;
*  [[ LPC17xx Memory Map &amp;amp; Interrupts]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Senior Design Projects ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Semester Projects ==&lt;br /&gt;
Every semester, students are given about 7-10 weeks to complete their projects.  During this short time-span, students form groups, order parts, and begin working on their projects.  The work performed during the semester is documented at this Wiki.&lt;br /&gt;
&lt;br /&gt;
Here is the list of Preet's documented projects:&amp;lt;BR/&amp;gt;&lt;br /&gt;
*  [[Preet's Relay Controller Project]]&lt;br /&gt;
*  [[Nordic Low Powered Mesh Network stack]]&lt;br /&gt;
*  [http://www.youtube.com/watch?v=QEadXdRl3ws&amp;amp;feature=plcp Senior Design Project (MS-CmpE) Video]&lt;br /&gt;
&lt;br /&gt;
Here is another resource for good project references :&lt;br /&gt;
[http://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/ Cornell EE476 Projects]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
=== [[Fall 2016 | Fall 2016]] ===&lt;br /&gt;
&lt;br /&gt;
CMPE146:&lt;br /&gt;
* Add Your Group on Here, then follow the link to add more to your template *&lt;br /&gt;
* [http://www.socialledge.com/sjsu/index.php?title=F16:_Seismograph F16: Seismograph]&lt;br /&gt;
* [[F16: Piano Glove]]&lt;br /&gt;
* [[F16: Object Detector]]&lt;br /&gt;
* [[F16: Pattern Detector]]&lt;br /&gt;
* [[F16: Autonomous Nautical System]]&lt;br /&gt;
* [[F16: Autonomous Fire Extinguishing Vehicle]]&lt;br /&gt;
* [[F16: Autonomous Runaway Alarm Car]]&lt;br /&gt;
* [[F16: E-Bike]]&lt;br /&gt;
* [[F16: NotifyBox]]&lt;br /&gt;
* [[F16: Wireless Tilt Controlled Camera Arm]]&lt;br /&gt;
* [[F16: OBD2 Reader]]&lt;br /&gt;
* [[F16: Micro Watch Monitoring System]]&lt;br /&gt;
* [[F16: Door Alarm System]]&lt;br /&gt;
* [[F16: I2Coffee]]&lt;br /&gt;
* [[F16: Real Time Traffic Control System (RTTCS)]]&lt;br /&gt;
&lt;br /&gt;
=== [[Spring 2016 | Spring 2016]] ===&lt;br /&gt;
*  [[S16: Fantastic Four]]&lt;br /&gt;
*  [[S16: Simpsons]]&lt;br /&gt;
*  [[S16: Mars 1]]&lt;br /&gt;
*  [[S16: OpenSJ Bluz]]&lt;br /&gt;
*  [[S16: Motion Copy Bot]]&lt;br /&gt;
*  [[S16: Biker Assist]]&lt;br /&gt;
*  [[S16: Helios]]&lt;br /&gt;
*  [[S16: Sound Buddy]]&lt;br /&gt;
*  [[S16: Warriors]]&lt;br /&gt;
*  [[S16: Expendables]]&lt;br /&gt;
*  [[S16: Ahava]]&lt;br /&gt;
*  [[S16: Number 1]]&lt;br /&gt;
*  [[S16: SkyNet]]&lt;br /&gt;
*  [[S16: SmartDoorLock]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cmpe 146:&lt;br /&gt;
*  [[S16: Camera Gimbal]]&lt;br /&gt;
*  [[S16: Laser Harp]]&lt;br /&gt;
*  &amp;lt;strike&amp;gt;[[S16: Laser Cutter Motor Controller]]&amp;lt;/strike&amp;gt;&lt;br /&gt;
*  [[S16: Sprinkler]]&lt;br /&gt;
*  [[S16: The Jatrick Car]]&lt;br /&gt;
*  [[S16: Dan]]&lt;br /&gt;
*  [[S16: Robolamp]]&lt;br /&gt;
*  [[S16: Pinball]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2015 | Fall 2015]] ===&lt;br /&gt;
&lt;br /&gt;
CmpE146:&lt;br /&gt;
* [[F15: Autonomous Mobile]]&lt;br /&gt;
* [[F15: Car Report]]&lt;br /&gt;
* [[F15: Electronic Piano]]&lt;br /&gt;
* [[F15: Doorknock over Bluetooth]]&lt;br /&gt;
* [[F15: Smart Car]]&lt;br /&gt;
* [[F15: Plant Control]]&lt;br /&gt;
* [[F15: Laser Security System]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE244 Spring 2015 | Spring 2015]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[S15: Quadcopter - It flies]]&lt;br /&gt;
* [[S15: Remote Learner]]&lt;br /&gt;
* [[S15: Protocol Interface: I2C - CAN Bridge]]&lt;br /&gt;
* [[S15: Vision RC Car]]&lt;br /&gt;
* [[S15: SJeight Octocopter]]&lt;br /&gt;
* [[S15: Swarm Robots]]&lt;br /&gt;
* [[S15: Smart Sparta Parking System]]&lt;br /&gt;
* [[S15: Touch Navigator]]&lt;br /&gt;
* [[S15: Wizard's Chess System]]&lt;br /&gt;
* [[S15: Bug Rider]]&lt;br /&gt;
* [[S15: Real Time Brake Assist (RTBA)]]&lt;br /&gt;
* [[S15: Wireless Mesh Network]]&lt;br /&gt;
* [[S15: Wireless Power Transfer System]]&lt;br /&gt;
* [[S15: Drone]]&lt;br /&gt;
* [[S15: Tree Node using Google Protocol Buffers]]&lt;br /&gt;
* [[S15: Multi-media Car]]&lt;br /&gt;
* [[S15: Hand Gesture Recognition using IR Sensors]]&lt;br /&gt;
* [[S15: CAN controlled RGB LED cubes]]&lt;br /&gt;
* [[S15: Rubik's Cube Solver]]&lt;br /&gt;
* [[S15: RFID Security Box]]&lt;br /&gt;
* [[S15: Automated Meeting Room Reservation]]&lt;br /&gt;
* [[S15: Patient Buddy System (PBS)]]&lt;br /&gt;
&lt;br /&gt;
CmpE146:&lt;br /&gt;
* [[S15: Hovercopter]]&lt;br /&gt;
* [[S15: Triclops: Smart RC Car]]&lt;br /&gt;
* [[S15: Connect Four - Robotic Player]]&lt;br /&gt;
* [[S15: Self-Balancing Robot]]&lt;br /&gt;
* [[S15: MP3 Player with Graphic Equalizer Display]]&lt;br /&gt;
* [[S15: Motion-Controlled RC Car]]&lt;br /&gt;
* [[S15: MENL (Monster Encounter Night Light) ]]&lt;br /&gt;
* [[S15: Tilt Motion Controlled LED Alarm Clock]]&lt;br /&gt;
* [[S15: Alarm Based Coffee Maker]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE244 Spring 2014 | Spring 2014]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*  Senior Project: [[Project Advising: Remote Security System]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[S14: Quadcopter]]&lt;br /&gt;
* [[S14: Smart Weather Clock]]&lt;br /&gt;
* [[S14: Divine WINd]]&lt;br /&gt;
* [[S14: Data Acquisition using CAN bus]]&lt;br /&gt;
* [[S14: E-Ink Display for Shopping Tags]]&lt;br /&gt;
* [[S14: Spectrum Analyzer for Audio Frequency Signals]]&lt;br /&gt;
* [[S14: CAN Firmware Uploader]]&lt;br /&gt;
* [[S14: Asset Management and Location System]]&lt;br /&gt;
* [[S14: Location  Tracker]]&lt;br /&gt;
* [[S14:  Androbot]]&lt;br /&gt;
* [[S14: Virtual Dog]]&lt;br /&gt;
* [[S14: Android based Automation]]&lt;br /&gt;
* [[S14: FaceTime Robo]]&lt;br /&gt;
* [[S14: Wireless Control Car]]&lt;br /&gt;
* [[S14: Power Efficient Security Door System for Light-rail using CAN Bus]]&lt;br /&gt;
* [[S14: Android based home monitoring system]]&lt;br /&gt;
* [[S14: Need For Speed]]&lt;br /&gt;
&lt;br /&gt;
CmpE146&lt;br /&gt;
* [[S14: Hyperintelligent NFC Locker of the Future]]&lt;br /&gt;
* [[S14: Smart Planter]]&lt;br /&gt;
* [[S14: Modular Security System]]&lt;br /&gt;
* [[S14: Autonomous Control System]]&lt;br /&gt;
* [[S14: Anti-Crash Car]]&lt;br /&gt;
* [[S14: Tricopter]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE240 Fall 2013 | Fall 2013]] ===&lt;br /&gt;
&lt;br /&gt;
* [[F13: POV Display]]&lt;br /&gt;
* [[F13: Line Following Robot]]&lt;br /&gt;
* [[F13: LED Display]]&lt;br /&gt;
* [[F13: Bulb Ramper]]&lt;br /&gt;
* [[F13: Garage Parking Assistant]]&lt;br /&gt;
* [[F13: Quadcopter]]&lt;br /&gt;
* [[F13: BarkMaster2000]]&lt;br /&gt;
* [[F13: Remote Control Car]]&lt;br /&gt;
* [[F13: Obstacle Avoidance Robot]]&lt;br /&gt;
* [[F13: Vehicle On Board Diagnostics]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Spring 2013 | Spring 2013]] ===&lt;br /&gt;
&lt;br /&gt;
* [[S13: 2D Plotter]]&lt;br /&gt;
* [[S13: Smart Cube]]&lt;br /&gt;
* [[S13: Garage Parking Aid]]&lt;br /&gt;
* [[S13: Smart Security]]&lt;br /&gt;
* [[S13: Door Alarm System]]&lt;br /&gt;
* [[S13: Solar Panel Tracker]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Fall 2012|Fall 2012]] ===&lt;br /&gt;
&lt;br /&gt;
* [[F12: Evil Watchdog]]&lt;br /&gt;
* [[F12: Smart Bulb]]&lt;br /&gt;
* [[F12: All Your Base are Belong to You]]&lt;br /&gt;
* [[F12: Android Controlled MP3]]&lt;br /&gt;
* [[F12: Unified Wireless Health Monitoring System]]&lt;br /&gt;
* [[F12: OBD-II Android Monitor]]&lt;br /&gt;
* [[F12: Self-Driving GPS Following Car]]&lt;br /&gt;
* [[F12: Android Door Lock]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Spring 2012|Spring 2012]] ===&lt;br /&gt;
*  [[S12: FreeRTOS based QuadCopter]]&lt;br /&gt;
*  [[S12: Web-based MP3 Player]]&lt;br /&gt;
*  [[S12: Self Drive Car]]&lt;br /&gt;
*  [[S12: VAndroid]]&lt;br /&gt;
*  [[S12: Traffic Light Sensing Vehicle]]&lt;br /&gt;
*  [[S12: Sound Reader]]&lt;br /&gt;
*  [[S12: Remote Controlled MP3 Player]]&lt;br /&gt;
*  [[S12: Android Controlled Robot]]&lt;br /&gt;
*  [[S12: Eyes-Free GPS]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Handy References ==&lt;br /&gt;
*  [[Sample Project Report]]&lt;br /&gt;
*  [[Project Proposal Guidelines]]&lt;br /&gt;
*  [[CmpE146 Lab. Resources]]&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33633</id>
		<title>F16: Object Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Object_Detector&amp;diff=33633"/>
				<updated>2016-12-20T22:04:10Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: Created page with &amp;quot;== Abstract == Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=33630</id>
		<title>Realtime OS on Embedded Systems</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=33630"/>
				<updated>2016-12-20T22:03:55Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /*  Fall 2016 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Program History ==&lt;br /&gt;
My contribution in Embedded System courses started with CmpE146.  This course teaches students on how to write UART, SPI, and I2C Drivers and interface their drivers to peripherals.  There are about 8 weekly labs in which students not only write drivers, but also learn the core of Real-time Operating Systems including threading (tasks), and inter-task communication using Queues and Semaphores.  FreeRTOS is the operating system used with C/C++ Compiler based on GNU.&lt;br /&gt;
&lt;br /&gt;
When the course was started by Dr. Ozemek @ SJSU (sometime before 2005), not many resources were out there.  Still, with helpful guidance from Dr. Ozemek, interesting projects were created.  This is when I started to help out in Embedded System Courses, and by collecting and sharing knowledge, we've raised the bar at SJSU!  &lt;br /&gt;
&lt;br /&gt;
There have been many great projects at SJSU, but since no one knew about them, the hard work went to a waste for anyone but the creator.  But now we've got the infrastructure to share the projects, which turn out as great references for future students.  Here is my project that started around 2007, and turned into Bachelor's Senior Design Project: &amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.youtube.com/watch?v=QEadXdRl3ws&amp;amp;feature=plcp YouTube Video of Self-Navigating Car]&lt;br /&gt;
&lt;br /&gt;
As of 2013, I have broadened my contribution to other embedded system courses like CmpE240, CmpE243 and CmpE244.&lt;br /&gt;
&lt;br /&gt;
== Lab Assignments ==&lt;br /&gt;
This article contains laboratory assignments and resources.  The assignments are under construction as we move towards SJ-One development board.&lt;br /&gt;
*  [[Embedded System Tutorial GPIO | Lesson 1 : GPIO]]&lt;br /&gt;
*  [[Embedded System Tutorial UART | Lesson 2 : UART]]&lt;br /&gt;
*  [[Embedded System Tutorial SPI  | Lesson 3 : SPI]]&lt;br /&gt;
*  [[Embedded System I2C Tutorial  | Lesson 4 : I2C]]&lt;br /&gt;
*  [[Embedded System Tutorial Interrupts | Lesson 5 : Interrupts]]&lt;br /&gt;
*  [[Embedded System Tutorial FreeRTOS | Lesson 6 : FreeRTOS Tasks]]&lt;br /&gt;
*  [[Embedded System Tutorial File I/O | Lesson 7 : FreeRTOS Application Programming]]&lt;br /&gt;
&lt;br /&gt;
==Other reference articles==&lt;br /&gt;
*  [[Bitmasking Tutorial]] (+ GPIO Example)&lt;br /&gt;
*  [[ LPC17xx Memory Map &amp;amp; Interrupts]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Senior Design Projects ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
== Semester Projects ==&lt;br /&gt;
Every semester, students are given about 7-10 weeks to complete their projects.  During this short time-span, students form groups, order parts, and begin working on their projects.  The work performed during the semester is documented at this Wiki.&lt;br /&gt;
&lt;br /&gt;
Here is the list of Preet's documented projects:&amp;lt;BR/&amp;gt;&lt;br /&gt;
*  [[Preet's Relay Controller Project]]&lt;br /&gt;
*  [[Nordic Low Powered Mesh Network stack]]&lt;br /&gt;
*  [http://www.youtube.com/watch?v=QEadXdRl3ws&amp;amp;feature=plcp Senior Design Project (MS-CmpE) Video]&lt;br /&gt;
&lt;br /&gt;
Here is another resource for good project references :&lt;br /&gt;
[http://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/ Cornell EE476 Projects]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;BR/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
=== [[Fall 2016 | Fall 2016]] ===&lt;br /&gt;
&lt;br /&gt;
CMPE146:&lt;br /&gt;
* Add Your Group on Here, then follow the link to add more to your template *&lt;br /&gt;
* [http://www.socialledge.com/sjsu/index.php?title=F16:_Seismograph F16: Seismograph]&lt;br /&gt;
* [[F16: Piano Glove]]&lt;br /&gt;
* [[F16: Object Detector]]&lt;br /&gt;
* [[F16: Autonomous Nautical System]]&lt;br /&gt;
* [[F16: Autonomous Fire Extinguishing Vehicle]]&lt;br /&gt;
* [[F16: Autonomous Runaway Alarm Car]]&lt;br /&gt;
* [[F16: E-Bike]]&lt;br /&gt;
* [[F16: NotifyBox]]&lt;br /&gt;
* [[F16: Wireless Tilt Controlled Camera Arm]]&lt;br /&gt;
* [[F16: OBD2 Reader]]&lt;br /&gt;
* [[F16: Micro Watch Monitoring System]]&lt;br /&gt;
* [[F16: Door Alarm System]]&lt;br /&gt;
* [[F16: I2Coffee]]&lt;br /&gt;
* [[F16: Real Time Traffic Control System (RTTCS)]]&lt;br /&gt;
&lt;br /&gt;
=== [[Spring 2016 | Spring 2016]] ===&lt;br /&gt;
*  [[S16: Fantastic Four]]&lt;br /&gt;
*  [[S16: Simpsons]]&lt;br /&gt;
*  [[S16: Mars 1]]&lt;br /&gt;
*  [[S16: OpenSJ Bluz]]&lt;br /&gt;
*  [[S16: Motion Copy Bot]]&lt;br /&gt;
*  [[S16: Biker Assist]]&lt;br /&gt;
*  [[S16: Helios]]&lt;br /&gt;
*  [[S16: Sound Buddy]]&lt;br /&gt;
*  [[S16: Warriors]]&lt;br /&gt;
*  [[S16: Expendables]]&lt;br /&gt;
*  [[S16: Ahava]]&lt;br /&gt;
*  [[S16: Number 1]]&lt;br /&gt;
*  [[S16: SkyNet]]&lt;br /&gt;
*  [[S16: SmartDoorLock]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cmpe 146:&lt;br /&gt;
*  [[S16: Camera Gimbal]]&lt;br /&gt;
*  [[S16: Laser Harp]]&lt;br /&gt;
*  &amp;lt;strike&amp;gt;[[S16: Laser Cutter Motor Controller]]&amp;lt;/strike&amp;gt;&lt;br /&gt;
*  [[S16: Sprinkler]]&lt;br /&gt;
*  [[S16: The Jatrick Car]]&lt;br /&gt;
*  [[S16: Dan]]&lt;br /&gt;
*  [[S16: Robolamp]]&lt;br /&gt;
*  [[S16: Pinball]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[Fall 2015 | Fall 2015]] ===&lt;br /&gt;
&lt;br /&gt;
CmpE146:&lt;br /&gt;
* [[F15: Autonomous Mobile]]&lt;br /&gt;
* [[F15: Car Report]]&lt;br /&gt;
* [[F15: Electronic Piano]]&lt;br /&gt;
* [[F15: Doorknock over Bluetooth]]&lt;br /&gt;
* [[F15: Smart Car]]&lt;br /&gt;
* [[F15: Plant Control]]&lt;br /&gt;
* [[F15: Laser Security System]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;HR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE244 Spring 2015 | Spring 2015]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[S15: Quadcopter - It flies]]&lt;br /&gt;
* [[S15: Remote Learner]]&lt;br /&gt;
* [[S15: Protocol Interface: I2C - CAN Bridge]]&lt;br /&gt;
* [[S15: Vision RC Car]]&lt;br /&gt;
* [[S15: SJeight Octocopter]]&lt;br /&gt;
* [[S15: Swarm Robots]]&lt;br /&gt;
* [[S15: Smart Sparta Parking System]]&lt;br /&gt;
* [[S15: Touch Navigator]]&lt;br /&gt;
* [[S15: Wizard's Chess System]]&lt;br /&gt;
* [[S15: Bug Rider]]&lt;br /&gt;
* [[S15: Real Time Brake Assist (RTBA)]]&lt;br /&gt;
* [[S15: Wireless Mesh Network]]&lt;br /&gt;
* [[S15: Wireless Power Transfer System]]&lt;br /&gt;
* [[S15: Drone]]&lt;br /&gt;
* [[S15: Tree Node using Google Protocol Buffers]]&lt;br /&gt;
* [[S15: Multi-media Car]]&lt;br /&gt;
* [[S15: Hand Gesture Recognition using IR Sensors]]&lt;br /&gt;
* [[S15: CAN controlled RGB LED cubes]]&lt;br /&gt;
* [[S15: Rubik's Cube Solver]]&lt;br /&gt;
* [[S15: RFID Security Box]]&lt;br /&gt;
* [[S15: Automated Meeting Room Reservation]]&lt;br /&gt;
* [[S15: Patient Buddy System (PBS)]]&lt;br /&gt;
&lt;br /&gt;
CmpE146:&lt;br /&gt;
* [[S15: Hovercopter]]&lt;br /&gt;
* [[S15: Triclops: Smart RC Car]]&lt;br /&gt;
* [[S15: Connect Four - Robotic Player]]&lt;br /&gt;
* [[S15: Self-Balancing Robot]]&lt;br /&gt;
* [[S15: MP3 Player with Graphic Equalizer Display]]&lt;br /&gt;
* [[S15: Motion-Controlled RC Car]]&lt;br /&gt;
* [[S15: MENL (Monster Encounter Night Light) ]]&lt;br /&gt;
* [[S15: Tilt Motion Controlled LED Alarm Clock]]&lt;br /&gt;
* [[S15: Alarm Based Coffee Maker]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE244 Spring 2014 | Spring 2014]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
*  Senior Project: [[Project Advising: Remote Security System]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[S14: Quadcopter]]&lt;br /&gt;
* [[S14: Smart Weather Clock]]&lt;br /&gt;
* [[S14: Divine WINd]]&lt;br /&gt;
* [[S14: Data Acquisition using CAN bus]]&lt;br /&gt;
* [[S14: E-Ink Display for Shopping Tags]]&lt;br /&gt;
* [[S14: Spectrum Analyzer for Audio Frequency Signals]]&lt;br /&gt;
* [[S14: CAN Firmware Uploader]]&lt;br /&gt;
* [[S14: Asset Management and Location System]]&lt;br /&gt;
* [[S14: Location  Tracker]]&lt;br /&gt;
* [[S14:  Androbot]]&lt;br /&gt;
* [[S14: Virtual Dog]]&lt;br /&gt;
* [[S14: Android based Automation]]&lt;br /&gt;
* [[S14: FaceTime Robo]]&lt;br /&gt;
* [[S14: Wireless Control Car]]&lt;br /&gt;
* [[S14: Power Efficient Security Door System for Light-rail using CAN Bus]]&lt;br /&gt;
* [[S14: Android based home monitoring system]]&lt;br /&gt;
* [[S14: Need For Speed]]&lt;br /&gt;
&lt;br /&gt;
CmpE146&lt;br /&gt;
* [[S14: Hyperintelligent NFC Locker of the Future]]&lt;br /&gt;
* [[S14: Smart Planter]]&lt;br /&gt;
* [[S14: Modular Security System]]&lt;br /&gt;
* [[S14: Autonomous Control System]]&lt;br /&gt;
* [[S14: Anti-Crash Car]]&lt;br /&gt;
* [[S14: Tricopter]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE240 Fall 2013 | Fall 2013]] ===&lt;br /&gt;
&lt;br /&gt;
* [[F13: POV Display]]&lt;br /&gt;
* [[F13: Line Following Robot]]&lt;br /&gt;
* [[F13: LED Display]]&lt;br /&gt;
* [[F13: Bulb Ramper]]&lt;br /&gt;
* [[F13: Garage Parking Assistant]]&lt;br /&gt;
* [[F13: Quadcopter]]&lt;br /&gt;
* [[F13: BarkMaster2000]]&lt;br /&gt;
* [[F13: Remote Control Car]]&lt;br /&gt;
* [[F13: Obstacle Avoidance Robot]]&lt;br /&gt;
* [[F13: Vehicle On Board Diagnostics]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Spring 2013 | Spring 2013]] ===&lt;br /&gt;
&lt;br /&gt;
* [[S13: 2D Plotter]]&lt;br /&gt;
* [[S13: Smart Cube]]&lt;br /&gt;
* [[S13: Garage Parking Aid]]&lt;br /&gt;
* [[S13: Smart Security]]&lt;br /&gt;
* [[S13: Door Alarm System]]&lt;br /&gt;
* [[S13: Solar Panel Tracker]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Fall 2012|Fall 2012]] ===&lt;br /&gt;
&lt;br /&gt;
* [[F12: Evil Watchdog]]&lt;br /&gt;
* [[F12: Smart Bulb]]&lt;br /&gt;
* [[F12: All Your Base are Belong to You]]&lt;br /&gt;
* [[F12: Android Controlled MP3]]&lt;br /&gt;
* [[F12: Unified Wireless Health Monitoring System]]&lt;br /&gt;
* [[F12: OBD-II Android Monitor]]&lt;br /&gt;
* [[F12: Self-Driving GPS Following Car]]&lt;br /&gt;
* [[F12: Android Door Lock]]&lt;br /&gt;
&lt;br /&gt;
=== [[CmpE146 Spring 2012|Spring 2012]] ===&lt;br /&gt;
*  [[S12: FreeRTOS based QuadCopter]]&lt;br /&gt;
*  [[S12: Web-based MP3 Player]]&lt;br /&gt;
*  [[S12: Self Drive Car]]&lt;br /&gt;
*  [[S12: VAndroid]]&lt;br /&gt;
*  [[S12: Traffic Light Sensing Vehicle]]&lt;br /&gt;
*  [[S12: Sound Reader]]&lt;br /&gt;
*  [[S12: Remote Controlled MP3 Player]]&lt;br /&gt;
*  [[S12: Android Controlled Robot]]&lt;br /&gt;
*  [[S12: Eyes-Free GPS]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Handy References ==&lt;br /&gt;
*  [[Sample Project Report]]&lt;br /&gt;
*  [[Project Proposal Guidelines]]&lt;br /&gt;
*  [[CmpE146 Lab. Resources]]&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33622</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33622"/>
				<updated>2016-12-20T22:02:41Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* References Used */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Pixy_Serial_Protocol&lt;br /&gt;
*http://cmucam.org/projects/cmucam5/wiki/Porting_Guide&lt;br /&gt;
*https://learn.sparkfun.com/tutorials/pulse-width-modulation&lt;br /&gt;
*http://www.socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33615</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33615"/>
				<updated>2016-12-20T22:00:53Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&lt;br /&gt;
&lt;br /&gt;
[[File: Pixy_ObjectBlock.png| frame | center| &amp;lt;center&amp;gt; '''Figure 7. Pixy Camera Object Block Data transfer''' &amp;lt;/center&amp;gt;]]&lt;br /&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33609</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33609"/>
				<updated>2016-12-20T21:59:54Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&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;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, we are both satisfied with our project results, but at the same time we know could've done a lot better and put more time into it. Most of the components were able to function correctly, while we had problems with our parts of the project. We are glad we took this class, because it outlines important concepts that we needed to learn and we were able to learn how FREE RTOS works. We were also able to implement our own FREE RTOS for the purpose of our project. Every group comes into problems, but our group was successfully able to solve them and keep on working on our goal to get the project working. If we were do it again, I would recommend have a leader in group, set deadline, make sure people are getting work accomplished, and work together as a team. This project had not only increased my knowlegde about Embedded Systems, but it has also increased my knowlegde on how project and teams work in real life.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33598</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33598"/>
				<updated>2016-12-20T21:57:33Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Pixy Camera Software Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&lt;br /&gt;
&lt;br /&gt;
The Pixy Camera is able to externally communicate with micro-controllers by sending data regarding the object it is tracking, as well as receiving data for controlling the Pixy Camera itself. When the Pixy camera locates a recognized or preprogrammed object it begins to send information to a connected peripheral in bytes regarding that object. The first few bytes the Pixy camera sends are sync bytes, in other words bytes that let the external device know that the Pixy Camera has picked up on an object. The rest of the following bytes indicate the signature of the object, where it is on the screen with respect to the camera view (x/y center), as well as the width and the height of the object. Below are the specific bytes the Pixy Camera send to the SJOne board when it picks up on a device.&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;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33556</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33556"/>
				<updated>2016-12-20T21:42:44Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Software Design SJOne Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
  PCONP = Power on UART2&lt;br /&gt;
  PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
  PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
  // Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
  DLL_Value = clock/(16*Baud)&lt;br /&gt;
  Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
  LCR = Set 8 bit data transfer Length&lt;br /&gt;
  LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Data''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
   while (1){&lt;br /&gt;
        if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
        }&lt;br /&gt;
   }&lt;br /&gt;
   new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33546</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33546"/>
				<updated>2016-12-20T21:38:14Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Software Design SJOne Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Initialization''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below. From this equation we derive the DLL  and DLM registers which are used as the divisors to establish the desired baud rate for the data transfer. The DLAB bit must also be initialized at is used as both the Receiver Buffer Register and the Transmit Holding Register. Both of which are set at the LCR register. The LCR register is also responsible for setting the start and stop bits of the UART communication.  &lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Initialization PseudoCode''&lt;br /&gt;
&lt;br /&gt;
PCONP = Power on UART2&lt;br /&gt;
PCLKSEL1 = Set Peripheral Clock&lt;br /&gt;
PINSEL4 = Set RX and TX pin functionalities&lt;br /&gt;
// Acquire DLL_Value from desired Baud Rate&lt;br /&gt;
DLL_Value = clock/(16*Baud)&lt;br /&gt;
Set DLM and DLL registers according to DLL_Value&lt;br /&gt;
LCR = Set 8 bit data transfer Length&lt;br /&gt;
LCR = Set start and stop bit for data transfer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;big&amp;gt; ''Receiving Byte Function''&amp;lt;/big&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since the SJOne board is only receiving data from the Pixy Camera and not sending data in this situation only a receive byte function is required. The function waits to see if the data is transmitted from the Pixy Camera to the SJOne board by checking the RDR (Receiver Data Ready) register. Once the value of this register is set to 1, the receive function can then capture the transmitted data by looking at the RBR (Receiver Buffer Register).&lt;br /&gt;
&lt;br /&gt;
''Receiving Function PseudoCode''&lt;br /&gt;
&lt;br /&gt;
while (1){&lt;br /&gt;
     if(RDR){&lt;br /&gt;
         break;&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
new_data = RBR;&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33472</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33472"/>
				<updated>2016-12-20T20:49:38Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Pixy Camera */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 2. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33471</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33471"/>
				<updated>2016-12-20T20:49:16Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Hardware Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 3. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33470</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33470"/>
				<updated>2016-12-20T20:48:53Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Design &amp;amp; Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram &amp;lt;/center]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center|&amp;lt;center&amp;gt;'''Figure 3. Pixy Camera'''&amp;lt;/center&amp;gt; ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33467</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33467"/>
				<updated>2016-12-20T20:47:25Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Pixy Camera */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera''' ]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33466</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33466"/>
				<updated>2016-12-20T20:46:44Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Parts List &amp;amp; Cost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|$8&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33465</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33465"/>
				<updated>2016-12-20T20:46:09Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Objectives &amp;amp; Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
*1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
*2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
*3. Create and buy parts for the stand and servos.&lt;br /&gt;
*4. Assemble the parts and connect all the elements together.&lt;br /&gt;
*5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
*6. Implement the servos with the Pixy Camera.&lt;br /&gt;
*7. Test for a different types of functionality.&lt;br /&gt;
*8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33459</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33459"/>
				<updated>2016-12-20T20:44:05Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
3. Create and buy parts for the stand and servos.&lt;br /&gt;
4. Assemble the parts and connect all the elements together.&lt;br /&gt;
5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
6. Implement the servos with the Pixy Camera.&lt;br /&gt;
7. Test for a different types of functionality.&lt;br /&gt;
8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
In conclusion, &lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
We have uploaded the video onto YouTube and the link below will allow you access to the video. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33441</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33441"/>
				<updated>2016-12-20T20:37:39Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Testing &amp;amp; Technical Challenges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
3. Create and buy parts for the stand and servos.&lt;br /&gt;
4. Assemble the parts and connect all the elements together.&lt;br /&gt;
5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
6. Implement the servos with the Pixy Camera.&lt;br /&gt;
7. Test for a different types of functionality.&lt;br /&gt;
8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. We made another RTOS Task for the new UART for communication with the Pixy and the Pixy's servos. Once we completed this we tested to see if we could properly read the bits from Pixy Camera through UART interface. We used a Saleae to see the bits that were being transferred. Then we could control the servos on the Pixy once we received the correct information. We used test cases with one object and then we moved to two objects for the purpose of this project. We noticed it could see all the objects, but could only track one, which would be the most sensitive object. &lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&lt;br /&gt;
Another issue we ran into was to gain access to utilize the Pixy's servo controls. Since we have attached two servos on the back of the camera and mounted to the mount. We want to control them so we can move the Pixy camera to follow the object. Apparently you have to send certain bytes to tell the Pixy you want to gain access to its servo controls. Then we have to send the bytes to tell the Pixy how to pulse the servos, so they are in the positions we want them to be in.&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;
&lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33430</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33430"/>
				<updated>2016-12-20T20:23:54Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
3. Create and buy parts for the stand and servos.&lt;br /&gt;
4. Assemble the parts and connect all the elements together.&lt;br /&gt;
5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
6. Implement the servos with the Pixy Camera.&lt;br /&gt;
7. Test for a different types of functionality.&lt;br /&gt;
8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Pixy Camera Software Implementation ===&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&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;
&lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33425</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33425"/>
				<updated>2016-12-20T20:20:42Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
3. Create and buy parts for the stand and servos.&lt;br /&gt;
4. Assemble the parts and connect all the elements together.&lt;br /&gt;
5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
6. Implement the servos with the Pixy Camera.&lt;br /&gt;
7. Test for a different types of functionality.&lt;br /&gt;
8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File: Baud Rate.png| frame | center| &amp;lt;center&amp;gt; '''Figure 6. Baud Rate Equation''' &amp;lt;/center&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;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&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;
&lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33404</id>
		<title>F16: Pattern Detector</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=F16:_Pattern_Detector&amp;diff=33404"/>
				<updated>2016-12-20T20:10:20Z</updated>
		
		<summary type="html">&lt;p&gt;146 user5: /* Testing &amp;amp; Technical Challenges */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Abstract ==&lt;br /&gt;
Camera with object identifying abilities, to find a unique object as well as track it. Once the unique object is recognized by the Pixy Camera, the Camera will then lock the object's position. This will be done by the Pixy Camera sending a signal to the servos, to tell them where the object is within its frame. The microcontroller will then call a different function and control the servos to lock onto the object and track it as well. Overall, the main idea of this project is to create the drivers for the Pixy Camera to find the object and to communicate with the SJOne Board.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
The objective of this project was to create a stand and interface for the Pixy Camera along with SJOne Board to lock onto and track a object. We found the Pixy Camera online, which is created by Charmed Labs, which they made to recognize the outlines of colorful object with certain signatures. We went ahead and created a stand, along with servos so the camera can interface with the microcontroller to control the camera to follow the object. This project has many purposes for tracking objects. &lt;br /&gt;
&lt;br /&gt;
1. Gather information about Pixy Camera and its functionality. &lt;br /&gt;
2. Created pins diagrams to connect the servos, Pixy Camera and SJOne Board.&lt;br /&gt;
3. Create and buy parts for the stand and servos.&lt;br /&gt;
4. Assemble the parts and connect all the elements together.&lt;br /&gt;
5. Implment the SPI Interface between the Pixy Camera and SJOne Board.&lt;br /&gt;
6. Implement the servos with the Pixy Camera.&lt;br /&gt;
7. Test for a different types of functionality.&lt;br /&gt;
8. Make sure it locks and tracks the object with 180 degrees of range with Pan or Tilt. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Mohit Bhasin&lt;br /&gt;
** Make mount and configure Pixy Camera along with the SJOne Board&lt;br /&gt;
** Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
** Make communication between Pixy Camera and servos on the mount for movement&lt;br /&gt;
*  Nadim Sarras&lt;br /&gt;
**Design and Create Hardware connections between micro-controller and external parts. &lt;br /&gt;
**Develop SPI Driver to allow for communication between the micro-controller and Pixy Camera&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&lt;br /&gt;
A Table of our scheduled as planned before you started working on the project.  Then in another table column, so the readers can see the planned vs. actual goals. The point of our schedule is for the readers to assess how to pace themselves if they are using our project as a reference or are doing something similar. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Week#&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Start Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| End Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 10/21/2016&lt;br /&gt;
| 10/28/2016&lt;br /&gt;
| Finish Proposal and confirm idea&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 10/29/2016&lt;br /&gt;
| 11/04/2016&lt;br /&gt;
| Draw schematics of final product and determine the materials we need&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 11/05/2016&lt;br /&gt;
| 11/11/2016&lt;br /&gt;
| Write Drivers for Pixy camera to learn and recognize objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 11/12/2016&lt;br /&gt;
| 11/18/2016&lt;br /&gt;
| Make a mount for the camera that is able to move around and follow objects&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 11/19/2016&lt;br /&gt;
| 11/25/2016&lt;br /&gt;
| Program Microcontroller to interface with the Pixy Camera, using SPI communication. &lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 6&lt;br /&gt;
| 11/26/2016&lt;br /&gt;
| 11/02/2016&lt;br /&gt;
| Finish Free RTOS tasks for the camera and movable mount&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 7&lt;br /&gt;
| 12/03/2016&lt;br /&gt;
| 12/09/2016&lt;br /&gt;
| Test and Configure Project Accordingly&lt;br /&gt;
| Completed&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 8&lt;br /&gt;
| 12/10/2016&lt;br /&gt;
| 12/16/2016&lt;br /&gt;
| Final Tests&lt;br /&gt;
| Completed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Parts List &amp;amp; Cost ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Qty&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Description&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Manufacturer&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Part Number&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Cost&lt;br /&gt;
! align=&amp;quot;center&amp;quot;|Links&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|SJ One Board [http://www.socialledge.com/sjsu/images/d/de/2012SJOneBoardSchematic.pdf]&lt;br /&gt;
|Preet&lt;br /&gt;
|SJ-one&lt;br /&gt;
|$80&lt;br /&gt;
|http://www.socialledge.com/sjsu/index.php?title=SJ_One_Board&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pixy Camera &lt;br /&gt;
|Amazon&lt;br /&gt;
|CMUcam5&lt;br /&gt;
|$69&lt;br /&gt;
|https://www.amazon.com/Pixy-CMUcam5-Smart-Vision-Sensor/dp/B00IUYUA80&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|Amazon&lt;br /&gt;
|Jumper Wires&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|Pan/Tilt Servo Motor Kit&lt;br /&gt;
|Amazon&lt;br /&gt;
|2 Axis Robotic Camera Mount&lt;br /&gt;
|$39&lt;br /&gt;
|https://www.amazon.com/gp/product/B00IVOEN1Y/ref=pd_sim_421_1?ie=UTF8&amp;amp;psc=1&amp;amp;refRID=A7PW5YB91E29JTAEV4TP&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
Within the Design &amp;amp; Implementation section, we have included both the hardware design as well as the software design. We used a Pixy Camera and communicated with through UART protocol. We also show how we assembled and created the mount, so the camera can move. The software section includes the logical flow and a diagram of our algorithm. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
We have included detailed hardware schematics and the interface of each component. &lt;br /&gt;
&lt;br /&gt;
[[File: Hardware Diagram.png| frame | center| &amp;lt;center&amp;gt; Figure 1. Hardware Diagram]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera ====&lt;br /&gt;
The Pixy Camera uses a color-based filtering algorithm to detect objects. Pixy can easily connect to lots of different controllers because it supports several interface options, like UART communication that is being used for the project. The information that is being sent out from the Pixy Camera to the SJOneBoard is the sync word (0xaa55), checksum (sum of all 16-bit words 2-6), signature number, x center of object, y center of object, width of object, height of object. All this information lets us know where the object is in frame, how big it is and the color as well. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== Pixy Camera Mount ====&lt;br /&gt;
The Pixy Camera Mount was made so the camera had a place to sit on. The mount is very useful when testing or using this camera, because then no one has to hold the camera while using it. Instead the camera can rest on the mount which can be placed anywhere and allows easy access to the camera. This way the camera also has the ability to move left - right and up - down. &lt;br /&gt;
&lt;br /&gt;
[[File: Pixy Camera Mount.jpg| frame | center| &amp;lt;center&amp;gt; '''Figure 3. Pixy Camera Mount''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== PWM Servos ====&lt;br /&gt;
Pulse With Modulation Servos are useful for this project, since they allow the camera to move left - right and up - down. Pulse width modulation allows us to vary how much time the signal is high in an analog and this lets us control how the servo moves. With a pulse in the middle, the servo motor will rest at 90 degrees. With the low pulse, the servo will be at the 0 degree and with a large pulse, the servo will be at 180 degrees. Once we receive information from the Pixy Camera we can then modify the position of the servos to move along with the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Servo Motor.jpg| frame | center| &amp;lt;center&amp;gt; Figure 4. '''PWM Servo Motor''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
==== SJOneBoard ====&lt;br /&gt;
The SJOneBoard is used as the brains of the project. It communicates with the Camera and is able to receive data about the object. The SJOneBoard also powers the Camera. It is also used to send signals to camera to use the servo motors on the camera, so they can move and follow the object. &lt;br /&gt;
&lt;br /&gt;
[[File: Devtutorial SjOneBoardOverlay.png| frame | center| &amp;lt;center&amp;gt; '''Figure 5. SJOneBoard''' &amp;lt;/center&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
In this section, we describe how our hardware communicates, such as which driver implementation we used on a high level workings of our project.&lt;br /&gt;
&lt;br /&gt;
To communicate with SJOneBoard and the Pixy Camera we are using a UART communication driver. This allows us to transmit bits to the Pixy Camera so we can receive useful bits back from the camera. Once we are able to figure out where the object is within the frame and where it is moving, we can trasmit useful bits back to the Pixy Camera. Since there are servos attached onto the Pixy Camera and its mount, we can use these to move the camera around to follow an object. If the object goes out of frame the Pixy can move around until it finds it or turn an LED on saying that it cannot find the object.&lt;br /&gt;
&lt;br /&gt;
=== Software Design SJOne Board ===&lt;br /&gt;
The SJOne board utilizes a UART task in order to communicate with the Pixy Camera. The driver task consists of initializing the registers of the SJOne Board, receive and sending bytes of information, and the run function that executes the byte transfer between the Pixy Camera and the SJOne board. Below is the Pseudocode an explanation for each function utilized within the UART driver. &lt;br /&gt;
&lt;br /&gt;
'''''Initialization'''''&lt;br /&gt;
&lt;br /&gt;
The corresponding UART port must be initialized by powering on the PCONP register. The peripheral clock must then be set to the corresponding value of the peripheral device. &lt;br /&gt;
In order for the UART transfer to take place the SJOne board utilizes the Tx and Rx pins which are also set within the initialization block by using the PINSEL Register to program the functionality. &lt;br /&gt;
The Baud Rate must match the Pixy Camera Baud Rate of 19200bps. This was set utilizing the equation below.&lt;br /&gt;
&lt;br /&gt;
[[File:Example.jpg]]&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;
We had a couple of technical challenges while we testing our project. In this section we shall describe the challenges of our project. We will also advise the readers if our project can be started from scratch again or they are trying to achieve similar results.&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
We tested our project in different in parts. First we had tested the UART communication of the SJOneBoard with another SJOneBoard to see if the UART protocol was working properly. Once we were successfully able to transmit and receive bits, we moved onto the next step. Although the driver for UART is already written we have to make changes for the purpose of our project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== My Issue #1 ===&lt;br /&gt;
Establishing communication between the Pixy Camera and the SJOne micro-controller proved to be the most difficult task. The Pixy Camera micro-controller was configured and manufactured for Arduino capabilities. However no one has ever established communication between the Pixy Camera and the SJOne board before. The team initially attempted to establish a SPI interface between the Pixy Camera and the SJOne board. However, after multiple failed attempts, most likely caused by the different clock rates, the team then switched over to UART communication.&lt;br /&gt;
&lt;br /&gt;
=== My Issue #2 ===&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;
&lt;br /&gt;
&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Project Source Code ===&lt;br /&gt;
*  [https://sourceforge.net/projects/sjsu/files/CmpE_S2016/ Sourceforge Source Code Link]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
=== Acknowledgement ===&lt;br /&gt;
Professors&lt;br /&gt;
* Preet&lt;br /&gt;
* Dr Ozemek&lt;br /&gt;
&lt;br /&gt;
Lab Assistants&lt;br /&gt;
* Praveen Prabhakaran&lt;br /&gt;
* Shilpa Srinivasan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;/div&gt;</summary>
		<author><name>146 user5</name></author>	</entry>

	</feed>