<?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=Proj+146u1</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=Proj+146u1"/>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php/Special:Contributions/Proj_146u1"/>
		<updated>2026-05-06T11:15:52Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=27153</id>
		<title>S16: The Jatrick Car</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=27153"/>
				<updated>2016-05-24T17:16:27Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Jatrick Car ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for The Jatrick Car.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $226.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous RC car, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to change to the left lane.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to change to the right lane. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the lanes, assembling the RC car was a simple task. Programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. Once we figured out how to follow lanes, both straight and curved, we had to figure out how the car should change lanes. Professor Preet gave us the idea to use the Nordic wireless capability our SJone boards had. Using his advice, we initialized 1 board as a transmitter and the board on the RC car as a receiver. In order for the car to change lanes, we had to send a signal from the transmitter to the RC car. Initializing the wireless was pretty straightforward, but the lane changing algorithm we created was quite difficult. Overall, we were able to successfully create an autonomous car capable of following lane lines and changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
This project ultimately gave us tremendous experience working with microcontrollers in the embedded environment. Despite this project being quite difficult, considering we are only beginners in embedded systems, it was satisfying to be able to create and complete an embedded project. We felt this was the best course in both our undergraduate careers, and we now feel inspired to pursue a career in the embedded field. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&lt;br /&gt;
&lt;br /&gt;
Demo 3: https://youtu.be/0ojbGGdQMxY&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=26667</id>
		<title>S16: The Jatrick Car</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=26667"/>
				<updated>2016-05-24T04:53:12Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Jatrick Car ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for The Jatrick Car.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $226.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous RC car, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the lanes, assembling the RC car was a simple task. Programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. Once we figured out how to follow lanes, both straight and curved, we had to figure out how the car should change lanes. Professor Preet gave us the idea to use the Nordic wireless capability our SJone boards had. Using his advice, we initialized 1 board as a transmitter and the board on the RC car as a receiver. In order for the car to change lanes, we had to send a signal from the transmitter to the RC car. Initializing the wireless was pretty straightforward, but the lane changing algorithm we created was quite difficult. Overall, we were able to successfully create an autonomous car capable of following lane lines and changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
This project ultimately gave us tremendous experience working with microcontrollers in the embedded environment. Despite this project being quite difficult, considering we are only beginners in embedded systems, it was satisfying to be able to create and complete an embedded project. We felt this was the best course in both our undergraduate careers, and we now feel inspired to pursue a career in the embedded field. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&lt;br /&gt;
&lt;br /&gt;
Demo 3: https://youtu.be/0ojbGGdQMxY&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=26660</id>
		<title>S16: The Jatrick Car</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=26660"/>
				<updated>2016-05-24T04:46:58Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Hardware Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Jatrick Car ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for The Jatrick Car.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $226.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous RC car, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the lanes, assembling the RC car was a simple task. Programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. Once we figured out how to follow lanes, both straight and curved, we had to figure out how the car should change lanes. Professor Preet gave us the idea to use the Nordic wireless capability our SJone boards had. Using his advice, we initialized 1 board as a transmitter and the board on the RC car as a receiver. In order for the car to change lanes, we had to send a signal from the transmitter to the RC car. Initializing the wireless was pretty straightforward, but the lane changing algorithm we created was quite difficult. Overall, we were able to successfully create an autonomous car capable of following lane lines and changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
This project ultimately gave us tremendous experience working with microcontrollers in the embedded environment. Despite this project being quite difficult, considering we are only beginners in embedded systems, it was satisfying to be able to create and complete an embedded project. We felt this was the best course in both our undergraduate careers, and we now feel inspired to pursue a career in the embedded field. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=26659</id>
		<title>S16: The Jatrick Car</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=26659"/>
				<updated>2016-05-24T04:46:31Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Jatrick Car ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for The Jatrick Car.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $226.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the lanes, assembling the RC car was a simple task. Programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. Once we figured out how to follow lanes, both straight and curved, we had to figure out how the car should change lanes. Professor Preet gave us the idea to use the Nordic wireless capability our SJone boards had. Using his advice, we initialized 1 board as a transmitter and the board on the RC car as a receiver. In order for the car to change lanes, we had to send a signal from the transmitter to the RC car. Initializing the wireless was pretty straightforward, but the lane changing algorithm we created was quite difficult. Overall, we were able to successfully create an autonomous car capable of following lane lines and changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
This project ultimately gave us tremendous experience working with microcontrollers in the embedded environment. Despite this project being quite difficult, considering we are only beginners in embedded systems, it was satisfying to be able to create and complete an embedded project. We felt this was the best course in both our undergraduate careers, and we now feel inspired to pursue a career in the embedded field. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=26657</id>
		<title>S16: The Jatrick Car</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_The_Jatrick_Car&amp;diff=26657"/>
				<updated>2016-05-24T04:45:20Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: Created page with &amp;quot;=== Grading Criteria === &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt; *  How well is Software &amp;amp; Hardware Design described? *  How well can this report be used to reproduce this project? *  Code Quali...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Jatrick Car ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $226.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the lanes, assembling the RC car was a simple task. Programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. Once we figured out how to follow lanes, both straight and curved, we had to figure out how the car should change lanes. Professor Preet gave us the idea to use the Nordic wireless capability our SJone boards had. Using his advice, we initialized 1 board as a transmitter and the board on the RC car as a receiver. In order for the car to change lanes, we had to send a signal from the transmitter to the RC car. Initializing the wireless was pretty straightforward, but the lane changing algorithm we created was quite difficult. Overall, we were able to successfully create an autonomous car capable of following lane lines and changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
This project ultimately gave us tremendous experience working with microcontrollers in the embedded environment. Despite this project being quite difficult, considering we are only beginners in embedded systems, it was satisfying to be able to create and complete an embedded project. We felt this was the best course in both our undergraduate careers, and we now feel inspired to pursue a career in the embedded field. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=26654</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=26654"/>
				<updated>2016-05-24T04:44:51Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /*  Spring 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;
== Class Project ==&lt;br /&gt;
=== [[Self-driving Car]] ===&lt;br /&gt;
In this class project, students accomplish a self-drivable RC car with the following learning objectives:&lt;br /&gt;
*  Learn CAN Bus and how to communicate in an industrial or  automotive environment.&lt;br /&gt;
*  Learn integration and testing across different controllers.&lt;br /&gt;
*  Learn how to work in teams.&lt;br /&gt;
*  Learn basics of an RTOS.&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;
=== [[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;
*  [[S16: Laser Cutter Motor Controller]]&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;
* [[F15: Quadcopter by Thomas]]&lt;br /&gt;
* [[F15: Undergrads++]]&lt;br /&gt;
* [[F15: TopGun]]&lt;br /&gt;
* [[F15: Fury]]&lt;br /&gt;
* [[F15: Minion]]&lt;br /&gt;
* [[F15: ThunderBird]]&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;
=== [[CmpE243 Fall 2014 | Fall 2014]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[F14: Team2-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team3-Self Driving Car - Optimus Prime]]&lt;br /&gt;
* [[F14: Team4-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team5-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Self Driving Undergrad Team]]&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>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26645</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26645"/>
				<updated>2016-05-24T04:34:36Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $226.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the lanes, assembling the RC car was a simple task. Programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. Once we figured out how to follow lanes, both straight and curved, we had to figure out how the car should change lanes. Professor Preet gave us the idea to use the Nordic wireless capability our SJone boards had. Using his advice, we initialized 1 board as a transmitter and the board on the RC car as a receiver. In order for the car to change lanes, we had to send a signal from the transmitter to the RC car. Initializing the wireless was pretty straightforward, but the lane changing algorithm we created was quite difficult. Overall, we were able to successfully create an autonomous car capable of following lane lines and changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
This project ultimately gave us tremendous experience working with microcontrollers in the embedded environment. Despite this project being quite difficult, considering we are only beginners in embedded systems, it was satisfying to be able to create and complete an embedded project. We felt this was the best course in both our undergraduate careers, and we now feel inspired to pursue a career in the embedded field. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26643</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26643"/>
				<updated>2016-05-24T04:28:47Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $226.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the lanes, assembling the RC car was a simple task. Programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. Once we figured out how to follow lanes, both straight and curved, we had to figure out how the car should change lanes. Professor Preet gave us the idea to use the Nordic wireless capability our SJone boards had. Using his advice, we initialized 1 board as a transmitter and the board on the RC car as a receiver. In order for the car to change lanes, we had to send a signal from the transmitter to the RC car. Initializing the wireless was pretty straightforward, but the lane changing algorithm we created was quite difficult. Overall, we were able to successfully create an autonomous car capable of following lane lines and changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26640</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26640"/>
				<updated>2016-05-24T04:24:43Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Parts List &amp;amp; Cost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $226.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to interface 6 analog sensors with only 3 analog pins on the SJSUOne board. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26639</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26639"/>
				<updated>2016-05-24T04:24:23Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Parts List &amp;amp; Cost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $10.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $221.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to interface 6 analog sensors with only 3 analog pins on the SJSUOne board. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26637</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26637"/>
				<updated>2016-05-24T04:23:34Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $221.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to interface 6 analog sensors with only 3 analog pins on the SJSUOne board. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26633</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26633"/>
				<updated>2016-05-24T04:22:44Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Parts List &amp;amp; Cost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Wireless Antenna (pair)&lt;br /&gt;
| $8.99 &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $221.02&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to interface 6 analog sensors with only 3 analog pins on the SJSUOne board. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26630</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26630"/>
				<updated>2016-05-24T04:22:14Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to interface 6 analog sensors with only 3 analog pins on the SJSUOne board. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26628</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26628"/>
				<updated>2016-05-24T04:20:31Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Issue #4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
The last issue we had was when coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26627</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26627"/>
				<updated>2016-05-24T04:20:10Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Issue #3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
The third issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
When coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26626</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26626"/>
				<updated>2016-05-24T04:20:06Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Issue #4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
Another issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
&lt;br /&gt;
When coding the conditions to turn hard left and hard right, we initially reversed the PWM set values in each motor assuming the motors would turn at exactly the same speed. It was during these tests that we realized that the right motor was a lot weaker than the left motor. After figuring this out, we had to boost the PWM values in the right motor during certain turns. Although it seemed like an easy fix, constant tests of the RC car had to be executed until we found the perfect PWM values.&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26623</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26623"/>
				<updated>2016-05-24T04:18:30Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Issue #2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
The second issue the team ran into was the layout of the sensors. Originally we had 3 sensors on each side running from the front of the car to the back of the car. The problem with the original layout was that the sensors were parallel with the lane lines on our black board. Even when the car was turned slightly, it was nearly impossible for the sensors to detect the white line. With the new layout, the team put 3 sensors on the left and 3 sensors on the right. The sensors ran perpendicular to the lane lines making it easier to detect which motor had to run faster.&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
Another issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26620</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26620"/>
				<updated>2016-05-24T04:15:08Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Issue #3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem.&lt;br /&gt;
-had sensors on the side&lt;br /&gt;
-new layout, sensors on the front&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
&lt;br /&gt;
Another issue we ran into was the condition when the RC car detected no lane lines. Often times when turning, the car wouldn't follow the lane lines perfectly and would eventually veer off course. In instances like these, we wanted to make sure the car knew what direction it was turning last so it could continue turning that direction until lanes were detected again. We solved this issue by including a static int variable. If the car was turning either slight left or hard left, we set the static int to 1 to signify that it was turning left last. If the car was turning slight right or hard right, we set the static int to 0 to signify that it was turning right last. The reason we used a static int variable was because its ability to keep its value after each function call. If we used a regular variable, when the task loops again, the variable would lose its value, thus the car would not know which direction it was turning last.&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26616</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26616"/>
				<updated>2016-05-24T04:10:50Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Issue #2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem.&lt;br /&gt;
-had sensors on the side&lt;br /&gt;
-new layout, sensors on the front&lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26614</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26614"/>
				<updated>2016-05-24T04:09:07Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/23&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26493</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26493"/>
				<updated>2016-05-24T02:51:48Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Hardware Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as the transmitter which sent the car a signal to turn &amp;quot;Left&amp;quot; or &amp;quot;Right&amp;quot;. The other board, the receiver was attached to the RC car for receiving the &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot; signal. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26491</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26491"/>
				<updated>2016-05-24T02:47:29Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Issue #1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the analog pins on the SJSUOne board. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 analog pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26489</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26489"/>
				<updated>2016-05-24T02:44:55Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26465</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26465"/>
				<updated>2016-05-24T02:29:21Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&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;
The self-driving RC car project was completed successfully. The team was able to implement the two major features, lane following and lane changing. The self-driving RC car was a simple project that required two SJSUOne boards and 6 IR emitter and receivers. The team first tested sensors to see if it was able to read the white lanes on a black board. Once finding the clearance of the sensor and the board assembling the RC car was a simple task however programming the algorithm for following white lanes and changing lanes was a little tougher. Because the RC car had three sensors on each side, we had to figure out how hard each wheel had to turn to straighten out the RC car to have the sensors read the white lane again. This project taught us how to design an RC car with a SJSUOne board and 6 analog sensors. Because the board only has 3 available analog pins, the design required an analog multiplexer. &lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26446</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26446"/>
				<updated>2016-05-24T02:24:52Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation &amp;amp; Motor Control (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor value is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Check Sensor Three and Four first. If Three &amp;lt; 1000, then turn hard Right. If Four &amp;lt; 1000, then turn hard Left.&lt;br /&gt;
&lt;br /&gt;
4. If sensors Three and Four have a value &amp;gt; 1000, then check sensors Two and Five. If Two &amp;lt; 1000, turn slight left. If Five &amp;lt; 1000, turn slight right.&lt;br /&gt;
&lt;br /&gt;
5. If sensors Three, Four, Two, and Five have a value &amp;gt; 1000, then check sensors One and Six. If either of these are &amp;lt; 1000, go straight. &lt;br /&gt;
&lt;br /&gt;
6. Repeat steps, 1 - 5. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Tx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Rx Side) (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Set node address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Check rx buffer to see if any character is received.&lt;br /&gt;
&lt;br /&gt;
3. If pkt.data[0] == 'l', RC car changes lanes to the left. &lt;br /&gt;
&lt;br /&gt;
4. If pkt.data[0] == 'r', RC car changes lanes to the right.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26441</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26441"/>
				<updated>2016-05-24T02:16:21Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor data is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Repeat steps, 1 and 2, to collect data from all sensors. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://youtu.be/tN-m2zH6Z08&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26439</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26439"/>
				<updated>2016-05-24T02:15:45Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Project Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor data is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Repeat steps, 1 and 2, to collect data from all sensors. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&lt;br /&gt;
&lt;br /&gt;
Demo 2: https://youtu.be/OK0Lh_0brkc&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26437</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26437"/>
				<updated>2016-05-24T02:14:41Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor data is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Repeat steps, 1 and 2, to collect data from all sensors. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nordic Wireless Communication (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Initialize char hops to &amp;quot;1&amp;quot; and char address to &amp;quot;150&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
2. Set char left = &amp;quot;l&amp;quot;, char right = &amp;quot;r&amp;quot;, and char x = &amp;quot;x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
3. Initialize switch 0 and 3 as input on transmitter board.&lt;br /&gt;
&lt;br /&gt;
4. If switch 0 is pressed, send character &amp;quot;left&amp;quot; to signal RC car to turn left.&lt;br /&gt;
&lt;br /&gt;
5. If switch 3 is pressed, send character &amp;quot;right&amp;quot; to signal RC car to turn right. &lt;br /&gt;
&lt;br /&gt;
6. At the end of the task, send character &amp;quot;x&amp;quot; to clear buffer on receiving side.&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26427</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26427"/>
				<updated>2016-05-24T02:08:47Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
IR Sensor Implementation (Step by Step)&lt;br /&gt;
&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor data is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Repeat steps, 1 and 2, to collect data from all sensors. &lt;br /&gt;
&lt;br /&gt;
* Nordic Wireless Communication (Step by Step)&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26423</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=26423"/>
				<updated>2016-05-24T02:07:28Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
* IR Sensor Implementation (Step by Step)&lt;br /&gt;
1. Send control signals to MC14051 (Analog Multiplexer) to collect data from all 6 sensors sensors.&lt;br /&gt;
&lt;br /&gt;
2. Each sensor data is stored into their own variable in the program. &lt;br /&gt;
&lt;br /&gt;
3. Repeat steps, 1 and 2, to collect data from all sensors. &lt;br /&gt;
&lt;br /&gt;
* Nordic Wireless Communication (Step by Step)&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25993</id>
		<title>File:CmpE146 S16 Jatrick SensorOrientation.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25993"/>
				<updated>2016-05-23T04:36:44Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: uploaded a new version of &amp;amp;quot;File:CmpE146 S16 Jatrick SensorOrientation.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25992</id>
		<title>File:CmpE146 S16 Jatrick SensorOrientation.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25992"/>
				<updated>2016-05-23T04:36:27Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: uploaded a new version of &amp;amp;quot;File:CmpE146 S16 Jatrick SensorOrientation.jpg&amp;amp;quot;: Reverted to version as of 04:18, 23 May 2016&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=25991</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=25991"/>
				<updated>2016-05-23T04:34:58Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: Undo revision 25988 by Proj 146u1 (talk)&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;
== Class Project ==&lt;br /&gt;
=== [[Self-driving Car]] ===&lt;br /&gt;
In this class project, students accomplish a self-drivable RC car with the following learning objectives:&lt;br /&gt;
*  Learn CAN Bus and how to communicate in an industrial or  automotive environment.&lt;br /&gt;
*  Learn integration and testing across different controllers.&lt;br /&gt;
*  Learn how to work in teams.&lt;br /&gt;
*  Learn basics of an RTOS.&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;
=== [[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;
*  [[S16: Laser Cutter Motor Controller]]&lt;br /&gt;
*  [[S16: Sprinkler]]&lt;br /&gt;
*  [[S16: Autonomous Lane Changer]]&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;
* [[F15: Quadcopter by Thomas]]&lt;br /&gt;
* [[F15: Undergrads++]]&lt;br /&gt;
* [[F15: TopGun]]&lt;br /&gt;
* [[F15: Fury]]&lt;br /&gt;
* [[F15: Minion]]&lt;br /&gt;
* [[F15: ThunderBird]]&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;
=== [[CmpE243 Fall 2014 | Fall 2014]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[F14: Team2-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team3-Self Driving Car - Optimus Prime]]&lt;br /&gt;
* [[F14: Team4-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team5-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Self Driving Undergrad Team]]&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>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=Realtime_OS_on_Embedded_Systems&amp;diff=25988</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=25988"/>
				<updated>2016-05-23T04:32:05Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /*  Spring 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;
== Class Project ==&lt;br /&gt;
=== [[Self-driving Car]] ===&lt;br /&gt;
In this class project, students accomplish a self-drivable RC car with the following learning objectives:&lt;br /&gt;
*  Learn CAN Bus and how to communicate in an industrial or  automotive environment.&lt;br /&gt;
*  Learn integration and testing across different controllers.&lt;br /&gt;
*  Learn how to work in teams.&lt;br /&gt;
*  Learn basics of an RTOS.&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;
=== [[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;
*  [[S16: Laser Cutter Motor Controller]]&lt;br /&gt;
*  [[S16: Sprinkler]]&lt;br /&gt;
*  [[S16: Autonomous Line Follower]]&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;
* [[F15: Quadcopter by Thomas]]&lt;br /&gt;
* [[F15: Undergrads++]]&lt;br /&gt;
* [[F15: TopGun]]&lt;br /&gt;
* [[F15: Fury]]&lt;br /&gt;
* [[F15: Minion]]&lt;br /&gt;
* [[F15: ThunderBird]]&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;
=== [[CmpE243 Fall 2014 | Fall 2014]] ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
* [[F14: Team2-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team3-Self Driving Car - Optimus Prime]]&lt;br /&gt;
* [[F14: Team4-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Team5-Self Driving Car - AUG]]&lt;br /&gt;
* [[F14: Self Driving Undergrad Team]]&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>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25986</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25986"/>
				<updated>2016-05-23T04:31:02Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* References Used */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
* IR Sensor Implementation (Step by Step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Nordic Wireless Communication (step by step)&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25982</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25982"/>
				<updated>2016-05-23T04:29:07Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
* IR Sensor Implementation (Step by Step)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Nordic Wireless Communication (step by step)&lt;br /&gt;
&lt;br /&gt;
== Testing &amp;amp; Technical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25964</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25964"/>
				<updated>2016-05-23T04:19:39Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Hardware Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_SensorOrientation.jpg‎|600px|thumb|center|RC Car Mounted Sensor Orientation]]&lt;br /&gt;
&lt;br /&gt;
In order to follow lanes as accurately as possible, we mounted the sensors as shown in the figure above.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25963</id>
		<title>File:CmpE146 S16 Jatrick SensorOrientation.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25963"/>
				<updated>2016-05-23T04:19:01Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: uploaded a new version of &amp;amp;quot;File:CmpE146 S16 Jatrick SensorOrientation.jpg&amp;amp;quot;: Reverted to version as of 04:17, 23 May 2016&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25962</id>
		<title>File:CmpE146 S16 Jatrick SensorOrientation.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25962"/>
				<updated>2016-05-23T04:18:31Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: uploaded a new version of &amp;amp;quot;File:CmpE146 S16 Jatrick SensorOrientation.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25960</id>
		<title>File:CmpE146 S16 Jatrick SensorOrientation.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25960"/>
				<updated>2016-05-23T04:17:55Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: uploaded a new version of &amp;amp;quot;File:CmpE146 S16 Jatrick SensorOrientation.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25958</id>
		<title>File:CmpE146 S16 Jatrick SensorOrientation.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_SensorOrientation.jpg&amp;diff=25958"/>
				<updated>2016-05-23T04:14:28Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25950</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25950"/>
				<updated>2016-05-23T04:08:20Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Software Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
'''RC Car Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_CarFlowChart.jpg|600px|thumb|center|RC Car Sensor Reading &amp;amp; Motor Control Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for our autonomous car and how the motors react depending on the sensor values. Once everything is initialized, the values from the sensors are latched into different variables. Depending on the sensor values of each sensor, the motors will react accordingly. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Wireless Flowchart'''&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_LaneChange.jpg|400px|thumb|center|RC Car Lane Change Flowchart]]&lt;br /&gt;
&lt;br /&gt;
Above is the flowchart for the wireless portion of the autonomous car. Our transmitter board's only job is to send a signal to the RC car, thus a flowchart was not necessarily vital to show the wireless implementation. The receiver board attached to the RC car has its flowchart described above. If the receiver board receives a character 'l', then the RC car will change lanes to the left. If the receiver board sends a character 'r', then the RC car will change lanes to the right.&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;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_LaneChange.jpg&amp;diff=25946</id>
		<title>File:CmpE146 S16 Jatrick LaneChange.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_LaneChange.jpg&amp;diff=25946"/>
				<updated>2016-05-23T03:58:05Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_CarFlowChart.jpg&amp;diff=25942</id>
		<title>File:CmpE146 S16 Jatrick CarFlowChart.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Jatrick_CarFlowChart.jpg&amp;diff=25942"/>
				<updated>2016-05-23T03:55:56Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25884</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25884"/>
				<updated>2016-05-23T02:48:53Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Hardware Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Sensor.jpg|300px|thumb|center|Analog IR Line Following Sensor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHARTS OF IR SENSING / PWM MOTOR CONTROL &lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHART OF WIRELESS?&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;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Sensor.jpg&amp;diff=25876</id>
		<title>File:CmpE146 S16 Sensor.jpg</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=File:CmpE146_S16_Sensor.jpg&amp;diff=25876"/>
				<updated>2016-05-23T02:36:37Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25866</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25866"/>
				<updated>2016-05-23T02:30:21Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Hardware Interface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
&lt;br /&gt;
* '''Analog Digital Converter (ADC)'''&lt;br /&gt;
For this project, we utilized 6 analog IR emitter/receiver pair sensors. Because they were analog sensors, couldn't have connected these sensors directly to any GPIO pins, but needed to connect them to the ADC pins. Because we had more sensors than available ADC pins, we used an analog multiplexer to hold multiple analog inputs, and connected the common output a single ADC pin. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Serial Peripheral Interface (SPI)'''&lt;br /&gt;
In order to implement the lane changing feature, we thought it was be best to send a signal from a separate SJone board  through the Nordic wireless. One board acted as a transmitter and one board, the one that was connected to the RC car, acted as the receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''General Purpose Input Ouput (GPIO)'''&lt;br /&gt;
Because we used 6 analog sensors while our board only had 3 available ADC pins, we needed to use a digitally controlled analog multiplexer. We fed the outputs of the sensors as inputs to the multiplexer. The single, common output of the multiplexer was connected to the ADC pin as explained earlier. In order to control which sensor value passed through the MUX, we needed to change the control signals of the MUX. Because this was a digitally controlled MUX, we initialized 3 GPIO pins to act as the control signals. &lt;br /&gt;
&lt;br /&gt;
Another utilization of GPIO pins was for the PWM signals. In order to control the motors, we contructed the circuit described in the hardware design section. We then used the PWM API provided to us in order to control the speed of each motor. &lt;br /&gt;
&lt;br /&gt;
The last way we used GPIO pins was from the transmitter board. When changing lanes, we had the transmitter board send a character over Nordic wireless once one of the on-board switches was pressed. Depending on the switch, a certain character was sent to the RC car which would then execute either a left or right turn once received.&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHARTS OF IR SENSING / PWM MOTOR CONTROL &lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHART OF WIRELESS?&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;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25825</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25825"/>
				<updated>2016-05-23T01:37:33Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Parts List &amp;amp; Cost */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| SJone Boards&lt;br /&gt;
| $80 each = $160&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Light colored masking tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Total Cost&lt;br /&gt;
| $212.03&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
'''In this section, you can describe how your hardware communicates, such as which BUSes used.  You can discuss your driver implementation here, such that the '''Software Design''' section is isolated to talk about high level workings rather than inner working of your project.&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
The IR receivers that we used in this project were analog instead of digital. (ADC)&lt;br /&gt;
GPIO&lt;br /&gt;
WIRELESS&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHARTS OF IR SENSING / PWM MOTOR CONTROL &lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHART OF WIRELESS?&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;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25819</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25819"/>
				<updated>2016-05-23T01:33:42Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Fine tuning turning and lane changing.&lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| IR reflecting tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| TBD&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
'''In this section, you can describe how your hardware communicates, such as which BUSes used.  You can discuss your driver implementation here, such that the '''Software Design''' section is isolated to talk about high level workings rather than inner working of your project.&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
The IR receivers that we used in this project were analog instead of digital. (ADC)&lt;br /&gt;
GPIO&lt;br /&gt;
WIRELESS&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHARTS OF IR SENSING / PWM MOTOR CONTROL &lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHART OF WIRELESS?&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;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	<entry>
		<id>http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25817</id>
		<title>S16: Autonomous Lane Changer</title>
		<link rel="alternate" type="text/html" href="http://socialledge.com/sjsu/index.php?title=S16:_Autonomous_Lane_Changer&amp;diff=25817"/>
				<updated>2016-05-23T01:33:04Z</updated>
		
		<summary type="html">&lt;p&gt;Proj 146u1: /* Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Grading Criteria ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;&lt;br /&gt;
*  How well is Software &amp;amp; Hardware Design described?&lt;br /&gt;
*  How well can this report be used to reproduce this project?&lt;br /&gt;
*  Code Quality&lt;br /&gt;
*  Overall Report Quality:&lt;br /&gt;
**  Software Block Diagrams&lt;br /&gt;
**  Hardware Block Diagrams&lt;br /&gt;
**:  Schematic Quality&lt;br /&gt;
**  Quality of technical challenges and solutions adopted.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Autonomous Lane Changer ==&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Car.jpg|500px|center]]&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This project proposes an autonomous RC car that follows lines along the sides that can also change lanes when possible. In the real world, cars driven on the street follow lane markers, unless the car is trying to change lanes. Cars can only change lanes when the lane lines are broken. While autonomous cars are becoming increasingly popular, one of the things to consider besides the car driving itself is the way the car operates on the street, two of those things being to stay within lane markers and changing lanes. Other line following cars follow lines directly in front of them; however, our vehicle will follow lines on its side. When the lines along the side of the car are broken, our car will be able to change lanes. Doing so allows these cars to be integrated onto real city streets without having to change current road infrastructure that are already in place. The aim of this project is to mimic this idea at a smaller scale in hopes of not only finding a way for autonomous vehicles to be integrated onto existing city streets, but also for us, as inexperienced students, to learn an important skills that will be applied in our future careers.&lt;br /&gt;
&lt;br /&gt;
== Objectives &amp;amp; Introduction ==&lt;br /&gt;
&lt;br /&gt;
Typical line following RC cars follow lines directly below and in the middle of the car. While this is a great design for the concept, we wanted to change it so that a line following RC car mimics real world self-driving cars by following real lanes on streets. The objective of this project is to create a lane following robot capable of changing lanes when necessary. &lt;br /&gt;
&lt;br /&gt;
In order to achieve this, our group utilized IR receiver pair sensors to sense the road below and the lane lines along the side. In order to implement a lane changing feature, we decided to utilize the board's wireless functionality to communicate to the car when to change lanes. &lt;br /&gt;
&lt;br /&gt;
=== Team Members &amp;amp; Responsibilities ===&lt;br /&gt;
*  Patrick-Daniel Llanes&lt;br /&gt;
** Programming Sensors&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
*  Jonathan Lo&lt;br /&gt;
** Car assembly&lt;br /&gt;
** Sensor Mounting&lt;br /&gt;
** Programming Line Following Algorithm&lt;br /&gt;
** Programming Lane Changing Capability&lt;br /&gt;
** Report Writing&lt;br /&gt;
&lt;br /&gt;
== Schedule ==&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;| Date&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Task&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Status&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Completion Date&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 1&lt;br /&gt;
| 4/6&lt;br /&gt;
| Gathered and ordered parts for Autonomous Lane Changer.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/11&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2&lt;br /&gt;
| 4/11&lt;br /&gt;
| Begin building autonomous car.&lt;br /&gt;
| Completed. &lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 2a&lt;br /&gt;
| 4/13&lt;br /&gt;
| Complete build and begin testing IR sensors and motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/18&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3&lt;br /&gt;
| 4/17&lt;br /&gt;
| Compute PWM duty cycles for motors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 3a&lt;br /&gt;
| 4/20&lt;br /&gt;
| Integrate IR sensors and begin testing sensors.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 4/22&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 4&lt;br /&gt;
| 4/24&lt;br /&gt;
| Finalize project and begin testing and debugging.&lt;br /&gt;
| Completed.&lt;br /&gt;
| 5/19&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5&lt;br /&gt;
| 5/2&lt;br /&gt;
| Finish testing. &lt;br /&gt;
| Need to fine tune turning and lane changing. &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| 5a&lt;br /&gt;
| 5/6&lt;br /&gt;
| Finalize project and prepare car for demo purposes. &lt;br /&gt;
| Figure out wireless communication. &lt;br /&gt;
|&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;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Quantity&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Description&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Price&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Shadow Chassis&lt;br /&gt;
| $12.95&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Wheel-65mm (Rubber Tire, Pair)&lt;br /&gt;
| $2.95&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| SparkFun Line Sensor Breakout QRE1113 (Analog)&lt;br /&gt;
| $2.95 each = $17.70&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Motors&lt;br /&gt;
| $3.95 per pair&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| MC14051 Analog Multiplexer&lt;br /&gt;
| $0.49&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| IR reflecting tape&lt;br /&gt;
| $5.00&lt;br /&gt;
|-&lt;br /&gt;
| 30&lt;br /&gt;
| Jumper Cables&lt;br /&gt;
| TBD&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Black Duct Tape&lt;br /&gt;
| $8.99&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 220 Ohm Resistor&lt;br /&gt;
| Free&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| PN2222 Transistor&lt;br /&gt;
| Free&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Design &amp;amp; Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware Design ===&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Sensors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; Analog IR Sensor Design]]&lt;br /&gt;
&lt;br /&gt;
To create an autonomous lane changer RC, IR emitters and receivers were used to detect lines under the RC car. The IR emitter is a source of light energy and the levels of reflectivity are received by the IR receivers. Due to the limited amount of ADC pins available on the SJOne board compared to the amount of analog sensors we implemented, we used the MC14051 Analog Multiplexer with digital controls, allowing us to implement more analog peripherals to our board, and controlling them digitally using 3 GPIO pins. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CmpE146_S16_Jatrick_Motors.jpg‎|600px|thumb|center|SJOne Board &amp;amp; DC Motor Interface]]&lt;br /&gt;
&lt;br /&gt;
We chose a simple DC motors for our RC car. In order to use the PWM API provided by our Eclipse environment, we constructed a transistor circuit shown above. Doing so allowed us to control the speed of each individual motor, allowing more control for steering. The motors on the RC car will adjust depending on the levels of reflectivity from the IR receivers.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Interface ===&lt;br /&gt;
'''In this section, you can describe how your hardware communicates, such as which BUSes used.  You can discuss your driver implementation here, such that the '''Software Design''' section is isolated to talk about high level workings rather than inner working of your project.&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
The IR receivers that we used in this project were analog instead of digital. (ADC)&lt;br /&gt;
GPIO&lt;br /&gt;
WIRELESS&lt;br /&gt;
&lt;br /&gt;
=== Software Design ===&lt;br /&gt;
Show your software design.  For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level.  Do not show the details of the code.  For example, do not show exact code, but you may show psuedocode and fragments of code.  Keep in mind that you are showing DESIGN of your software, not the inner workings of it.&lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHARTS OF IR SENSING / PWM MOTOR CONTROL &lt;br /&gt;
&lt;br /&gt;
SHOW FLOWCHART OF WIRELESS?&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;
&lt;br /&gt;
=== Issue #1 ===&lt;br /&gt;
The first issue we came across was the ADC converters. For our design, we decided to use 6 analog IR sensors, used to detect lane markers on the road. After looking at the board's schematic, we realized only 3 ADC pins were available to us. After doing some research, we found an IC that solved our issue: MC14051, an analog multiplexer. This multiplexer allowed up to 8 analog inputs, which was more than enough for the amount of sensors we had. What also made this multiplexer a good fix was that the control pins were digitally controlled, allowing us to configure GPIO pins from the SJOne board for the control inputs to the analog multiplexer.&lt;br /&gt;
&lt;br /&gt;
=== Issue #2 ===&lt;br /&gt;
Discuss the original sensor layout and how it posed a problem. &lt;br /&gt;
&lt;br /&gt;
=== Issue #3 ===&lt;br /&gt;
Discuss conditions when no lane was detected.&lt;br /&gt;
&lt;br /&gt;
Fixed with static int flag. (go in depth later)&lt;br /&gt;
&lt;br /&gt;
=== Issue #4 ===&lt;br /&gt;
Discuss how both motors reacted differently to different values (one weaker than the other)&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Conclude your project here.  You can recap your testing and problems.  You should address the &amp;quot;so what&amp;quot; part here to indicate what you ultimately learnt from this project.  How has this project increased your knowledge?&lt;br /&gt;
&lt;br /&gt;
=== Project Video ===&lt;br /&gt;
Demo 1: https://www.youtube.com/watch?v=tN-m2zH6Z08&amp;amp;feature=youtu.be&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;
&lt;br /&gt;
* We would like to thank Preet for giving his time to teach us the fundamentals and applications of embedded systems, and giving us the opportunity to create our first embedded project. You've definitely inspired us to pursue a career in embedded systems. &lt;br /&gt;
&lt;br /&gt;
* We would also like to thank Dr. Ozemek for teaching us the fundamentals of embedded systems, and giving us the inspiration to change our lifestyles.&lt;br /&gt;
&lt;br /&gt;
=== References Used ===&lt;br /&gt;
List any references used in project.&lt;br /&gt;
&lt;br /&gt;
[https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/transistors Controlling DC Motors Using PWM]&lt;br /&gt;
&lt;br /&gt;
[http://www.onsemi.com/pub_link/Collateral/MC14051B-D.PDF MC14051B Analog Multiplexer]&lt;br /&gt;
&lt;br /&gt;
=== Appendix ===&lt;br /&gt;
You can list the references you used.&lt;/div&gt;</summary>
		<author><name>Proj 146u1</name></author>	</entry>

	</feed>