\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,vmargin={17mm,20mm},hmargin={20mm,10mm}]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{gensymb}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{scrextend}
\usepackage{blindtext}
\usepackage{caption}
\usepackage{url}
\usepackage{subcaption}
\usepackage{circuitikz}
\usepackage{listings}
\usepackage{color}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\title{Final Project Report}
\date{\today}
\author{By Akashdeep Deb}
\sloppy
\begin{document}
\title{\textbf{Final Project Report}}
\author{Akashdeep Deb and Sudeep Gummadi}
\date{\today}
\maketitle
%this is the tenth question
\begin{abstract}
\begin{addmargin}[3em]{1em}
\centering
Throughout the ECE Lab section we have learnt many electronics concepts and applied almost all of them directly or indirectly in our final lab project. Additionally, having taken away a lot from this course, we aimed to make a project that would challenge us academically and intellectually; for our final lab assignment, we made an autonomous line-following robot, that would follow a white line track using RedBot sensors, and would respond to audio cues from the environment using a microphone. In this report, we explain the use of each of the components that were used to make the final vehicle and the working of the vehicle itself.
\end{addmargin}
\end{abstract}
\section{Introduction}
%starting off with the answer
\subsection{Problem Statement}
\begin{large}
For our final project we decided to build something that would help us understand electronic circuits and would also have the functionality required for the the assignment. As a result, we finally settled on making a car that could very accurately traverse through a loop or any white track using RedBot sensors from our kit and could also stop and start moving with the sound of a clap ie. once it's microphone hears a clap it could stop and could move with the sound of another clap. Once we learnt how to control the sensors, we made minor adjustments to our circuit and tweaked the whole design with an Arduino to control the feedback and give our chassis more mobility.
\subsection{Engineering Design Tasks}
As engineers, we take on the task of designing a new device with a unique approach which highlights our skills as effective problem solvers. Essentially, to design a semi-autonomous vehicle for our final project we followed 4 essential steps which were necessary in coming up with a solution to the problem statement.
\begin{itemize}
\item[1] We evaluated the challenge by defining goals and the constraints in the problem.
\item[2] We researched by reading our helpful Lab modules and procedures to design many possible solutions.
\item[3] After coming up with these solutions, we chose the best possible solution that solved the problem in the most efficient way for our prototype.
\item[4] Testing the solution is the last step in the engineering design algorithm and hence, we performed various tests on the vehicle, tweaked it to make it more functional and tested it on many test cases as necessary.
\end{itemize}
\section{Component $\&$ Analysis}
\iffalse
\begin{figure}[hbp]
\centering
\begin{subfigure}[b]{0.4\textwidth}
\centering
\includegraphics[width=2cm, height = 5cm]{flex.png}
\caption{Bending a flex-sensor}
\label{fig:f1}
\end{subfigure}
\hspace{0cm}
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth, height = 5cm]{Flex.jpg}
\caption{Flex-sensor characteristic (Res.-Angle)}
\label{fig:f2}
\end{subfigure}
\caption{Characterization of a Flex-Sensor}
\end{figure}
\newpage
\fi
\subsection{Motors}
In electronics, a motor is an electrical machine that converts electrical energy into mechanical energy. For our project, the motors had to be controlled so that their duty cycles could be changed and their direction monitored based on the input from the RedBot sensors. When one of the RedBot sensors detected a white strip the motor on the other side would slow down relative to the motor on the same side so that the vehicle could autonomously change direction based on the data input from the RedBot sensors.
\begin{figure} [hbp]
\centering
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth, height = 5cm]{Left.jpg}
\caption{Left motor Characterization}
\label{fig:f1}
\end{subfigure}
\hspace{1cm}
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth, height = 5cm]{Right.jpg}
\caption{Right motor Characterization}
\label{fig:f2}
\end{subfigure}
\caption{Motor Characteristics}
\end{figure}
\subsubsection{Left motor Characteristic}
$~~~~I=0.014645V+0.084667 ~~~~(moving)~~~$ Moving Point - (1.2,0.081)\\
$~~~~~I=0.020501V+0.042693 ~~~~(stalling)~~~$ Stalling Point - (0.4,0.075)
\subsubsection{Right motor Characteristic}
$~~~~I=0.005886V+0.089083 ~~~~(moving)~~~$ Moving Point - (1.2,0.081)\\
$~~~~~I=0.018806V+0.032521 ~~~~(stalling)~~~$ Stalling Point - (0.4,0.057)\\
\subsection{Arduino Microcontroller (SparkFun)}
An Arduino Microcontroller is a multipurpose tool that can be used for many electronics projects as it provides many functions to a particular circuit. For our project we use it to control the vehicle's microphone sensor and the 2 RedBot sensors using C-Language code. After familiarizing with C, we wrote the code to control the sensors ourselves. (\textit{code posted below})
\begin{figure}[hbp]
\centering
\includegraphics[width=0.4\textwidth]{ar.jpg}
\caption{\label{fig:i}Arduino Microcontroller (SparkFun)\\Source: \protect\url{http://bit.ly/1Xo6sRz}}
\end{figure}
\subsection{Silicon NPN Transistor (2N5192G)}
A transistor is formally defined as a semiconductor device which can be used to amplify electrical signals or to switch electrical signals. In our experiment we used the same transistor from Lab 9 as our voltage amplifier.\\
\begin{figure}[hbp]
\centering
\includegraphics[width=0.4\textwidth, height = 3cm]{tr.jpg}
\caption{\label{fig:tr}Silicon NPN Transistor (2N5192G)\\Source: \protect\url{http://bit.ly/1Spy8ii}}
\end{figure}
\subsection{Resistors}
Resistors are a chief electrical component in circuits - they are used to reduce current flow and at the same time maintain low voltage levels to prevent short circuits and provide the required current flow in simple circuits. In our project we have used these resistors in several points in the circuit accordingly. The resistance values used in our circuits are - $~~~~~ADD ~~R~~ VALUES ~~HERE~~~~$\\
\subsection{Capacitors}
Capacitors are also an essential part of electronic circuits. It's formally defined as a passive two-terminal electrical component used to store electrical energy temporarily in an electric field. We used capacitors in our project in places according to a pre-designed circuit. (ECE 110 gives preliminary circuit component study) The capacitance values used in our circuit are - $~~~~~ADD ~~C~~ VALUES ~~HERE~~~~$
\subsection{Microphone}
A microphone is formally defined as an acoustic-to-electric transducer or simply, a sensor that can convert audio signals to electric signals. In our project we used the microphone to detect a clap - essentially a large pressure variation - from its environment and move or stop the vehicle. To control this, we used our own code using the Arduino. (\textit{code posted below})
\subsection{RedBot Sensors}
The RedBot sensor works by detecting reflected light coming from its own Infrared LED. By measuring the amount of reflected light it can detect transitions from dark to light lines and even objects directly in front of it. The sensor has a 3-pin head which connects directly to the Arduino using female-female jumper cables. For our project, we had to write code compatible with our project requirements and hence used the RedBot library to detect lines or objects. \\
An image of the sensor and the data-readings (the characteristic) as a function of its distance from white paper is attached below.
\begin{figure} [hbp]
\centering
\begin{subfigure}[b]{0.4\textwidth}
\centering
\captionsetup{justification=centering}
\includegraphics[width=4cm, height = 6cm]{red.jpg}
\caption{Image of the sensor \\Source \protect\url{http://bit.ly/1LFJ5Xr}}
\label{fig:f1}
\end{subfigure}
\hspace{1cm}
\begin{subfigure}[b]{0.4\textwidth}
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth, height = 6cm]{char.png}
\caption{Characterization of the sensor \\(generated with Octave)}
\label{fig:f2}
\end{subfigure}
\caption{RedBot sensor diagram and Characterization}
\end{figure}
\section{Design Consideration}
The primary objective of the vehicle is that it has to navigate along a line on a track of white strip paper and has to bend along curves and edges. We plan to add a feature to this car by making it able to stop and start using a microphone. To fulfill this we used 2 RedBot IR sensors and a microphone. The IR sensor observes how far it deviates from the line and, as a result, is able to keep on track. Hence, our 2 sensors were separated by 4 cm so that the vehicle could move smoothly.
\begin{figure}[hbp]
\centering
\includegraphics[width=0.4\textwidth, height = 4cm]{track.png}
\caption{\label{fig:tr}Test track for the vehicle with curved corners\\Source: \protect\url{http://bit.ly/1PTRAGf}}
\end{figure}
\section{Circuit Schematics $\&$ Explanation\\}
\begin{center}
\begin{circuitikz} \draw
(0,0) to[battery] (0,4)
to[ammeter] (4,4) -- (4,0)
to[lamp] (0,0)
;
\end{circuitikz}
\end{center}
In the circuit, the resistors exist to prevent damage to the diodes and transistors and to control current flow. The point of the diodes arranged in this way is that when node N1 is low (or 0 logic), the inverter will cause node N2 to high, causing current to flow through the top diode and through the flex sensor to charge the capacitor, however, when the capacitor exceeds, the low voltage threshold into high (or 1 logic) voltage. After, Node N2 becomes low voltage, and current flows through the other diode to discharge the capacitor, similarly unti§l node N2 becomes high voltage and current flows back to the capacitor again. In the entire process nodes N3 and N4 change accordingly to create the duty cycle with equation where R1 is the flex resistance and R2 is the other resistor in that sub-circuit.
\section{Code}
The next code will be directly imported from a file (Random Code now)
\lstinputlisting[language=C++]{gift1.cpp}
\section{Conclusion}
After designing the circuit required, assembling the circuit on the breadboard and having tested in multiple times with many test cases, we could build our autonomous vehicle which followed the white line track and switched mobility based on the claps from the environment just like a semi-autonomous vehicle! \\
\begin{figure}[hbp]
\centering
\begin{subfigure}[b]{0.4\textwidth}
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth, height = 6cm]{pr1.jpg}
\caption{Front-Side view of chassis w/ circuit\\ (Redbot sensors attached)}
\label{fig:f1}
\end{subfigure}
\hspace{1cm}
\begin{subfigure}[b]{0.4\textwidth}
\centering
\captionsetup{justification=centering}
\includegraphics[width=\textwidth, height = 6cm]{pr2.jpg}
\caption{Side view of chassis \\(Motor, Arduino, Circuit visible)}
\label{fig:f2}
\end{subfigure}
\caption{Photos of Final Lab Project}
\end{figure}
\section{Self-Evaluation $\&$ Future Projects}
We can say with utmost certainty that the takeaway from a project like this is definitely going to help in the future. Having designed an autonomous vehicles moving with cues from its environment we feel equipped with the tools to learn more about circuits and implement more complex circuits. Having learnt about using Microcontrollers, simple electrical components, microphones, and RedBot sensors, we are planning to take this project further by adding more sensors to improve and increase functionality. One idea for a future project is to add a heat sensor so that the car can move in a direction with a depression on the heat map - we plan on doing this using concepts of computer vision and machine learning to analyze the heat map and finding the minima on the map; a potential application of this is that the vehicle and autonomously change directions in case of a fire. Indeed, a project like this will be a great learning experience just like our final project was. \\
\section{References}
\begin{itemize}
\item[1] SparkFun - Flex Sensor\\ \url{https://cdn.sparkfun.com/datasheets/Sensors/ForceFlex/FLEXSENSORREVA1.pdf}
\item[2] ECE 110 - Experiment 9 - Navigation\\
\url{https://courses.engr.illinois.edu/ece110/fa2015/content/labs/Experiments/experiment.9.procedures.FA15.v10.pdf}
\item[3] RedBoard by SparkFun - Programmed with Arduino\\
\url{http://www.robotgear.com.au/Product.aspx/Details/733-RedBoard-by-SparkFun-Programmed-with-Arduino}
\item[4] 2N5192G ON Semiconductor | Mouser \\
\url{http://www.mouser.com/ProductDetail/ON-Semiconductor/2N5192G/?qs=vLkC5FC1VN$\%2Fa3d2jm7wSkw\%3D\%$3D}
\item[5] Sensors\\
\url{http://ixda.gatech.edu/resources/files/scott-sensors.pdf}
\item[6] Resistor - Wikipedia, the free encyclopedia\\
\url{https://en.wikipedia.org/wiki/Resistor}
\item[7] Capacitor - Wikipedia, the free encyclopedia\\
\url{https://en.wikipedia.org/wiki/Capacitor}
\item[8] Ceramic Capacitor $>>$ Capacitor Guide\\
http://www.capacitorguide.com/ceramic-capacitor/
\item[9] Transistor - Wikipedia, the free encyclopedia\\
\url{https://en.wikipedia.org/wiki/Transistor}
\end{itemize}
\noindent\rule{18.5cm}{0.4pt}
\end{large}
\end{document}