Experiment: Transistor Design!
Note: Expect all figures to be gradually professionalized by our illustrator. Come back often!
Procedure
For this experiment to make your own Junior SpikerBox, you will need:
- NPN BJT transistor
- Assorted Resistor Pack
- 2 1 uF Capacitors
- 1 10 uF Capacitor
- Bread board
- Radio Shack speaker
- 9 V battery
- 9 V battery holders
- some speaker wire, map pins, and cork for your electrode
- Cockroach leg
- (optional) our stimulation cable to plug into speaker
- (optional) breadboard wiring kit
Designing the Junior SpikerBox to hear spikes
In order to build an amplifier, all you need are a transistor, a power source, some resistors, and some capacitors. There are many ways to mix these together, which is an art (a very well-paying art if you are good at it), but we will give you some basic conditions and assumptions to work with and then walk you through the design of your very own junior SpikerBox!
There are multiple configurations using NPN transistors, but we will use the “common emitter configuration” because it is by far the most popular of the three. This configuration allows us to have both high voltage and high current gain, though for our Junior SpikerBox it is the high voltage gain that interests us the most. This is what a generic common emitter design looks like, based on the textbook “Basic Circuit Theory” by Lawrence P. Huelsman:
Like any diligent engineer, let’s start with the “requirements” which is a boring way to say “what we want this machine to actually do.” For our Junior SpikerBox, we want to “amplify” the very small electrical signals in the cockroach nerves. Let’s aim for a gain of 20, or, in other words, increasing the amplitude of the signal 20 times. We also want to limit what we amplify to ensure we are only paying attention to spikes (action potentials) and not other electrical signals like heart beats, muscle activity, and noise from your house. So, like the real SpikerBox, we only want to measure signals with components above 150 Hz (cycles per second). This is also called “high-passing” the signal.
Thus, we have two requirements
- Gain of 20.
- Filter setting: low corner frequency of 150 Hz
First, each ‘V’ stands for voltage, with the subscript (small letter) as the location within the circuit. For example, VCE is the voltage between the collector and the emitter. Similarly, each ‘R’ stands for resistor, and each ‘C’ for capacitor (except for the ‘c’ directly on a transistor, which stands for collector). Here is the circuit diagram for our common emitter amplifier and a complete key for the different symbol names in the circuit diagrams, before the circuit element values have been calculated:
- VCE is the voltage between the collector and the emitter
- VBE is the voltage between the base and the emitter
- Vin is the voltage of the input signal
- Vout is the voltage of the output signal
- Rg is the resistor that most directly determines the voltage gain
- Re and Ce are the resistor and capacitor for the emitter
- Rb1 and Rb2 are the two resistors that come from the base
- Rc is the resistor from the collector
- C1 and C2 are the capacitors to remove any offset form the input and output
By setting the values of all these, we can make our amp fulfill our requirements. What should the values be? Let’s start by listing some assumptions that we can use in our amp design.
Assumption 1: VBE = 0.6 V. This is the switching voltage of the transistor, which we discussed previously in our “theory” section as the forward bias “on” voltage.
Assumption 2: The current gain in a transistor from the base to the collector is generally very large, on the order of a few hundred. So, we can assume that Ic >>Ib. And, based on Kirchoff’s law (which you will study in college, and demands that all currents going into a “node” equal all the currents going out of the “node”), we can also estimate that Ic = Ie.
Assumption 3: If we set Rg << Re we can initially ignore Rg during the initial calculations of the bias resistors, as Re will dominate the total resistance going from the emitter to ground.
Assumption 4: For simplicity’s sake, we can further assume that the same amount of voltage will be shared equally by all three elements in the series: the voltage across Rc = the voltage across the transistor = the voltage across Re.
Now let’s take these assumptions and build our amp! Our steps will be:
Step 1: The Bias and DC currents
The resistors (outside of Rg) will determine the steady bias voltages (remember the forward biases from the theory section) and the DC currents, which will allow us to keep our transistor turned “on” to amplify the neural signal at all times.
Step 2: The filter and removing DC offsets (coupling)
Our AC aspect to the circuit (the filter settings to make our corner frequency about 150 Hz) is set by our capacitors. We will also use the capacitors to remove any offsets on our input and offset signals
Step 3: The gain
After calculating the bias resistor and coupling capacitor values, we can go back and calculate Rg, which is the resistor that controls the gain of the amplifier.
Calculations
Step 1: The Bias and DC currents
With the capacitors and Rg removed per our assumptions above, here is the simplified circuit diagram that we will use to calculate our resistor values.
From Assumption 2, Ic = Ie. This tells us that we can treat Rc, the transistor itself, and Re as though they are in series (which means that the same current would be flowing through all three elements). We are using a 9 V battery, so Vbatt = 9V. Thus, the voltage drop across each resistor and the transistor would each be 3 V. We can choose any arbitrary value for IC within the tolerance of the transistor (about 600 mA for the transistor used here), then hold it as a given through the rest of the calculation. Let’s initially choose Ic to be about 2 mA. Since Vc and Ve are equal to 3 V, then according to Ohm’s law, V= IR, this means that both Rc and Re are 1500 Ω. The closest resistor size from a standard RadioShack is 2.2 kΩ, which we will use…but that now means that our actual Ic is 3V/2.2 kΩ, or 1.4 mA. Let’s re-draw our circuit, with our new resistor values labeled.
Next, we need values for Rb1 and Rb2. We use a combination of electrical engineering circuit design rules and assumptions to set up some equations to solve for these. The voltage drop of 9V has to be found entirely across the two Rb resistors, and by Ohm’s law again, V=IR, we know that the voltage across each of those resistors is equal to the resistor value multiplied by the current through the resistor. From Assumption 1, we know that Vb – Ve needs to be equal to 0.6 V. Every NPN transistor has a value called the forward current gain, hfe, which is the current gain ratio of the collector current (Ic) to the base current (Ib), and an estimate for this value is found on the data sheet of the transistor. For the type of transistor we use here, hfe is 200. Finally, similar to Assumption 2, we again assume that the base current is very small with respect to the other currents (in this case Ib << Io). Let’s look at the equations, and then solve for the two Rb values:
The closest standard resistors to these values are Rb2 = 22 kΩ and Rb1 = 32 kΩ (we use a 22 kΩ and 10 kΩ resistor in series). We now have values for each of the resistors from our initial simplified circuit, which sets the bias levels for the transistor to work as an amplifier.
Step 2: The filter and removing DC offsets (coupling)
We are now ready to solve for our capacitors. Let’s look at our full circuit, now with all of the resistors values save for Rg calculated and labeled.
The capacitors have two main functions: coupling and determining our corner frequencies. The “coupling” aspect of the capacitors separates the AC signals (our quickly changing neural signals) from the DC biasing voltage (based on the battery and the resistors). In our circuit C1 and C2 are both coupling capacitors, meaning that the capacitors block any DC component and pass only the AC signals. Without the coupling capacitors, the neural signal output would be riding on top of a larger fixed voltage, on the order of about 5 V, instead of riding on 0 V. This would be annoying for a lot of reasons, and can also make the amplifier very unstable. The coupling capacitors have to be large enough to fulfill this function, but their exact size is not important so we can arbitrarily set C1 and C2 to be a common value of 1 µF.
The other purpose of these capacitors is to determine the corner frequency for our amplifier, specifically the minimum frequency for the signals that we want to amplify. As mentioned above, we want our lower corner frequency to be 150 Hz. The capacitor that will control our corner frequency is Ce, or the capacitor from the emitter to ground. For a common emitter amplifier, the equation for calculating Ce is:
Ce = (|Av |)/(w0 Rc ),
Where |Av| is the voltage gain of the amplifier (which we decided will be 20), Rc is the collector resistor value we calculated above, and w0 is the corner frequency in radians, given by the equation:
ɯ0 = 2π*fc, where fc is the corner frequency (150 Hz).
When we solve these equations for Ce we get:
Thus, our capacitor values are C1 = C2 = 1µF and Ce = 10 µF.
Step 3: The gain
Now it is time for one more calculation, Rg, the resistor that controls the gain of our amplifier!
Up until this point, all of our resistor calculations have been about setting the bias conditions required for our transistor to amplify our signal with a fixed emitter current of 1.4 mA. However, when we introduce an alternating current signal (e.g. our neuron) into the base of the transistor, this changes our emitter current, causing it to fluctuate up and down from 1.4 mA.
We stipulated above that Rg << Re, so if there were no capacitor Ce in our circuit, the fluctuating current would primarily show up as a voltage drop across Re (the 2.2kΩ). However, because Ce (10 uF) is now in parallel with Re, the capacitor does not allow quick changes in the AC signal to change the voltage across Re . Ce is doing its job as part of our high-pass filter! Thus, the amount of current going through Re doesn’t really change based on the AC (our neuron) changes to the input. Plus, from Assumption 1 we know that the voltage between the base and the emitter remains constant at about 0.6. What this means is that as the AC signal vin (our neuron) changes, we see the result mostly as a change in voltage across Rg:
Ie = Vin / Rg
And from Assumption 2, Ic = Ie, and the voltage across Rc is the same as Vout:
Vout = Ie * Rc
Combining these two equations yields:
Vout = Vin *(Rc/ Rg)
Thus, the gain (Vout/ Vin) is going to be set by the ratio of Rc to Rg. So if we want our gain to be 20, and we’ve already set Rc to 2.2 kΩ, then we can now solve for Rg:
Our final design, with resistor and capacitor values included, our amp looks like this:
Now you’re done with the math, and it’s time to physically build your circuit. Put your battery, transistor, resistors, and capacitors into place on your breadboard.
Insert the electrodes into a cockroach leg like in Experiment 1, hook up your speaker to the circuit, and if you are lucky, you should hear the spikes! Also, hook up the speaker directly to the cockroach leg without going through the amplifier. Do you notice a difference? You should only hear the spikes if the cockroach signals go through the amplifier first.
You have now built your very own amplifier with transistors! Congratulations!
You are on your way to inventing many more wonderful things. The history of science is defined by the invention of new equipment in the hands of imaginative minds. The telescope allows you to see things very far away. The microscope allows you to see the very small. The PCR machine allows you to measure molecules of DNA, and the transistor allows you to observe tiny electrical signals. With these tools we can see and attempt to understand the world beyond the ability of our naked senses. Now begin discovering.
Discussion Questions
1- Why are the Group IV elements called “semi”-conductors? Do they conduct at all times? If not, what must be done to them to make them conduct?
2- What happens when Group III atoms are added into a block of Group IV material? What about when Group V atoms are added to Group IV instead? What do you think would happen if you just mixed Group III and Group V atoms? Do you think the resultant mix would be conductive?
3- In Experiment 3 we learned about the electro-chemical interactions that occur at the cellular membrane. How is a p-n junction similar to the lipid bi-layer of a cell? How is it different?
4- What are diodes? How do diodes relate to transistors?
