\documentclass[nopageno,letterpaper,11pt]{article}

\input{"/Users/pleclair/Box Sync/Teaching (pleclair@ua.edu)/PH115/defs"}

\headheight 0.25in
\headsep 3ex
\topmargin -0.5in
\textheight 9in
\textwidth 6.5in
\oddsidemargin 0in
\evensidemargin 0in

\parindent 0in 
 
\begin{document} %\garamond

\pagestyle{headings}          %for TOC, etc use standard headings
\thispagestyle{empty}

\begin{center} 
	{\sc \large  University of Alabama}\\
		{\large Department of Physics and Astronomy}\\
	{\large PH 115 LeClair   \hfill Fall 2019} \bigskip
	
{\bf \Large Transistor circuits laboratory}

\end{center}
\setcounter{tocdepth}{2}

\section{Introduction}
\label{sec:intro}

The transistor is our first example of an ``active'' component which can produce an output signal with more power than its input signal. This does not violate conservation of energy, the additional power simply comes from the transistor's power supply, the main point is that the transistor has a sort of {\em feedback} which will allow it to effectively add power to a given signal. It is in fact not really the power gain that we are most interested in, but this feedback property, the thing which makes a transistor an ``active'' component. \\

In this lab, you will learn about two transistor circuits: a source of constant {\em current} (rather than the roughly constant {\em voltage} a battery provides), and an automatic ``night light'' that will light an LED when the ambient lighting is sufficiently low. The battery powered circuits we will construct are perfectly safe -- there is no danger of electric shock -- so we will outline the basics and then just give you the schematics and leave you to it!

\section{You will need}

\begin{my-itemize}
\item a 9V battery (your power source)
\item an electrical meter for measuring voltage, current, and resistance
\item $200\,\Omega$, $50\,\text{k}\Omega$, and $100\,\text{k}\Omega$ loose resistors (1 each)
\item LED (1, loose)
\item CdS photocell (`photoresistor'; 1, loose)
\item 2N3904 npn transistor (1, loose)
\item various lengths of wire (loose)
\item prototyping (`proto') board
\end{my-itemize}

\section{Basic transistor characteristics}

We will not dwell on how one makes a transistor, or much of the theory behind their operation. We wish only to have basic operation knowledge of how to use them. With that in mind, we should first spell out the basic properties of a transistor. A transistor is like a valve in the simplest sense (not a pump). It does not {\em force} current to flow, it rather permits it to flow to a controllable degree while the rest of the circuit surrounding the transistor tries to force current through it.\\

A transistor has three terminals (rather than two like a resistor, battery, or light), labeled the {\em emitter}, the {\em base}, and the {\em collector}. Roughly speaking, the collector ``collects'' power from the power source, delivering it to the emitter terminal which ``emits'' current. The base is the control terminal: applying a voltage to the base can either open or close the connection between the collector and emitter, modulating the current flow. In terms of a (rough) hydrodynamic analogy, the collector corresponds to a pressurized water source, the emitter the drain, and the base a valve to control the flow rate.\\

A crucial aspect is that this valve is {\em sensitive} - very small currents into the base can open and close the valve to allow much larger currents to flow between collector and emitter. In this way, amplification of power (normally called ``gain'') can be achieved - an input signal to the base can produce a much larger signal at the emitter. The hydraulic analogy would be wiggling a small valve, causing a large flow of fluid between the pipes it connects.

\subsection{Notation}

In the sort of circuits we will discuss, all potential differences (voltages, $V$) are measured relative to the circuit's ground point, which defines what we consider to be the zero point for voltages ($V\!=\!0$). Thus, it is enough to refer to the potential $V$ at any point in the circuit, knowing that $V$ is specified relative to ground. This is similar to the way that we had to define a zero height for gravitational potential energy -- the absolute potential energy or electrical potential (voltage) is not all that interesting, we mainly want to know what it is relative to a reference point. \\

Subscripts on voltages refer to the transistor terminals:
	\begin{align}
	V_e &= \text{emitter voltage relative to ground}\\
	V_b &= \text{base voltage relative to ground}\\
	V_c &= \text{collector voltage relative to ground}
	\end{align}

The same is done for currents, where the convention is that positive currents flow toward lower potential (i.e., toward ground). Thus, $I_b$ is the current going into the base, $I_c$ is the current going into the collector, and $I_e$ is the current coming out of the emitter. Two non-identical subscripts are used to refer to potential differences (voltages) between two different parts of the circuit. For instance, we might want to know the difference in voltage between the base and emitter. In shorthand, for that example we would write:
	\begin{align}
	V_{be} &= V_b - V_e = \text{potential difference between base and emitter }
	\end{align}

Two identical subscripts are shorthand for a power supply voltage being fed in (usually to the collector): $V_{cc} = \text{collector supply voltage}$.

\subsection{Modeling transistor behavior}

The type of transistors we will deal with come in two flavors, {\em npn} and {\em pnp}. We will focus on the {\em npn} variety, but in most cases {\em pnp} transistors behave the same way, but with opposite polarity. Their circuit symbols are shown below, along with an illustration of the pinout and packaging of the {\em npn} transistor (2N3904) you will encounter today.

\begin{figure}[h]
	\centering
	\includegraphics[width=0.25\columnwidth]{figures/npn-pnp.pdf} \hspace{0.1\columnwidth}
	\includegraphics[width=0.15\columnwidth]{figures/transistor-pinout.pdf}
	\label{npn-pnp}
\end{figure}

From this point on, we will worry only about {\em npn} transistors. For the purposes of this lab, transistors of the {\em npn} type have three simple rules:

\begin{my-enumerate}
\item The collector potential is higher than the emitter potential, $V_c\!>\!V_e$, and the base potential is $\sim\!0.6\,$V higher than the emitter: $V_b\!=\!V_e\!+\!0.6$.
\item The base-emitter and base-collector circuits look like diodes. Normally, the base-emitter diode is conducting, but the base-collector diode is reverse-biased. This means current flows from collector to base and base to emitter, but not in the other directions, and not directly from collector to emitter. 
	\begin{figure}[h]
		\centering
		\includegraphics[width=0.2\columnwidth]{figures/transistor-as-diodes.pdf}
		\label{as-diodes}
	\end{figure}
\item If the preceding rules are obeyed, the collector current $I_c$ is roughly proportional to the base current $I_b$, or $I_c\! \approx\! \beta I_b$, where $\beta$, the current gain, is typically around 100. That means a tiny base current can be amplified into a much larger emitter or collector current. The collector and emitter currents are essentially equal, $I_e\!\approx\!I_c$.
\end{my-enumerate}

\section{Your components}

You will receive a number of tiny components for this lab. Below is a picture to help you identify them, and some helpful schematics.The photoresistor is easily identified by the squiggly line on its flat surface. Resistors are just cylinders with colored markings and two wires, and the transistor will be the only one with three legs. Looking at the flat face of the transistor, the terminals are, from left to right, E-B-C. The LED you are probably familiar with, but be aware that the longer leg is the positive terminal, and current flows from positive (long) to negative (short) terminals.

\begin{figure}[h]
	\centering
	\includegraphics[width=0.35\columnwidth]{figures/components} \hspace{0.1\columnwidth}
		\includegraphics[width=0.25\columnwidth]{figures/diode} \hspace{0.1\columnwidth}
	\includegraphics[width=0.15\columnwidth]{figures/transistor-pinout.pdf}
	\caption{Left: picture of the components. Center: diode schematic. Right: {\em npn} transistor schematic.}
	\label{components}
\end{figure}

\section{The prototyping board}

The prototyping board (``protoboard") is a device for quickly connecting electric circuits without needing any soldering or complicated mounting. Here is a picture of a typical small protoboard, along with a close-up of the central region.\\

\begin{figure}[h]
	\centering
	\includegraphics[width=0.5\columnwidth]{figures/protoboard1.pdf}
	\includegraphics[width=0.25\columnwidth]{figures/protoboard2.pdf}
	\label{protoboard}
\end{figure}

The protoboard has sets of holes arranged in lines, and these lines are electrically connected under the board itself. In the close-up picture of the center of the protoboard, you see two sets of vertical holes: one set of five holes, a gap, and then another set of five holes. The upper five holes are connected, and so are the lower five {\em but not to each other.} Take one of the upper sets of holes connected by the white line. Any component wires plugged into the holes along a given line are connected to each other across the protoboard, but not to horizontally-adjacent lines {\em or} to the set of vertical holes below it. For example, if we want to connect our transistor to the board, we could do this:\\

\begin{figure}[h]
	\centering
	\includegraphics[width=0.25\columnwidth]{figures/transistor-hookup}
	\label{transistor-hookup}
\end{figure}

This connects the emitter, base, and collector to separate columns of holes. All four holes directly below the emitter are connected, and connected to the emitter plugged into the uppermost hole, so {\bf any wire plugged into a hole directly below the emitter will be electrically connected to the emitter.} That's it! The horizontal sets of holes at the top and bottom of the protoboard are also wired together in sets of five, but grouped {\em horizontally} instead of vertically. You can choose to ignore the horizontal lines and just use the vertical lines in the center to make things easier. Here are the two circuits we will consider wired up on a single protoboard:\\

\begin{figure}[h]
	\centering
	\includegraphics[width=0.65\columnwidth]{figures/protoboard-wired.pdf}
	\label{protoboard-wired}
\end{figure}

You can see in the lower left two resistors are plugged into a horizontal row, along with a blue wire. The blue wire is the ground connection (the negative terminal on your battery, black wire on the battery clip). The left-most resistor connects with its other end to the base terminal of the transistor, and the right-most resistor to the emitter. At the right of the current source circuit, you can see a resistor connected to the collector terminal, which then goes to a different column where it connects to an LED. The LED connects its other leg to the supply voltage (the positive terminal on the battery, red wire on the battery clip). This means the resistor and LED are in series, and connected between collector and supply.\\

A couple of important points. First, {\bf the battery should be the last thing you connect}, after ensuring that the wiring is correct to the best of your knowledge. Second, we will have example circuits correctly wired up for you to inspect to be sure you understand the protoboard. Ask if you are not sure, we are here to help! Finally: the parts you are using (aside from the battery) cost only a few cents each in bulk. If you wire something incorrectly at first and we need to replace a component, it isn't a big deal.

\section{Example Circuit: constant current source}

In intro physics, we generally tell you all about voltage sources, and note that they are easily made from batteries. You never hear how to make a {\em current} source. Why? Because a current source means a constant rate of charge flow, implying that the source must adjust its power, depending on what it is connected to, to ensure a certain flow of charge. A voltage source just needs to ensure a potential difference, which can occur even without anything connected. A current source is thus an {\em active} device which requires a bit of feedback, a task for which our transistor is well suited. \\

%% example of battery + resistor current source ... very wasteful, not programmable H&H pg59 

Let's say we want to create a $1\,$mA current source for driving a load of unspecified resistance (say, an LED). We can't do it with a battery, since we'd have to know the resistance to ensure a certain current. The simple circuit below does the job: 

 \begin{figure}[h]
		\centering
		\includegraphics[width=0.35\columnwidth]{figures/I-source.pdf}
			\caption{}\label{I-source}
\end{figure}

The idea is like this: fix the base voltage $V_b$. That fixes the emitter voltage $V_e$. The emitter voltage can then source a known current by connecting a known resistance between it and ground. Since the collector and emitter currents must be (approximately) the same, this fixes the collector current, so we just have to connect our load device between the collector and supply and we're done!\\

Let's fix the base voltage at $V_b\!=\!5.6\,$V. That makes the emitter voltage $V_e\!\approx\!V_b-0.6\!=\!5.0\,$V. With $5\,$V at the emitter, a $5\,\text{k}\Omega$=$5000\,\Omega$ resistor connected between emitter and ground produces a current of $I_e\!=\!5\,\text{V}/5000\,\Omega\!=\!0.001\,\text{A}\!=\!1\,$mA. Since $I_c\!\approx\!I_e$, that means that whatever is connected between the supply voltage and the collector (within reason) also receives a current of $I_c\!=\!1\,$mA from the supply. The only questions to resolve are how to set the base and emitter voltages?\\

Say we have $V_{cc}\!=\!10\,$V to be concrete. We can use series resistors - a voltage divider - to set the base voltage at the desired $5.6\,$V. When two resistors are connected in series to a supply voltage, they share the total potential difference. Two equal resistors connected in series to a $10\,$V supply each have $5\,$V across them. If the resistances are not the same, the larger resistor takes a larger share of the voltage, with its fractional share being its resistance divided by the sum of the two resistors. Thus, if one resistor is twice as big as the other, the larger resistor takes 2/3 of the supply voltage and the smaller takes the remaining 1/3. Thus, if we get the ratio right, we can use the same supply voltage we hooked up to the collector, divide it with an appropriate ratio with series resistors, and make the base have any voltage we like between $0$ and the supply voltage. For example:

 \begin{figure}[h]
		\centering
		\includegraphics[width=0.2\columnwidth]{figures/v-divider.pdf}
			\caption{}\label{v-divider}
\end{figure}

We connect the base to the $10\,$V supply through resistor $R_1$, and the base to ground through resistor $R_2$. The voltage at the base will be the same as the potential difference across resistor $R_2$. Using the rules for series resistors, that each resistor gets a fraction of the voltage which is its resistance divided by the sum of the two, then 

\begin{equation}
V_b = V_{R2} = \frac{R_2}{R_1+R_2} V_{\text{supply}} = 5.6\,\text{V}
\end{equation}

We can solve this for the ratio $R_1/R_2$, and we find

\begin{equation}
\frac{R_1}{R_2} = \frac{V_{\text{supply}}}{V_b} - 1 = \frac{10}{5.6}-1 \approx 0.8
\end{equation}

Thus, choosing a ratio of $0.8$ for the two resistors sets the desired base voltage, which in turn sets the emitter voltage and the emitter and collector currents. Picking $R_1\!\approx\!12\,\text{k}\Omega$ and $R_2\!\approx\!15\,\text{k}\Omega$ does the job well enough. Now we'll put this into practice and to build our own current source to power an LED.

\section{Preliminaries}

Your instructor should have introduced you to the electrical meter (``multimeter'') briefly. Let's start by exploring what we can do with it. \\

{\bf Measure and record:}

\begin{itemize}
\item Put the meter in DC V mode to measure constant voltages, on a range that can measure at least $10\,$V. Use the meter to check your battery voltage and record it. What happens when you switch the polarity of the meter's wires?
\item Put the meter in resistance (Ohms or $\Omega$) mode, and check the resistance of the three resistors you were given. Do they have roughly the expected values? You will have to adjust the range of the meters. Does it matter which polarity you use for the wires (does it matter if you switch red and black)?
\item Now check the resistance of the LED for both polarities. What happens?
\item Check the photoresistor's resistance when exposed to ambient light, and when completely covered.
\item Use the meter in resistance mode (or continuity/beep mode) and wires provided to verify that your protoboard is connected as described above. 
\item Put the meter in resistance mode on the highest scale, and grab one of the wires in each hand. What is your resistance? (Note: this is perfectly safe, there is no possibility of electric shock.)
\end{itemize}

\clearpage

\section{Circuit construction 1: constant current source}

Here is your first circuit to construct. The last thing you should connect is the battery ($V_{cc}$ and ground).

\begin{figure}[h]
	\centering
	\includegraphics[width=0.4\columnwidth]{figures/I-source2.pdf}
	\label{I-source2}
\end{figure}

From the previous section, with resistors in a ratio of 2:1, the supply voltage splits up into 2/3 across the larger resistor and 1/3 across the smaller, meaning there will be 1/3 of the supply voltage at the transistor base. Our ``$9\,$V'' battery actually has a voltage of about $9.6\,$V, so the base voltage is then $(1/3)\cdot 9.6\,\text{V}=3.1\,$V. The emitter voltage is $0.6\,$V less than this, or $2.5\,$V. The current between emitter and ground is voltage divided by resistance, or $I_e = 2.5\,\text{V}/200\,\Omega=0.0125\,\text{A}=12.5\,$mA. That means our LED is going to have a current of $12.5\,$mA if all goes well, more than enough to light it up. Some things to note: the ground connection at the bottom of the $200\,\Omega$ resistor is the negative side of the battery, and $+V_{cc}$ is the positive side of the battery. The {\em positive} terminal of the LED is the longer leg. Once you are confident the components are connected correctly, you should connect the battery and your LED should light up! \\

{\bf Questions:} Did your LED light up? What color was it? Try switching the positions of the $50\,\text{k}\Omega$ and $100\,\text{k}\Omega$ resistors. Does it still light up? Try making both of them the same value (either $50\,\text{k}\Omega$ or $100\,\text{k}\Omega$. Does it light up?

\clearpage

\section{Circuit construction 2: automatic night light.}

Here is your second circuit to construct; it is almost identical to the first circuit. In fact, if you look carefully, one need only replace the $50\,\text{k}\Omega$ resistor with the photoresistor. 

\begin{figure}[h]
	\centering
	\includegraphics[width=0.4\columnwidth]{figures/nite-lite.pdf}
	\label{nite-lite}
\end{figure}

Once you think the circuit is ready, connect the battery. For this circuit, the LED should light up when the photoresistor sees too little ambient light, or turn off when the light level is above a threshold value. Try covering the photoresistor with your finger!  \\

The threshold light level is set by two things. First, the value of the resistor between base and supply; $100\,\text{k}\Omega$ was chosen to give a reasonable threshold for CdS photoresistors. Second, the value of the supply voltage. The lower the supply voltage, the lower the threshold light level. Changing the voltage is not easy in this experiment since we are using a battery with a fixed output voltage. The first one is easy to test though: try putting a $50\,\text{k}\Omega$ in place of the $100\,\text{k}\Omega$ resistor, or try putting two $100\,\text{k}\Omega$ resistors in series (making $200\,\text{k}\Omega$ in total; ask your instructor if you are not sure how to do this). What happened with the sensitivity of the night light?\\

{\bf Questions:} Did your circuit function as expected? What happened when lowered and raised the value of the resistor in the circuit? What happens if you switch the positions of the $100\,\text{k}\Omega$ resistor and the photoresistor?

\section{For your report}

\begin{my-itemize}
\item Answers to stated questions above.
\item A brief description of how the night light circuit works.
\end{my-itemize}


\end{document}

			