Practical Electronics for Optical Design and Engineering
Practical Electronics for Optical Design and Engineering
Published by
SPIE
P.O. Box 10
Bellingham, Washington 98227-0010 USA
Phone: +1 360.676.3290
Fax: +1 360.647.1445
Email: [email protected]
Web: http://spie.org
The content of this book reflects the work and thought of the author. Every effort has
been made to publish reliable and accurate information herein, but the publisher is not
responsible for the validity of the information or for any outcomes resulting from
reliance thereon.
I Basic Electronics 1
1 Introduction to Electronics 3
1.1 Ohm’s Law 4
1.2 Simple LED Circuits 5
1.3 Resistors 6
1.4 Signals 11
1.5 Measuring Instruments 12
1.6 Voltage Dividers and Regulators 15
1.7 Device Data Sheets 19
1.8 Practice Problems 19
References 20
2 Common Electronic Circuits and Components 21
2.1 Bridges and Balance Measurements 21
2.2 Diodes 27
2.3 Transformers and Inductors 29
2.4 Transistor Switches and Amplifiers 30
2.5 Power Transistors 32
2.6 Combining Transistors 34
2.7 Digital-to-Analog Conversion 35
2.8 Practice Problems 36
References 37
3 Linear Amplifiers 39
3.1 Inverting Operational Amplifier Configuration 40
3.2 Non-inverting Operational Amplifier Configuration 42
3.3 Operational Amplifiers: Math Circuits 44
3.4 Differential Amplifiers 46
3.5 Transfer Functions, Imaginary Numbers, and Decibels 48
3.6 Bode Plots 49
vii
viii Contents
8 Photodiodes 107
8.1 Light Detectors 107
8.2 Transimpedance Amplifiers 109
8.3 Amplifier Chaining 111
8.4 Removing Unwanted Effects 111
8.5 Photodiode Applications 112
8.6 Capacitance and Oscillation in Amplifiers 116
8.7 Practice Problems 118
References 118
9 Quad-Cells and Position-Sensitive Detectors 119
9.1 Quad-Cells 119
9.2 Quad-Cell Mathematics 121
9.3 Quad-Cell Electronics 124
9.4 Position-Sensitive Detectors 125
9.5 Spot Location in Position-Sensitive Detectors 127
9.6 Position-Sensitive Sensor Electronics 127
9.7 Practice Problems 128
References 129
10 Proportional-Integral-Derivative Controllers 131
10.1 Controllers 131
10.2 Proportional-Integral-Derivative Controllers 133
10.3 Bang-Bang Controllers 134
10.4 Proportional Controllers 134
10.5 Proportional-Integral Controllers 137
10.6 Proportional-Integral-Derivative Controller Redux 139
10.7 Proportional-Integral-Derivative Electronics 141
References 143
11 Strain Gauges 145
11.1 Strain Measurement 145
11.2 Gauge Factor 147
11.3 Strain Gauge Calculations and Electronics 148
11.4 Strain Gauge Signal Processing Electronics 149
11.5 Load Cell to Microcontroller 150
11.6 Strain Gauge Applications in Optics 151
11.7 Practice Problems 154
References 154
12 Stepper Motors and Actuators 157
12.1 Stepper Motors 158
12.2 Stepper Motor Signals 159
12.3 H-Bridge 160
12.4 Microcontroller-Driven Stepper Motor 160
x Contents
Bibliography 213
Index 217
Preface
Optical engineers make use of a wide range of sensors and controllers in optical
systems. Photodetectors, cameras, and actuator systems all use electronics and
electrical control systems to operate. There are a wide range of manufacturers
of electronics systems, but sometimes all we need is a simple circuit to read a
sensor or to condition a signal. Whether the needed electronics are to support a
photodiode or a strain gauge, or just to make a trigger to start several
instruments simultaneously, quite often the needed components are readily
available on the bench. However, the how-to and confidence to start assembling
the needed device may be lacking. Once a circuit has been assembled, the
question arises of how to properly check its operation. This might require the
use of tools that perhaps haven’t been touched since that one undergraduate
circuits class that still causes those exam anxiety nightmares!
Practical Electronics for Optical Design and Engineering has been
organized into three parts: Basic Electronics, Optical Applications, and
Projects and Finishing. The first part, Basic Electronics, focuses on a wide
range of fundamental circuits important in understanding and working with
electronics including making electronic measurements and techniques for
moving the data from a sensor through to a computer. Optical Applications is
composed of seven chapters and builds on the previous material, introducing
specific electronics of interest to optical engineers. Projects and Finishing
provides some ideas about how to complete projects and works through the
development of an example instrument.
The book is designed so that you can get started on any chapter that
catches your attention and seek more specialized information from the earlier
chapters as needed. Some examples of these interesting circuits are
transimpedance amplifiers and drivers for low-light photodiodes, using solar
cells as a power source or battery charger, low-resolution digital-to-analog
converts, analog controllers, quad-cell processing, and analog control circuits.
Discussions on how practical electronics work, their design, and translating
this to circuit board manufacturing, as well as the limitations of different
prototyping approaches are included.
Examples throughout the book range from simple calculations to sample
MATLAB® scripts. You are encouraged not only to work the examples and
xi
xii Preface
use the MATLAB code, but to construct and test the circuits. The aim of the
MATLAB-based examples is to support an understanding of the funda-
mentals and relationships behind the electronics and to provide a starting
point for your own code.
I hope that Practical Electronics for Optical Design and Engineering
provides the interested reader with a functional overview of the topic of
electronics and an appreciation for the way knowledge of electronics can
enhance optical projects. While this book is not meant to be a complete
treatise on electronics, as there are many excellent books on the topic, the aim
here is to provide an introduction more closely tied to the needs of those
working in optical engineering and design.
I greatly appreciate all of the colleagues and friends who have both
directly and indirectly helped me in preparing and writing this book, and I am
grateful for their unswerving and unselfish support. I also appreciate the
feedback from the many students who over the years have helped me refine
my optics and electronics lectures and laboratories. I am particularly grateful
to my grandfather, Stephen Holmes Scott, who introduced me to electronics
many years ago.
While I have benefited from the support of many individuals in preparing
this work, any errors that remain in the text are mine to fix. I would
appreciate receiving any assistance in this in the form of comments and
corrections. Please direct any correspondence to the author c/o New Mexico
Tech, Electrical Engineering Department, Socorro, NM 87801, USA.
I am most grateful for the support of SPIE Press for their interest in
publishing this work as part of the Tutorial Text Series, and particularly the
efforts of Senior Editor, Dara Burrows, for putting this work into its final
form.
Scott W. Teare
Professor of Electrical Engineering
New Mexico Institute of Mining and Technology
Socorro, New Mexico
May 2016
Acronyms and Abbreviations
AC alternating current
ADC analog-to-digital converter
ADU arithmetic data unit
AGM absorbed glass mat
AI analog input
BASIC Beginner’s All-purpose Symbolic Instruction Code
BJT bipolar junction transistor
BNC Bayonet Neill–Concelman (coaxial connector)
BW bandwidth
DC direct current
DIO digital input/output
DIP dual in-line package
DSP digital signal processor
DUT device under test
DVM digital voltmeter
FPGA field-programmable gate arrays
GBP gain–bandwidth product
hr hour (unit)
IC integrated circuit
IDE integrated development environment
LED light-emitting diode
LSB least significant bit
MOSFET metal-oxide semiconductor field-effect transistor
MSB most significant bit
op-amp operational amplifier
PI proportional-integral
PIC programmable integrated circuit
PID proportional-integral-derivative
PSD position-sensitive detector
RCA Radio Corporation of America (coaxial connector)
RMS root mean square
SD Secure Digital
SMA sub-miniature version A (coaxial connector)
xiii
xiv Acronyms and Abbreviations
Safety Warning
Always wear safety glasses when working on or around electronic circuits and
follow all equipment and component manufacturers’ safety instructions.
Circuits included in these chapters may not be suitable for a particular
application.
Chapter 1
Introduction to Electronics
3
4 Chapter 1
V ¼ I · R, (1.1)
where V is the voltage in units of volts [V], I is the current in units of amperes
[A], and R is the resistance in units of ohms [V]. The utility of the equation will
be made clear shortly. For the moment, just remember that Ohm’s law is
frequently used in electronics problems; fortunately, it is not very complicated.
Power describes the rate at which energy is being used. If we know the
current and the voltage, we can directly calculate the power from
P ¼ V · I, (1.2)
where P is the power and is measured in watts [W]. Other relationships can be
created for the power by substituting in Eq. (1.1) after rearranging for either
voltage or current. The value of these simple equations will become clear in
just a couple paragraphs when we start to investigate a basic circuit.
The first circuit we will look at is a traditional one for introducing
electronics; it is a circuit that turns on a light source using a battery and a switch.
To make this circuit more interesting, we will introduce the light-emitting diode
(LED) as our light source. The LED is a semiconductor optoelectronic
component that is much more energy efficient than an incandescent lamp.
Today, these devices are nearly as popular as the old-style “grain-of-wheat”
lamps, and we will use them in many of our example circuits.
An LED is an electrical device that converts electrical power to light. The
operating characteristic for an LED can be described in the simplest sense as a
forward voltage and a current; in other words, the LED is sensitive to the
direction of current flow. We can use this information and Eq. (1.1) to determine
the resistance of the LED and its operating power, as shown in Example 1.1.
Example 1.1
The forward voltage Vf and forward current If for an operating red LED are
2.2 V and 20 mA, respectively. Calculate the resistance and power used.
Introduction to Electronics 5
Figure 1.1 A battery wired to a switch, resistor, and LED, and relevant features.
6 Chapter 1
decreasing the resistance can be tried to make the LED turn on. This
calculation is performed in Example 1.2.
Example 1.2
Calculate the resistance needed so that a 9-V battery can be used to power an
LED that requires 2.2 V and 20 mA to operate.
The resistance or load connected to a 9-V battery that will draw a total
current of 20 mA is calculated from Ohm’s law as
9V
R¼ ¼ 450 V:
20 mA
The LED has an operating resistance of 110 V, so a resistor of 450–110 V will
be needed to lower the voltage. The voltage drop across the resistor with a
current of 20 mA will be
340 V
V¼ ¼ 6.8 V:
20 mA
The conclusion from Example 1.2 could also be stated as: Knowing that the
current through the LED is 20 mA and that the operating voltage is 2.2 V,
we need to lower the voltage by 9 – 2.2 or 6.8 V using a 20-mA current or
340 V.
Now many interesting details were introduced in this section as we made
our decision on powering the LED. To understand this further, we need to
look at how the basic electronic components are used. We will begin with a
closer look at resistors.
1.3 Resistors
We have shown the nature of voltage and current in terms of driving force
and moving charge provided by a battery, but we haven’t said much about
resistors. Resistors have many roles; in the last section, a resistor was used to
drop the voltage going into the LED. Resistors do this, for the most part, by
converting current to heat. Resistors are physical devices and are available
in compact packages whose sizes relate to their ability to dissipate power
without damage. The power-handling capability of a resistor is measured in
units of watts.
Common resistors are made of carbon between two wires. It can be
interesting to break one open and see inside! The physical size of the resistor
relates to the amount of carbon in the resistors and to the amount of power a
resistor can dissipate. The resistance value is indicated on a resistor by either a
number or a set of colored bands that can be translated into the value in ohms.
Introduction to Electronics 7
Figure 1.2 Top: A collection of various low-power resistors showing colored bands that
define their resistance values. Bottom: Illustration of color bands and surface mount resistors
with their values.
Colored bands, some examples of which are shown in Fig. 1.2, are the most
common way to identify resistors.2
The colored bands, either three or four colored stripes around the body of
the resistor, are located toward one end. The colored bands indicate the
resistance value and the tolerance or how close the actual resistor value will be
to the stated value. There are three common tolerance levels: 5 is represented
by Gold, 10 is represented by Silver, and 20% is represented by only three
bands.
The key to translating the individual colors into numbers is shown in
Table 1.1. To simplify this discussion, the first three colored bands, referred to
as A, B, and C, are used to indicate the value of the resistor. The resistor value
can be determined from the following equation:
Notice that the third band C is used to multiply the first two digits by a factor
of 10 raised to the power of C. A simple example can be used to show how this
works: a three-band resistor of Red Red Orange would convert to numbers as
2 2 3 and thus be combined as 22 times 10 to the power 3, or 1000, for a
resistor value of 22,000 V. As there are only three bands, the resistor has a
tolerance of 20%, or R ¼ 22000 4400 V. If we measure the resistor’s value,
we would expect it to lie between 17,600 and 26,400 V.
So, really, the resistor color code is just shorthand for identifying the
resistor value. The lower the tolerance range the more expensive the resistor is
to purchase. There are also high-precision resistors that are considerably more
costly to purchase so are used only for very specialized work.
The resistors with wire leads are referred to as “through hole” components;
i.e., the wire ends can be poked into a hole for mounting and connection. The
trend these days is toward smaller electronics, so parts are also being reduced in
size. These parts mount differently and are soldered onto metal pads on the
surface of an electronics board. Surface-mount resistors look like small black
rectangles, as shown in the bottom of Fig. 1.2, and are often only a few
millimeters in size. The numbers on these resistors refer to their resistance value,
with the last number being the multiplier. There are some subtleties in the
interpretation of surface-mount resistors as well as some new coding systems.
For low-valued resistors, an R is used to indicate where the decimal point is
located. For instance, R470 would indicate a 0.47-V resistor. The EIA-96 code
is for 1% tolerance resistors and is a little more complicated to interpret; users
should check with the manufacturer of their parts.3
There are occasions when a very precise resistor value is needed that is not a
standard resistor value. Of course, one could purchase a large number of low-
tolerance resistors and measure their individual values in the hope of finding the
value needed; however, we can also construct the resistance we need by
combining other resistors. We can wire resistors together in two common forms,
series and parallel, as shown in Fig. 1.3.
Introduction to Electronics 9
Figure 1.3 Two circuits showing resistors connected in parallel (left) and in series (right).
In this book we use the convention that straight wires that cross are not
connected unless there is a dot at the crossing point.
Resistors can be combined into an effective value based on two
mathematical expressions shown in Eqs. (1.4) and (1.5) for series and parallel
resistors, respectively:1
X
Rseries ¼ Ri , (1.4)
i
1 X 1
¼ , (1.5)
Rparallel i
Ri
where Ri show the individual resistors, and i ¼ 1,2,3 . . . N, where N is the
maximum number of individual resistors to be summed.
There are some interesting limiting cases for combining resistors in series
and parallel. If we have two identical resistors of value R connected in series,
then the effective resistance is 2R, while if they are connected in parallel, the
effective resistance is R/2. If we have two resistors that are several orders of
magnitude different in value, when they are connected in series, the effective
resistance is approximately the larger of the two resistors; when they are
connected in parallel, the effective resistance is the smaller of the two resistors.
This is demonstrated in Example 1.3.
Example 1.3
Two resistors, R1 ¼ R and R2 ¼ 1000R are connected first in series and then
in parallel. Using Eqs. (1.3) and (1.4), calculate the effective resistance in each
case.
Rseries ¼ R1 þ R2 ¼ R þ 1000R ¼ 1001R 1000R,
1 1 1 1 1 1000 þ 1 1
¼ þ ¼ þ ¼ ,
Rparallel R1 R2 R 1000R 1000R R
or Rparallel = R.
10 Chapter 1
Example 1.4
Write a MATLAB script to calculate the equivalent resistance of a 200-V and
400-V resistor connected first in series and then in parallel.
% Example_1_4.m
% SWT 9-4-15
% Housekeeping
clear all; % clears the variable list and starts fresh
clc; % clears the command window
% Input values
%% Use the MATLAB input() command to request data
Introduction to Electronics 11
%% Calculation
% Perform required calculations
Rseries = R1 + R2;
Rparallel = 1/(1/R1 + 1/R2);
%% Output
% Echo the results to the screen
fprintf(‘\nR1 is: %6.1f ohms R2 is: %6.1f ohms\n’, R1, R2)
fprintf(‘Rseries is: %6.1f ohms\n’, Rseries)
fprintf(‘Rparallel is: %6.1f ohms\n’, Rparallel)
Result:
R1 is: 200.0 ohms R2 is: 400.0 ohms
Rseries is: 600.0 ohms
Rparallel is 133.3 ohms
1.4 Signals
A voltage applied to a circuit can be constant or it can vary with time.
Time-varying voltages can be used as power sources such as the AC voltage in
a house, or can be thought of as signals containing information such as a radio
transmission. The general expression for a time-varying voltage is shown as
N
X
V ðtÞ ¼ V DC þ vðtÞ ¼ V DC þ V i sinðvi t þ di Þ, (1.6)
i¼1
where VDC is a steady state voltage, and V(t) is a time-varying signal. In the
case of a single frequency, the time-varying signal will have an amplitude V1
and a sine function driven by v1 ¼ 2pf1 (where f1 is a frequency, and t is time)
and a phase d1 from a reference. Steady state signals are often referred to as
DC for direct current, and time-varying signals as AC for alternating
current.5,6 The function is shown in Fig. 1.4.
Time-varying signals are often called periodic and can have functional
forms other than sinusoidal. Ramps, steps, square functions, and many others
are often encountered in electronics. When time-varying signals are involved,
there can be many different frequencies. When working with time-varying
signals, to account for components that have frequency dependence, the
12 Chapter 1
Figure 1.4 A time-varying signal based on Eq. (1.6), showing VDC ¼ 5 V at the start and
then a superimposed sinusoidal signal V1 ¼ 10 V.
components used to control the voltage and currents are said to have
impedance rather than resistance. Such frequency-dependent components
include capacitors and inductors as well as many semiconductor devices.
Impedance is the broader term for talking about resistance to current flow
in a circuit and is a function of frequency. Impedance includes the effects of
resistance, capacitance, and inductance, the latter two of which include
devices known as capacitors and inductors. Both capacitors and inductors
have the ability to store energy and release it as well as to impede the flow of
current. These devices will be discussed in later sections so, while introduced
here, are not fully described. Don’t worry. Capacitors and inductors will be
included in later discussions.5,6
Figure 1.5 A simple circuit with measurement points and connections shown. Notice that
the ohmmeter is used when the resistor is out of the circuit.
drop across the resistor, while the ammeter measures the current that is
flowing in the circuit.2 When using the ohmmeter, the resistor should not be
connected to the rest of the circuit and is shown here as a separate device
under test (DUT).
While a single DVM can perform each of the three measurements shown
in Fig. 1.5, it can only perform the measurements one at a time. Each of the
different measurement types will be considered individually:
Ammeter: To measure the current, we need the ammeter to be connected
to our circuit in series, and the circuit needs to be powered. That is to
say, we need to break the circuit and then reconnect the two ends with
the ammeter. In this way the current flows through the ammeter. Care
needs to be taken as to how much current we measure to make sure it is
within the allowed range of the meter.
Voltmeter: The voltmeter measures the voltage across a device and so
connects in parallel with the device. The circuit must be on in order to
measure the voltage drop across a device.
Ohmmeter: The ohmmeter has its own internal power source, so the DUT
must not be powered for this measurement. In general, we don’t want
the DUT to be in the circuit so that the rest of the circuit doesn’t affect
the measurement of the DUT.
One interesting observation is that when we measure the voltage drop
across a resistor of known value, we are actually able to back calculate the
current! In Fig. 1.5 we will expect to see that the ammeter’s measurement of
the current I will equal the ratio of VR/R that we measure with the
voltmeter!
Most DVMs are able to measure DC voltages using different meter
settings. However, sometimes we would prefer to see the alternating signal
displaced as a voltage-versus-time trace; this is where the DVM loses its
usefulness. Voltage–time measurements are possible using a different
14 Chapter 1
Example 1.5
Write a MATLAB script to plot two sinusoidal signals with offset voltages of
+10 and 10 V, frequencies of 10 and 15 Hz, and a phase shift of 2.
% Example_1_5
% SWT 9-3-15
Introduction to Electronics 15
%% Housekeeping
clear all;
clc;
%% Parameters
Vo = 5; Vdc(1) = 10; Vdc(2) = -10; % in volts
freq (1) = 10; freq (2) = 15; % in Hz
delta(1) = 0; delta(2) = 0;
%% Calculations
for idx = 1:2
omega(idx) = 2*pi*freq(idx);
end
%% Output
figure(1); plot (t,VV1,t,VV2,‘.’);
axis([0 1 -20 20]); xlabel(‘Time (seconds)’);
ylabel(‘Voltage (V)’);
grid on;
Figure 1.7 R1 and R2 are connected in series to form a voltage divider. By carefully
choosing the resistor values, Vout can be set between the value of the ground and the battery
voltage.
Example 1.6
Calculate the relationship between resistors to be used in a voltage divider to
get an output voltage of 5 V using a 9-V battery as the source.
V out R1 5V
¼ ¼ :
V in R1 þ R2 9 V
Rearranging this equation yields
5
R1 ¼ R2:
4
divider to achieve the 5-V output that we wanted. Example 1.7 shows a
MATLAB script that uses the input() command to take in the values of the
resistors and the input voltage.
Example 1.7
Construct a voltage divider calculator using MATLAB and determine the
output voltage from two 1000-V resistors with a load of 1 kV and 1 MV. The
program takes an input voltage value in volts.
% Example_1_7.m
% SWT 9-4-15
% Housekeeping
clear all; % clears the variable list and starts fresh
clc; % clears the command window
% Input values
%% Use the MATLAB input() command to request data
fprintf(‘Voltage divder calculator\n\n’);
prompt = ‘Enter the input voltage: ’;
VI = input(prompt); % in volts
% Calculation
%% Perform required calculations
REffective = 1/(1/R2 + 1/RL);
VO = VI* REffective/(R1+REffective);
% Output
%% Echo the results to the screen
fprintf(‘\nVout is: %6.1f V\n’, VO)
18 Chapter 1
While we are easily able to get the voltage that we want, is that all there
really is to this problem? The voltage output is typically used to drive a load.
This load can be represented by another resistor connected in parallel to R2.
We saw earlier that there will be a change in the circuit if we add another
resistor to the circuit. Let’s consider a load resistor of 400 V. Using Eq. (1.4),
the effective parallel resistance would be 200 V; thus, we would no longer have
5 V available as the output from the voltage divider. Of course, if the load was
closer to 1 MV, there would not be a problem.
As such, we need a better way to create our desired voltage that is not as
sensitive to the effect of adding a low resistance load. This is quite a common
problem, so some very elegant solutions are available; one of the best is the
voltage regulator. The voltage regulator is a rather sophisticated device, but it
is so commonly used that we will introduce it now, along with a brief
description (without much background detail at this point) of how to use it.
Voltage regulators are semiconductor devices designed to maintain a
constant voltage level. Here, we treat them as a “black box” and demonstrate
how they are used, starting with Fig. 1.8.
The 7805 voltage regulator lowers the battery voltage to 5 V. Regulators
come in many voltage ranges; the number 5 in the 7805 indicates that it
provides a 5-V regulated output. Often, the final capacitor C is not required
and is there to act as a source of extra charge if needed. This is a very practical
Figure 1.8 A voltage regulator used to convert a 9-V battery supply into 5 V. C1 and C2 are
low-valued capacitors to support the 7805 device, while C is a larger filter capacitor. C might
not always be required if the regulator is close to where the power is needed.
Introduction to Electronics 19
and simple power supply, and many different source configurations can be
used in place of the battery.
When a load is not attached, the power draw of the voltage regulator is
very low, making it ideal to be supplied by a battery. Voltage regulators
are available in a wide range of values such as the 7812, 7815, and so forth.
The major advantage of the voltage regulator is that it provides its
rated voltage over wide-range current requirements. The limitations and
proper operation of a voltage regulator can be found in the device data
sheets.
References
1. C. K. Alexander and M. N. O. Sadiku, Fundamentals of Electric Circuits,
Fifth Edition, McGraw-Hill, New York (2013).
2. B. Grob, Basic Electronics, Eighth Edition, McGraw-Hill, New York
(1997).
3. Resistor Guide: www.resistorguide.com. Last accessed: 4-14-16.
4. H. Moore, MATLAB® for Engineers, Fourth Edition, Prentice-Hall,
Upper Saddle River, New Jersey (2014).
5. P. Horowitz and W. Hill, The Art of Electronics, Cambridge University
Press, Cambridge (2015).
6. A. S. Sedra and K. C. Smith, Microelectronic Circuits, Oxford University
Press, Oxford (2015).
Chapter 2
Common Electronic Circuits
and Components
Now that we have been introduced to some basic electronic concepts in
Chapter 1, we will get to the business of making circuits to perform specific
tasks. Many of these tasks involve setting and comparing voltage levels, and
signal amplification. These applications will be used to introduce some
additional electronic devices including semiconductor diodes and transistors
as well as inductors, capacitors, and transformers. The current trend of
moving to smaller electronics packages and surface mount electronics
applies equally well to capacitors, diodes, and transistors, as it does to
resistors. Surface mount components and their use will be discussed in a
later chapter.
The major device configurations that will be introduced are bridges,
rectifiers, amplifiers, and digital-to-analog converts. While each is useful for
its own application, they are also useful as a means to learn about how diodes,
transistors, and resistors can be used in circuits to perform specific tasks. In
this chapter we will extend the idea of voltage dividers to making bridges for
use in sensitive measurements, current dividers, diodes, some simple
amplifiers, and power drivers, and introduce the idea of digital versus analog
signals and how to convert signals from digital to analog.
21
22 Chapter 2
Figure 2.1 A simple voltage divider circuit showing a variable resistor or potentiometer.
The output of the voltage divider V0 was introduced in the last chapter as
part of our discussion on power supplies. It is reintroduced here with a small
change; one of the resistors is now variable:
P1
V0 ¼ VI · , (2.1)
R1 þ P1
Figure 2.2 A selection of potentiometers showing some of the different shapes available.
Notice that they have three connection leads!
Common Electronic Circuits and Components 23
Figure 2.3 Two ways to use a potentiometer to make a voltage divider. Both work to lower
the voltage, but the circuit in (b) has built-in current limiting with the resistor R1. Notice the
alternative ground symbol at the bottom of the circuits.
Example 2.1
A voltage divider is constructed as in Fig. 2.3(b). The resistor R1 is 1 kV and
the potentiometer P1 has a maximum resistance of 10 kV. What are the
maximum and minimum voltages that can appear at V0, and what are the
maximum currents?
Using our voltage divider equation and the maximum resistance of P1,
P1 10 kV 10
V0 ¼ VI ¼ VI ¼ VI V:
R1 þ P1 1 kV þ 10 kV 11
Using our voltage divider equation and the minimum resistance of P1,
P1 0 kV
V0 ¼ VI ¼ VI ¼ 0 V:
R1 þ P1 1 kV þ 0 kV
So, having the resistor R1 in place means that we can’t get the maximum
voltage out; however, even when there is a short circuit to ground, the value of
R1 is still present and the maximum current that can be drawn from the
supply is
VI VI
I¼ ¼ ¼ V I mA:
R1 þ P1 1 kV þ 0 kV
If VI is 10 V, then the maximum current would be 10 mA through the resistor.
This example shows the value of having a 1-kV resistor in the circuit to
limit the current: even in the worst-case scenario of a short across the voltage
output, only VI / 1000 A can be drawn from the source. Most power supplies
will be able to handle such a load. While a lower resistor value will increase
the amount of the voltage available at the load, the current will also rise.
The voltage divider circuit has many uses beyond providing power to a
load; it can also be used to support many sensitive measurements when
combined into a bridge circuit. The most common of these bridge circuits is
the Wheatstone bridge.1 The Wheatstone bridge is made from two voltage
dividers fed from the same power supply. A common form of the Wheatstone
bridge is the resistor checker shown in Fig. 2.4.
The resistor checker in Fig. 2.4 is a device designed to quickly sort
resistors. It works because when the ratios of R1/R2 and R3/DUT are the
same, the difference voltage of the bridge will be zero. This provides a quick
way of identifying resistors that are a perfect match, or lie within some small
variance of the desired value. These ideas are shown in Example 2.2.
Common Electronic Circuits and Components 25
Figure 2.4 A Wheatstone bridge configured to check resistor values against a standard.
The DUT is where the test resistor is placed.
Example 2.2
Write a MATLAB® script to show that a Wheatstone bridge can be
considered as two voltage dividers in parallel. The voltage difference between
the two sides of the bridge biased to 10 V and the current in each side is shown
in Fig. 2.4, where R1 ¼ 100R3 and R2 ¼ 100RDUT.
% Example_2_2.m
% SWT 11-28-15
% Housekeeping
clear all; clc;
% Resistors
R3 = 1000; % Ohms
RDUT = 1000; % Ohms
R1 = 100*R3;
R2 = 100*RDUT;
26 Chapter 2
% Eqns
VL = R2/(R1+R2); VR = RDUT/(R3+RDUT); % voltage dividers
Vdiff = VL-VR; % voltage difference between dividers
IL = Vbias/(R1+R2); IR = Vbias/(R3+RDUT); % I in each side
% Output
fprintf(‘Bridge voltages and currents\n’);
fprintf(‘VL = %3.1fV; VR = %3.1fV\n’,VL, VR);
fprintf(‘Vdiff = %3.1f V\n’,Vdiff);
fprintf(‘IL = %3.1fmA; IR = %3.1fmA\n’,IL*1000, IR*1000);
Results:
Bridge voltages and currents
VL = 0.5 V; VR = 0.5 V
Vdiff = 0.0 V
IL = 0.1 mA; IR = 5.0 mA
When the two voltage dividers have the same resistance values, the voltage
difference in the bridge is zero, and no current can flow even if a wire connects
the terminals. If that connection was made with a meter movement, such as an
old-style needle readout, a zero or null value will be shown when the two
voltage dividers are the same. Such a meter movement is shown in Fig. 2.5. In
the past, before everything went digital, all meters were based on magnets and
coils of wire. When a current passed through the wire, the needle moved in
relation to the amount of current. These meter movements with a center ‘zero’
Figure 2.5 The differential voltage can be displayed on an old-style meter movement.
Notice that this meter can swing to the left or right, depending on the current direction.
Common Electronic Circuits and Components 27
2.2 Diodes
Diodes are just about the simplest of the semiconductor devices used in
electronics. Diodes look a lot like resistors—little cylinders with wires sticking
out the end—but they don’t have a group of colored lines; most often they
have just one stripe located close to one end. There are several types of diodes
in use, but the diode rectifier is the most common and has the interesting
property of conducting current in only one direction and blocking it in the
reverse direction. Remember that stripe on the end? That is the indicator of
the direction of the current flow. Figure 2.6 shows the common symbols used
for rectifying a Zener diode when shown in a schematic. Notice that the
“bars” in the schematic and the “band” on the actual diode correspond.
There are different types of diodes, two of which are the rectifying diode
and the Zener diode. A common or rectifying diode passes current in only one
direction. A Zener diode conducts current just like the rectifying diode, but
once the voltage is reversed, it will conduct again after a specific voltage (the
Zener voltage) has been reached.1–3
Understanding how the rectifying diode operates is best illustrated by
considering its effects on a sinusoidal voltage signal. A sinusoidal voltage
varies about a zero reference point and has an average voltage of zero. This is
just a statement that because there is as much signal above as below the line,
when looked at over several complete cycles, on average the voltage has a
value of zero. We know from our previous calculations of power that if the
Figure 2.6 Schematic symbols for (a) a rectifying diode, (b) a Zener diode, and
(c) a general diode showing the location of the stripe. Notice that the arrows in (a) and
(b) point toward the bar and indicate the direction of current flow.
28 Chapter 2
voltage is zero then the power is zero! But we know this isn’t true, so how can
we get a good measurement? Since the diode only conducts in one direction,
putting a diode in the circuit will remove either the top or the bottom half of
the signal. If we average the signal now, it will be either positive or negative,
and we can get a measure of the magnitude!
Another excellent use for the diode is to convert AC voltages to DC
voltages. This most often involves a transformer, which uses inductance
between two wire coils to either raise or lower the voltage of an AC source.
We will look at transformers in the next section, but here we will just say that
they are useful tools for changing the amplitude of a voltage signal. Of course,
if one diode is good, could more be better? Figure 2.7 shows how a sinusoidal
Figure 2.7 Top: Two different diode rectifier types in one circuit. Bottom: Plot showing the
sinusoidal input signal (VAC is volts of alternating current).
Common Electronic Circuits and Components 29
signal can be changed in the presence of one and four diodes. Notice that the
full-wave bridge rectifier looks a lot like our previous Wheatstone bridge.
Notice that in Fig. 2.7 a vertical offset of 1 V has been introduced between
plots so that each waveform can be clearly seen. Output V1DC was generated
using a half-wave rectifier, and V2DC was generated by the full-wave rectifier;
there are some differences in their outputs.
You may have noticed that the rectified signal does not look much like a
steady DC voltage as there is still a lot of ripple in it. This is easily remedied by
placing a sufficiently large capacitor across the output terminals. The
capacitor accumulates charge as the voltage rises, and as the voltage level
drops, the amount of charge slowly decreases based on the load. Thus, the
output voltage waveform will be smoother than that of the input voltage. If
the fall in the voltage level is small over the period between cycles, a DC
voltage has been achieved with a small ripple voltage superimposed.
Diodes have another interesting quality when they are conducting: there
will be a voltage drop of about 0.7 V across the diode.3 If several diodes are used
in series, this voltage drop can easily be a few volts. While this is not always an
apparent plus, it does prevent a current from getting through the forward-biased
diodes unless it is above a certain threshold. We will revisit this point later.
Figure 2.9 A biased transistor circuit showing the arrangement of resistors used to bias
the device. Notice that both AC and DC sources are included in the circuit, requiring
capacitor C1 to isolate them. Note also that voltage +Vcc is the input voltage and, like VC
and VE, is measured with respect to ground.
In the switch mode, the transistor can be required to pass a large current
to ground, so transistors used in this mode usually have a heat sink attached
to help dissipate some of the heat that will be generated. It is also possible that
a general-purpose transistor might not be up to the task, and an upgrade to a
power transistor might be needed.
Let’s return for a moment to the transistor itself and how it is used, at least
under some simplified and somewhat ideal conditions. Consider an input
signal generated by a sensor that does not have much power. In fact, if we
draw a current from the sensor, the signal will be degraded and unusable. One
of the key differences between the BJT and MOSFET is that the gate of the
MOSFET does not require a current to control the drain-source current!
There are other differences as well, but in many cases, this is the useful
difference. The BJT and the MOSFET symbols and a physical model2,3 are
shown in Fig. 2.11.
The gate (G) of the MOSFET, which is similar to the base of the BJT,
controls the current from the source (S) to the drain (D) of the MOSFET. But
it does it by a field effect, i.e., an electrostatic effect. It does not draw a current
to operate. Both BJTs and MOSFETs are available for general-purpose use as
well as for power transistors, which will be explored next.
Figure 2.11 Schematic and physical models for BJT and MOSFET devices. Note that the
MOSFET can have four terminals, but usually the substrate and the source terminals are
connected.
to keep the transistor cool. Although not the best practice, I must confess that
I usually find that I need a power transistor when the general-purpose
transistor I originally selected overheats. Often this results in a puff of the
“magic smoke” escaping from the transistor, and we all know that it is very
hard to put the smoke back in, so a new transistor is needed. This approach
can be used when you are first developing an electronic circuit, but can be
catastrophic if left unattended. Transistors can get very hot!
The design paradigm for power transistors is to support the ability to
handle large currents and voltages. This means that the output resistance is
low, and that the transistor junctions are sized larger to better dissipate heat
and are insulated to work with higher voltages. This also usually means that
the transistor cannot operate at very high frequencies due to the capacitance
in the junctions. It is the actual junction temperature that is important for the
transistor, not the case temperature that we can feel. Sometimes, by the time
we notice that a part is becoming hot, the junction is too hot and the device
can be damaged, or its service lifetime can be greatly reduced.
Power transistors3 can often be identified by being larger than regular
transistors and often have either metal packaging or metal connectors on
them. It is true that not all transistors look alike and not all transistors
have three leads. Figure 2.12 shows three common transistor configurations,
two of which are commonly used for general-purpose transistors, and the
TO-220 configuration, which is is often used for power transistors. The power
transistor is designed to easily mount a heat sink using the hole in the
metal tab.
34 Chapter 2
Figure 2.12 Some different through-hole transistor packages and their associated pinouts.
This information is always provided on the transistor data sheets.
There are many packages for transistors, and in some ways these are a
study in themselves. In addition, the pinouts often vary between devices, so
you will always need to consult a data sheet for your particular device.
Figure 2.13 Power transistors in parallel. A low-power signal applied to the input can be
used to toggle a high-power load at power greater than that of the single resistor, or can be
used to reduce heating effects. This is an example of a current divider.
Common Electronic Circuits and Components 35
Figure 2.14 Transistors connected to form a Darlington pair, which can be constructed
from two separate transistors or be a single commercial transistor.
Resistors R1 through R4 are commonly the same value or can be tuned for
variations in the individual transistors.
Another technique is to connect two BJTs in a configuration known as a
Darlington pair.3 This configuration, shown in Fig. 2.14, uses the two
transistors to provide much higher current gain than each of the individual
transistors. Darlington pair transistors can be made from two separate
transistors or commercially as a single three-terminal device.
represented as 0-0-0; 0-0-1; 0-1-0; 0-1-1. There is space in our three-bit number
system to count higher, but we will hold here for now.
A three-bit number can correspond to three wires (okay, a ground will
be needed, too, so really four wires) that hold the information. Each line
can be toggled in a counting sequence to represent numbers. But what if
we want the number represented as a voltage? We can combine all of the
things we now know to generate a single voltage using only resistors.
The design of a simple three-bit digital-to-analog converter is shown in
Fig. 2.15.
The approach shown here is often called the R-2R resistor network,4 as
the circuit contains resistors of value R and 2 R. Since we are only interested
in the voltage values and are not trying to drive a load, resistor values are
normally chosen to be in the range of 100 kV and up. This circuit can be used
to drive a transistor, either a BJT or a MOSFET, to provide some buffering.
There is, however, a better tool that provides both buffering and
amplification. That tool will be the subject of the next chapter.
Answers
1. 6V
2. 0A
3. 50%
4. Use a power transistor of higher rating or use multiple general-purpose
devices in parallel.
5. 7 decimal, the maximum voltage value
References
1. B. Grob, Basic Electronics, Eighth Edition, McGraw-Hill, New York
(1997).
2. P. Horowitz and W. Hill, The Art of Electronics, Third Edition,
Cambridge University Press, Cambridge (2015).
3. A. S. Sedra and K. C. Smith, Microelectronic Circuits, Oxford University
Press, Oxford (2015).
4. T. L. Floyd, Digital Fundamentals, 10th Edition, Prentice Hall, Upper
Saddle River, New Jersey (2008).
Chapter 3
Linear Amplifiers
Electronic devices have come a long way since the invention of the transistor
in 1947 by Bardeen, Brattain, and Shockley.1 Before the transistor was
available, vacuum-tube-driven devices, now rarely seen, were the funda-
mental tools of signal amplification and rectification. The importance of the
transistor to electronics can be exemplified in the history of the popular
electronics device, the radio. Within a decade of its invention, radio designs
began to switch to using transistors, and by the 1970s, billions of these new
radios were manufactured, pushing out the older vacuum tube systems. The
original transistors were somewhat less than reliable devices, and their
failure rate kept the price of transistor radios rather high, even though only a
handful of transistors was used in the radio. While these modern radios were
highly inferior to the tube radios of the day, they did have a few advantages,
such as being smaller, portable, and able to turn on instantly! These
attributes made the transistor radio very popular, even if its audio quality
was not so great.
Today, we rarely talk about the number of transistors in an electronic
device, and in many commercial electronics, you might not even find a
discrete transistor. As manufacturers got better at making transistors, the
transistors got smaller, and the techniques of combining transistors to perform
complex tasks became commonplace. Current electronics can have hundreds
and even millions of transistors all contained in a single component, in what is
known as an integrated circuit (IC), or more commonly, a chip.
In fact, the more common, primitive (lowest-level) electronic device is
often an operational amplifier. An operational amplifier has many transistors
within it and provides high-performance amplification that is linear over its
operating range. Said another way, if we input a signal, we will get an output
signal that is linearly related to the input signal, just with different amplitude!
In this chapter we will expand on the idea of amplification and use
operational amplifiers, or op-amps, to develop circuits that are critically
important to working with sensors and transducers. These are all very
important tasks for optical engineers.
39
40 Chapter 3
V out RF
G¼ ¼ : (3.1)
V in RI
The ratio of the output voltage to the input voltage is also known as the
transfer function. In this case, the negative sign indicates the inverting
nature of the amplifier. RF is the feedback resistor, and RI is the input resistor.
Figure 3.1 Two different DIP operational amplifiers, one with 8 pins (left) and the other with
16 pins (right).
Linear Amplifiers 41
Figure 3.2 The inverting amplifier circuit using an operational amplifier (OA). The power
connections are shown here, although these are normally not shown on schematics.
Figure 3.3 A simple op-amp power supply made from 2 9-V batteries. This is not the most
elegant solution, but it works! Connect one terminal from each battery to each other to create
a common terminal between both batteries. Then the leads off of the remaining three
terminals will be +9 V and 9 V referenced to the common terminal.
42 Chapter 3
try to avoid the bipolar supplies, they really don’t cause all that much
trouble. It is also possible to make any op-amp work with a single power
supply; all that is required is to change the potential used for ground, which
is basically what we did by using two batteries. Operational amplifiers that
are designed to work with lower voltages and use a single, one-sided supply
are becoming more common, but we will use the dual-supply approach to
introduce op-amps.
Our purpose for using an op-amp is to linearly amplify a small signal into
a larger one; a very similar situation was seen in the last chapter on transistors.
Quite often this signal is time varying, which brings up one of the important
limitations of op-amps, the gain–bandwidth product. The gain–bandwidth
product (GBP) is a property of the device and is given in the data sheet as a
number that describes how much gain that particular device can use as a
function of the frequency of the signal being applied.1 The frequency is usually
referred to as a bandwidth, which is just the range of frequencies contained in
a signal. In our case, we are paying the most attention to the maximum
frequency in the signal. Typically, applications with smaller bandwidth (BW)
can use more gain. This relationship is shown as
GBP ¼ G BW : (3.2)
The GBP identifies the bandwidth that can be passed by a device at a gain of 1,
or unity gain. This can be most easily understood if we consider our inverting
amplifier with the resistors chosen to be identical so that the amplifier gain
is 1. If the amplifier has a GBP of 1 MHz, then the working bandwidth will be
1 MHz. A gain of 10 on the device will reduce the bandwidth to just 100 kHz
without causing the signal to distort.
The inverting amplifier has many excellent features, but one particular
drawback: it inverts the signal. This inconvenience can be fixed by placing two
inverting amplifiers back to back to restore the signal to match the input. In
such a case, the gain can be applied over two amplifiers, which can help with
the frequency response if it was being limited by the GBP; or one of the
amplifiers can be wired for unity gain as an inverting buffer. The downside to
this is that it requires space on the circuit board for two amplifiers, and more
power to drive them. Fortunately, this can also be accomplished using a non-
inverting amplifier configuration.
most noticeable operational difference is in the gain equation, which, for the
non-inverting op-amp is given as
V out RF
G¼ ¼ 1þ : (3.3)
V in RI
The gain relationship is not too different from the inverting amplifier, but the
negative sign is gone and a 1 has appeared. Thus, if the resistors have the same
value, the gain will be 2; if there are no resistors present, the gain will be 1.
Example 3.1 shows a script that calculates the gain for both the inverting and
non-inverting configurations.
Example 3.1
Write a MATLAB® script to calculate the operational amplifier gain for both
inverting and non-inverting configurations.
% Example_3_1.m
% SWT 12-6-15
% Housekeeping
clear all; clc;
% Resistors
RI = 100; % Ohms
RF = 10000; % Ohms
% Equations
Rf = 10000;
Ri = 1000;
Resistor_Ratio = Rf/Ri;
Gain_inv = -Resistor_Ratio;
Gain_non = 1 + Resistor_Ratio;
44 Chapter 3
% Output
fprintf(‘Amplifier Gain\n’);
fprintf(‘Resistor Ratio = %6.1f\n’,Resistor_Ratio);
fprintf(‘Gain for Inverting = %6.1f\n’,Gain_inv);
fprintf(‘Gain for Non-Inverting = %6.1f\n’,Gain_non);
Results:
Amplifier Gain
Resistor Ratio = 10.0
Gain for Inverting = -10.0
Gain for Non-Inverting = 11.0
Figure 3.5 The buffer amplifier, or unity gain configuration, for an operational amplifier.
When unity gain is desired, that is, a gain of one, setting the feedback resistor
to zero should work. Figure 3.5 shows the configuration of a unity gain or
buffer amplifier.
The buffer amplifier1–3 is a useful circuit to eliminate loading effects
that can be caused when trying to connect a device with high impedance to
one with low impedance, a situation that occurs with many sensors. Some
issues might need to be addressed when using buffer amplifiers connected
to capacitive loads. These issues are usually discussed in the device data sheet.
In this case, there are three different voltages and three different resistors
being combined to produce Vout, but this circuit can be altered to meet the
number of signals and their relationship.
The integrating amplifier1,2 is also an inverting amplifier and is easily
identified by the presence of the capacitor (C) in the feedback loop, as seen in
Fig. 3.7. If you recall, capacitors act as an open circuit for constant voltages
and act as a short circuit for high frequencies. The closed-circuit gain was
described earlier, but the open-circuit gain has not been mentioned. When
there is no feedback, an op-amp is designed to have very high gain, on the
order of 100,000 or 1,000,000. So at very low frequency, the integrator is
going to show a very high gain. This is often corrected by adding a resistor in
parallel to the capacitor so that this situation is avoided.
The transfer function for the inverting integrator, with both a capacitor
and a resistor in the feedback path, is shown as
Rf
V out 1
G¼ ¼ : (3.5)
V in RI 1 þ sCRf
Notice the sudden entrance of s in the equation. If you are familiar with
‘imaginary’ numbers, then you know where this is going; if you are not
familiar with them, this may be a bit confusing. The definition of s is jv, where
j is ( 1)1/2; v ¼ 2pf, where p is a constant; f is the frequency, which brings us
back to something familiar. We will touch on this again.
The circuit shown in Fig. 3.8 performs the mathematical operation for
producing the derivative of the input signal over time, so it is appropriately
named a differentiator. The gain for the differentiator circuit is
V out
G¼ ¼ sCRf : (3.6)
V in
Figure 3.9 Differential amplifier showing the two inputs, Va and Vb.
Linear Amplifiers 47
operational amplifier is that input signals that are common on its input don’t pass
through to the output, such that the output is driven by the difference between the
two inputs. Thus, the output for the differential amplifier is as shown as
R2 þ R1 R4 R2 yields R2
V out ¼ V V ! ðV V a Þ, (3.7)
R4 þ R3 R1 b R1 a R1 b
in the case where R4 ¼ R2 and R3 ¼ R1, so that the common mode voltage is
zero. Any difference between these resistor relations will introduce errors. Thus,
with careful choices of resistors, the difference relationship for this amplifier
becomes apparent.
Example 3.2
Write a MATLAB script to calculate the voltage output for a differential
amplifier based on the choice of four resistors.
% Example_3_2.m
% SWT 12-6-15
% Housekeeping
clear all; clc;
% Parameters
Va = 0.2; Vb = 0.1; Vcc = 15;
R1 = 100; R2 = 1000; % Ohms
R3 = 50; R4 = 1000; % Ohms
% Equations
Vo = (R2+R1)/(R4+R3)*R4/R1*Vb -R2/R1*Va;
if abs(Vo) . Vcc
fprintf(‘Error: Gain too high\n’);
end
% Output
fprintf(‘Vo = %6.1f\n’,Vo);
Results:
Vo = 0.000
48 Chapter 3
Example 3.3
Consider a differential amplifier with R3 ¼ 0.9 R1 and R1 ¼ 100; R2 ¼ R4 ¼
1000; and Va ¼ Vb ¼ 0.2 V.
Running these values in the calculator shows a voltage difference of
18 mV. If we substitute the relationships into Eq. (3.7), we find that
R2 þ R1 R2 R2 R2 þ R1 R2
V out ¼ Va ¼ 1 V ,
R2 þ 0.9R1 R1 R1 R2 þ 0.9R1 R1 a
11
V out ¼ 1 10 V a ¼ 0.092 V a ¼ 18 mV:
10.9
1
V out ðsÞ ZC sC
¼ ¼ 1
: (3.8)
V in ðsÞ Zc þ Z R RC þ sC
Linear Amplifiers 49
The ratio in Eq. (3.8) is not quite as simple as the resistor voltage divider but
not that much different, either. This is the expression of the transfer function
for the low-pass filter. If we apply some simple mathematical tools, this
equation can be reduced to the form
V out ðsÞ 1 1
HðsÞ ¼ ¼ ⇒ : (3.9)
V in ðsÞ sRC þ 1 jvRC þ 1
Figure 3.11 Bode plots for a low-pass filter using R ¼ 1 kV and C ¼ 1 mF. The 3 dB
points are shown as asterisks on the curves.
References
1. A. S. Sedra and K. C. Smith, Microelectronic Circuits, Oxford University
Press, Oxford (2015).
2. P. Horowitz and W. Hill, The Art of Electronics, Third Edition,
Cambridge University Press, Cambridge (2015).
3. “Op Amp Circuit Collection,” National Semiconductor Application Note
AN-31, National Semiconductor Corp., Santa Clara, California (2002).
Chapter 4
Useful Op-Amp Circuits
The previous chapter introduced operational amplifiers, which have become
the fundamental devices for constructing many electronic circuits. Op-amps
are constructed of a number of transistors, resistors, diodes, and capacitors on
a single silicon chip, resulting in their high reliability and low cost. But there is
much more!
Op-amps can be used as a single stage or with several of them chained
together, feeding the output of one to the input of the next. By clever selection
of the external components (often referred to as lumped components), and like
resistors, diodes, capacitors and inductors, operational amplifier circuits can
perform a wide variety of mathematic and logic operations or act as filters.
These useful circuits, made of op-amps and lumped components, are the focus
of this chapter. There are many manufacturer-complied resources, often called
application notes, for using op-amps. Some examples from Analog Devices,
Inc. and National Semiconductor, Inc. are included in the Bibliography.
The chapter begins with arguably the most useful operational amplifier
device, the instrumentation amplifier. Then we will explore several of the
different op-amp-based mathematical operation circuits.
53
54 Chapter 4
• bandwidth
• common mode rejection ratio
• power supply rejection ratio
Zero
• input offset voltage
• output impedance
• noise
While we commonly think of the ideal amplifier as meaning idealized, or a
pie-in-the-sky dream of an amplifier, what we are really saying is that this is
how we would like an amplifier to behave, and as engineers, we are actually
trying to achieve that level of performance.
Some of the properties listed above are more readily available than others,
and if we return to the differential amplifier, we can look at some designs to
improve its performance.
In Fig. 4.1, the differential amplifier can be clearly seen on the right side of
the circuit connected by resistors R1 and R2. The two additional op-amps on
the left side are configured a bit differently. If Rgain was infinite and the two
resistors R were zero, these would look a lot like unity gain voltage followers.
The great thing about the unity gain voltage follower, or buffer, is that it
provides the desired high input impedance. Things get a little more interesting
with the circuit when we allow the resistors in the buffers to take on more
realistic values. Their values can be determined by looking at the transfer
function for the instrumentation amplifier as shown:
V V0 2R R2
H¼ 0¼ ¼ 1þ : (4.1)
VI Vb Va Rgain R1
Figure 4.1 The instrumentation amplifier showing the modified input stages fed by two
voltages, Va and Vb.
Useful Op-Amp Circuits 55
Equation (4.1) shows that we would like to have the two resistors R be
the same and have them contribute to the overall gain of the system. It is
common to have nearly unity gain on the differential amplifier and to have
the R values be large with a low-resistance Rgain. While there are many
combinations that will give the R2/R1 unity, a typical value for both resistors
is 10 kV. Precision resistors can be expensive, so we can also make the
R values 10 kV. This leaves only the Rgain to select for the desired gain.
Example 4.1 shows how to tune the gain of the instrumentation amplifier by
adjusting the gain resistor.
Example 4.1
An instrumentation amplifier uses 10-kV precision resistors throughout and
controls the overall gain by manipulating Rgain. Plot the range of gains
available for this op-amp for 10 V , Rgain , 500 V.
Equation 4.1 reduces to
20000
GðRgain Þ ¼ 1 þ :
Rgain
This simplified equation, or even Eq. (4.1), can be used in MATLAB® to
generate the final result shown in Fig. 4.2.
The curve in Fig. 4.2 was generated using the MATLAB code4 in
Example 4.1.
Figure 4.2 The gain for the instrumentation amplifier with Rgain varied and all other
resistors at 10 kV.
56 Chapter 4
Example 4.2
Plot the gain of an instrumentation amplifier as a function of Rgain for R ¼
R1 ¼ R2 ¼ 10000.
% Example_4_2.m
% SWT 10-2-15
% Housekeeping
clear all;
clc;
% Mathematical function
R = 10000; R2 = 10000; R1 = 10000;
Rgain = 10:500;
H = (1+2*R./Rgain)*R2/R1;
% Plotting
clf;
figure (1); plot(Rgain, H);
set(gca,‘FontSize’,9,‘FontWeight’,‘Bold’,‘LineWidth’,2);
axis ([0 500 0 2000]);
xlabel(‘Rgain in ohms’); ylabel(‘Gain’);
Figure 4.3 The change in gain with the value of Rgain for the instrumentation amplifier
shown on a semilog plot.
Figure 4.4 The improved precision rectifier or superdiode circuit to make an “ideal” diode.
58 Chapter 4
negative and zero when the output voltage goes positive. Of course, this can
be inverted by including an additional inverting op-amp stage.
Figure 4.5 Two peak detector circuits. Left: A simple detect and hold circuit. Right: A more
advanced circuit with two reset switches, one a manual switch and the other an electronic
switch.
Useful Op-Amp Circuits 59
4.4 Oscillators
An electronic oscillator1,5,6 generates a periodic signal often in the form of a
square or sine wave. These signals are often used as a clock, a regularly
repeating signal that can be used to mark time. If we wanted to know the
maximum value of a signal every second, we could use the peak detector
circuit and make it so that the peak voltage was reset every second. This could
be done with the manual switch, but it would be much more practical to send
an electronic signal to the transistor reset switch once every second. There are
many ways to do this, but since we are working with op-amp circuits, we will
use an op-amp that we will configure to provide a signal pulse out every
second or have it act as an oscillator with a frequency of 1 s. An op-amp
oscillator is shown in Fig. 4.6.
The oscillation frequency will be controlled by the RC time constant set
up by the product of C1 and R1. A 1-s oscillation will require that this product
be 1. If we choose a large resistor, say, 1 MV, then we will need a capacitor
that is 1 mF to give the product of 1 s.
This is a very simplistic oscillator circuit; many enhancements to this
circuit are possible. Oscillators are such important devices in electronics
that specific devices commonly used for this purpose have been designed for
easy operation. The most common of these is the 555 timer. In addition,
crystal oscillators, based on the properties of a quartz crystal, can be used to
provide a clock signal; these devices are available over a wide range of
frequencies.
References
1. P. Horowitz and W. Hill, The Art of Electronics, Cambridge University
Press, Cambridge (2015).
2. C. Kitchin and L. Counts, A Designer’s Guide to Instrumentation
Amplifiers, Third Edition, Analog Devices, Inc., Norwood, Massachusetts
(2006).
3. A. S. Sedra and K. C. Smith, Microelectronic Circuits, Oxford University
Press, Oxford (2015).
4. H. Moore, MATLAB® for Engineers, Fourth Edition, Prentice-Hall,
Upper Saddle River, New Jersey (2014).
5. “Op Amp Circuit Collection,” National Semiconductor Application Note
AN-31, National Semiconductor Corp., Santa Clara, California (2002).
6. J. Wong, “A Collection of Amp Applications,” Application Note
AN-106, Analog Devices, Inc., Norwood, Massachusetts (undated).
Chapter 5
Digital Electronics
Digital devices and computers dominate the information world around us,
and digital electronics drives much of the consumer electronics market. Most
of our displays, information sources, and communications all involve digital
electronics. However, the sensors and amplifiers used to interrogate and
investigate physical phenomena are based solidly in analog electronics, so
moving the data collected by the sensor into a computer requires conversion
into digital form.
Digital electronics is based on digital logic; i.e., it represents information
digitally as specific combinations of 1s and 0s. There are three basic logic
functions that can operate on binary numbers: AND, OR, and NOT. You
might think that with such a limited array of variations, digital logic would
not have much use, but you will quickly see that there are many constructs
possible in the digital logic world, and they are all based on these three
operations. Digital logic can be implemented in many ways by using a wide
range of electronic devices, including discrete components, field programma-
ble gate arrays, microcontrollers, and more.
This chapter provides a short overview of digital electronics and a
somewhat fast-paced look at what can be accomplished using these diverse
tools. Many books on digital electronics are available, should you need more
information; here we will be looking at the high points and staying aligned to
areas of interest to optical engineering.
63
64 Chapter 5
base of 10, as if we are counting. There are many bases; for instance, binary
numbers use base 2, and hexadecimal numbers use base 16. One thing that
always causes issues is deciding what our starting number is: Is it a zero or a
one? All of this will become clear in a moment.
We will first introduce a formalism for representing numbers so that we
can easily change between representations. In this section we will be specific
about the base we are using to represent a number. In our everyday world, we
use base 10 numbers. If we show this explicitly, the number 5 in base 10 form
will be written as 510. When we write 510 as binary it becomes 01012. Here the
1s and 0s are in a specific order, and this value is shown as a four-bit number.
Thus, we have two ways to represent a number, and we need a means of
converting between them. When we count in base 10, we increment the
numbers by 1 until we reach 9, and then we start the count again but add 10 to
the value. In binary representation, there are only two values, 0 and 1, and
then you add a 1 to the twos column and continue the count. A look at
Table 5.1 should make this clear. We will go through the process for 16 values
so that we can compare base 10, base 2, and base 16 numbers.
The basic relationship used for converting between base 2 and base 10
numbers is shown as
Here, MSB is the most significant bit, the bit that is the leftmost; LSB is the
least significant bit, the bit that is the rightmost. So the four-bit number 1000
Example 5.1
Write a MATLAB® script to convert the number 105 into binary,
hexadecimal, and base 12.
% Example_5_1.m
% SWT 12-12-15
% Housekeeping
clear all; clc;
% Parameters
myNumber ¼ 105; % Number to be converted
myBase ¼ 12; % The base for conversion
Results:
Binary: 1101001
Hexidecimal: 69
Base 12: 89
Figure 5.1 The configuration of diodes and resistors to make a logical AND device. Vdoor
and Vgate are 0 if they are open and 1 if they are closed.
68 Chapter 5
same fashion. As such, as long as either the gate or the door is open, the
signal at Vdecision is 0.
The instrument that is using this logic device will see a high voltage signal
at Vdecision only when both doors are closed; this will be the condition when it
can operate. When either (or both) the door or gate is open, the voltage across
the diode will connect to ground, resulting in a low voltage being seen at the
output Vdecision, and the instrument will not turn on.
It can be very clumsy to make your own gates every time they are wanted,
so the electronics industry manufactures a wide range of logic devices.
Discrete components are ICs that have several logic devices on them and
typically have the designation 74XX. In the series, the 7400s are logic devices
with the designation NAND, which stands for NOT AND. We can translate
Table 5.2 by flipping the bit state in the AND column for the same inputs. The
7402 device is a NOR, 7404 is a NOT, and 7408 is an AND. Figure 5.2 shows
three common electrical device logic symbols.1,2
The interlock example is only one of many applications for logical
decision making and just begins to show the value of using electronic logic
devices. This example also shows some of the connectivity of binary logic to
analog electronics. When we consider that modern microcontrollers and
computers are composed of billions of such logic devices, it should become
clear that we are just brushing the surface. MATLAB can be used to
effectively perform logical operations5 and display the answers, as shown in
Example 5.2.
Figure 5.2 Logical symbols for AND, NOT, and NOR. The NOT symbol shows a buffer, the
triangle, with a small circle at the end. The small circle indicates that the output takes the
opposite value. The small circle placed on the OR symbol converts it to a NOR.
Digital Electronics 69
Example 5.2
Make a calculator to convert two sets of numbers A ¼ (1 0 1 0) and B ¼ (1 1 0 0)
into their AND, OR, and XOR sets.
% Example_5_2.m
% SWT 12-12-15
% Housekeeping
clear all; clc;
% Parameters
A ¼ [1 0 1 0];
B ¼ [1 1 0 0];
% Conversions
C ¼ A & B; % logical AND
D ¼ A | B; % logical OR
E ¼ D & C;% logical XOR
% Output
disp(C)
disp(D)
disp(E)
Results:
C: 1 0 0 0
D: 1 1 1 0
E: 0 1 1 0
Figure 5.3 Set-reset (S-R) latch constructed from a pair of cross-connected NOR gates.
The bar over the Q is another indication of the NOT condition.
operates by using the inputs, S and R, to change its outputs, Q and NOT-Q,
shown in the figure with a bar over the Q as Q. � The outputs are a
complementary set of Q and Q � being either 1 and 0, or 0 and 1. There can be
issues during the power up of the electronics such that the initial state is not
known; we will address this issue later.
The operation of the S-R latch is best demonstrated by example. Consider
the case where S ¼ R ¼ 0 on startup and the initial output state is (Q, Q) � ¼
(1,0). We need then to look at how the outputs cross connect to the inputs.
Notice that the output Q that connects to the second input of the S latch must
be high, i.e., have the logic state 1. Since the S NOR gate has a 1 and a 0 the
result should be that the Q � output will be 1. This forces the second input on
the R latch to be 1 driving the Q output to be a 0. This is consistent with the
initial state of the inputs and outputs.
Changing the output state requires that the set input S be raised to a high
value or 1. When S ¼ 1, the S NOR gate changes its output state to 0,
� ¼ 0, which forces the R NOR gate to have both inputs be 0 and drives
i.e., Q
Q ¼ 1. As this has set the second input on the S NOR gate to high, even if the
S input goes to zero, the S-R latch will stay in the same state. Resetting the
latch then requires momentarily applying a high value to the R input to reset
the outputs.
The condition S ¼ R ¼ 1 is known as a forbidden condition, as it would
require that both NOR gates output a zero state, which cannot be supported.
When power is applied to the S-R latch, the state of the outputs can be
difficult to predict. The starting state can depend on how signals propagate in
a circuit, creating a race condition where it is unknown which signal will
arrive first. This has resulted in the S-R latch being a very important structure
in electronic circuits but most often combined with additional logic to ensure
proper operation. This next step up in complexity is to make the S-R flip-flop
shown in Fig. 5.4.
Digital Electronics 71
Figure 5.4 Clocked, or enabled, S-R flip-flop circuit. When the enable (E) line is high, the
signals from R and S can pass to the S-R latch.
The S-R flip-flop1 is a very simple modification to the S-R latch but is
used here to introduce a very important electrical connection present on many
electronic devices, the enable input, shown as E. The enable line allows inputs
to a circuit to be disabled or blocked from being used by an external signal.
Depending on the device, the enable line can be configured to be active when
it is in the high or the low state, so it is necessary to carefully review the data
sheets to know how to correctly operate it. In Fig. 5.4 the enable line must be
raised high before the R and S inputs can be used.
The J-K flip-flop will be our final stop on the journey and is arguably the
most usable of the basic flip-flops. It is essentially our S-R flip-flop with the
S ¼ R ¼ 1 state no longer undefined; now, S ¼ R ¼ 1 has the defined role of
changing the state of the output. There are a number of different types of flip-
flops known as the T flip-flop, D flip-flop, and our earlier S-R flip-flop. Each
of these flip-flops can be constructed from the J-K flip-flop (Fig. 5.5).
Now that we have looked at flip-flops, it is time to show them performing
a task. One of the uses of a collection of flip-flops is to make a binary counter.
Since we have been looking at binary numbers, this could be a useful
application. A simple four-bit binary counter1,2 can be constructed using four
flip-flops connected as shown in Fig. 5.6.
There is a great deal of power in MATLAB5 when its built-in vectorization
properties are used. The ripple counter, so named because of the manner in
which the values move across the components, is a means of counting in
binary. The counting process can be easily implemented using a loop control
statement such as a for5 command to step through the various values.
However, if we just want to get a collection of the binary values that result from
the ripple counter, we can calculate these in a very compact way using the
Figure 5.5 D-type and T-type flop-flops constructed from the J-K flip-flop.
72 Chapter 5
Figure 5.6 A four-bit binary ripple counter constructed from J-K flip-flops. The clock
frequency appears on the leftmost LED as half of the frequency, and each consecutive LED
continues to divide the signal by 2. All of the J and K inputs are tied to high (logic value 1).
Example 5.3
Construct the output of a four-bit ripple counter similar to that in Fig. 5.6.
% Example_5_3.m
% SWT 12-12-15
% Housekeeping
clear all; clc;
% Parameters
n ¼ 16; % Number of values to be converted
dec2bin((0:n-1))
Results:
000
001
010
011
100
101
110
111
Digital Electronics 73
5.5 Microcontrollers
Microcontrollers range from the simple to the extremely powerful and are
now being used in commercial products everywhere from kitchen appliances
through to automobiles. The reason for their popularity is twofold: (1) they
have the flexibility to make changes through uploading software and (2) they
are designed to easily integrate with other electronic hardware. This makes it
possible for the same microcontroller to be used in many applications with
only changes to the hardware. The fact that these devices are becoming very
affordable is also certainly helping their popularity.
There are numerous microcontrollers on the market today with some that
are popular among manufacturers and some with one-off instrument makers
and the hobbyist community. One microcontroller that you might have heard
of is the Arduino.7 Arduino is an open-source computer company that creates
both hardware and software products. The actual chip being used is an Atmel
Corp. processor that is combined with an array of digital and analog pins and
that can be accessed in a very simple fashion. The normal means of connecting
these to hardware is via expansion boards that plug into the base single-board
microcontroller.
The biggest challenge for many instrument builders in using microcon-
trollers is that you need to learn how to write programs, as microcontrollers
run programs. This is not overly difficult, but if you are a beginner to
programming, it can take some time to gain proficiency.
Whether you construct electronics from discrete components or move to a
microcontroller depends mostly on the designers’ preferences and whether the
selected electronics can operate fast enough to keep up with the changing
signals to make everything work. As a general statement, you can do
everything in the microcontroller world that you can do in the analog world,
just slower if you stay within the same cost ranges. Where the microcontroller
really shines is when you want to read voltages, make decisions, store data,
and control some outputs, and you want to do it fairly inexpensively.
Many books and Internet sites are dedicated to microcontrollers and
Arduino products, in particular. It is sufficient for our purposes here to show
that we can do some simple things with the microcontroller as well as some
more complicated tasks.
Using a microcontroller is really straightforward once you know what all
of the pins do, or can do. Many microcontrollers have pins to move analog
voltages in, or to move digital values either in or out of the device. Once
you know how to write or read to a pin, most programs are just collections
of these events. The programming language is somewhat specific to the
Digital Electronics 75
Sample Program
Arduino program to write to an analog pin and read it through a different
analog pin.
/*
adcArduino
SWTeare, NMT, 10-2015
Read and ADC channel and report number.
*/
// Variable list
int analogPin ¼ 3;
int valPin_3 ¼ 0;
// Setup:
void setup() {
Serial.begin(9600);
analogWrite(analogPin,25);
}
Serial.println(valPin_3);
}
The Arduino program provided above is divided into three main parts: the
definitions held in the variable list; the setup, a section of code that is read and
executed just once; and a loop that runs the code in that section over and over
again. This program lets the output of one pin be read by another. You will
notice that there is a command Serial.println(). This command sends
information to a second computer connected through a USB cable. In this
way the data gathered at the Arduino can be logged on the computer,
recorded, and analyzed as needed.7
The value of the microcontroller in modern electronics cannot be over-
emphasized. A single microcontroller can greatly reduce the number of
external logic components and can be reconfigured with a software change far
more easily than replacing hardware. In many ways microcontrollers such as
76 Chapter 5
the Basic Stamp, Arduino, and Raspberry Pi have made electronics accessible
to a wider range of scientists, engineers, and hobbyists than ever before.6,7
These low-cost devices are a simple and convenient way to introduce complex
control and logic into a system with very little work required for parts
assembly.
References
1. T. L. Floyd, Digital Fundamentals, 10th Edition, Prentice Hall, Upper
Saddle River, New Jersey (2008).
2. J. F. Wakerly, Digital Design, Principles and Practices, Fourth Edition,
Prentice Hall, Upper Saddle River, New Jersey (2005).
3. P. Horowitz and W. Hill, The Art of Electronics, Third Edition,
Cambridge University Press, Cambridge (2015).
4. A. S. Sedra and K. C. Smith, Microelectronic Circuits, Oxford University
Press, Oxford (2015).
5. H. Moore, MATLAB® for Engineers, Fourth Edition, Prentice-Hall,
Upper Saddle River, New Jersey (2014).
6. A. Lindsay, What’s a Microntroller? Student Guide, Version 2.2, Parallax,
Inc., Rocklin, California (2004).
7. T. Karvinen, K. Karvinen, and V. Valtokari, Make: Sensors: A Hands-On
Primer for Monitoring the Real World with Arduino and Raspberry Pi,
Maker Media Inc., Sebastopol, California (2015).
Chapter 6
Instrumentation, Signal
Conditioning, and Filters
Several chapters back, we began with the basic components used in electronics
and then moved to exploring analog and digital electronics, and processing
electrical signals. We can now begin to convert this understanding of basic
electronics into an ability to design and plan more complicated instruments.
Even the most complicated instruments are made up of simpler instruments
and electronic circuits, so this will serve to bring more detail to our discussion
of electronic instrumentation.
The instruments we will look at in this and future chapters are generally
involved in performing sensing tasks and then processing that signal into the
data we are interested in analyzing. In many scenarios, the input signal will be
noisy or difficult to separate from other signals, meaning that a conditioning
task will be needed. In optical engineering, we can make use of optical filters
or gratings to separate specific light channels before the light reaches the
detector. Once the light has been converted by the detector into an electrical
signal, other techniques will be needed to improve the signal quality. Since our
expertise is in working with the optical signals, we will focus here on the
electrical side of the signals. While it is common to think of filters as being
analog devices, and we will start there, the advent of digital signal processing
has made it possible to use a wide range of mathematical functions available
for use on signals.
In this chapter we will concentrate on electronic signal conditioning and
filtering, and relating this to generic instrument design. The filters will include
both analog and digital circuits, and some of the underlying concepts will be
introduced as well. There is a great deal of literature on electronic filter
systems, and it is common for electrical engineering programs to devote
several courses to the topic.
79
80 Chapter 6
6.1 Instrumentation
There are many ways to design and construct an instrument, depending on
whether the instrument is being constructed as a one-off system for use in a
controlled laboratory, or for large-scale production. Whether the instrument
will be used in the field can also change how the internals of an instrument are
organized. For this discussion, we will consider the signal-detection side of the
instrument, as shown in Fig. 6.1, and ignore the complications of feedback
controllers or actuators. Should these be required, it is usually not difficult to
envision where the extra pieces would need to sit.
The division between the analog and digital sides of the signal-processing
chain can become very blurred in an actual instrument, but this division is
quite useful for instructional purposes. Every stage of the block diagram
provides some level of signal conditioning, but we will go through the purpose
of each stage one by one.
Signal of Interest: This is the information that we are interested in. Some
examples for this could be an optical communication signal, an
astronomical source such as a star, or so forth.
Signal Conditioning: This could be a telescope, optical filter, lens system,
or fiber optic used to gather some fraction of the signal of interest.
There can be many optical components in the chain, including
polarizers, gratings optoelectronics, and optomechanical devices.
Figure 6.1 Block diagram of an instrument showing the division between the analog and
digital side, illustrating the signal-processing chain from incoming signal to final data.
Instrumentation, Signal Conditioning, and Filters 81
Sensor: The most basic optical sensors include photodiodes and cameras.
The sensor can be a very intricate system, but by the end of the chain, it
has become a transducer that converts optical energy to electrical energy.
Pre-amplifier: The sensor’s electrical output might not be very high or
might not have the ability to generate the current needed for full
amplification, so an intermediate amplifier, potentially a transistor or
operational amplifier, is needed to ensure that the signal is not degraded.
Amplifier: This is the more classic amplifier and will most often be a single
op-amp or a combination of op-amps.
Analog signal processing: This is a stage where the analog signal is
analyzed and unwanted information can be removed to isolate the
signal of interest. This is commonly done with analog filters.
Analog-to-digital conversion: The signal is discretized, and often consider-
able information is thrown away.
Digital signal processing: This is a stage in which the digital signal is
analyzed and unwanted information can be removed to isolate the signal
of interest; alternatively, mathematical operations can be performed,
which can include digital filters.
Data: The information that is desired has been distilled and is available for
storage on a computer or other digital recording device.
Many of the components identified in Fig. 6.1 have been introduced in
earlier chapters. In this chapter we will look at some of the key elements of
analog signal processing, both passive (using inductors, capacitors, and
resistors) and active, involving the use of operational amplifiers. This will then
be leveraged to introduce some of the elements of digital filters.
Figure 6.2 High-pass and low-pass filters connected to an alternating input signal.
If we stare at the circuits in Fig. 6.2 for a bit, it should become clear that
they look very similar to the voltage divider circuits we looked at in an
earlier chapter. But rather than two resistors, we have a resistor and a
capacitor. If we call resistors, capacitors, and inductors by their generic name
of impedances Z, we can write the voltage divider as
V out Z1
HðvÞ ¼ ¼ , (6.1)
V in Z1 þ Z2
where v is the angular frequency.
In the case of a resistor, Z ¼ R. Capacitors have a frequency dependence
so are a little more complicated, and Z ¼ 1/jvC, where j is ( 1)1/2. This leads
to the two equations
R jvRC
H HP ðvÞ ¼ 1
¼ , (6.2)
R þ jvC jvRC þ 1
1
jvC 1
H LP ðvÞ ¼ 1
¼ : (6.3)
Rþ jvC
jvRC þ 1
In general, we are interested in the magnitudes for these values, and the
magnitude of an imaginary number is the square root of the sum of the
squares of the real and imaginary parts. This reduces Eqs. (6.2) and (6.3) to
1
jH LP ðvÞj ¼ pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ,
ðvRCÞ2 þ 1
vRC
jH HP ðvÞj ¼ pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi : (6.4)
ðvRCÞ2 þ 1
These equations can be best appreciated in the format of a Bode plot, as
shown in Fig. 6.3.
The Bode plots shown in Fig. 6.3 clearly show the reason the filters are
named as they are; the top plot shows that the low frequencies are allowed to pass
until the cutoff frequency is reached, then the output starts to degrade, so this is a
low-pass filter. The bottom plot shows the high-pass filter, which attenuates the
Instrumentation, Signal Conditioning, and Filters 83
Figure 6.3 Bode plots comparing the transfer functions of the low-pass filter (top) and
high-pass filter (bottom). In each case the same capacitor and resistor values are used, so
the cutoff frequency, shown as a vertical solid line, is the same in both plots.
low frequencies but allows the higher frequencies through. Example 6.1 shows
the calculator used to generate the Bode plots in this section. These plots are also
a little more complicated than the ones we have been using, so the example
provides an introduction to some useful MATLAB® commands.5
Example 6.1
Make a MATLAB script that will calculate the Bode plot for a first-order
high- and low-pass filter using a 1-mF and 1-kV resistor. Show the location of
the cutoff frequency.
% Example_6_1.m
% SWT 10-21-15
% Bode plots of high pass and low pass passive filters
%% Housekeeping
clear all; clc;
%% Input values
C ¼ 1e-6; % capacitance in Farads
R ¼ 1000; % resistance in Ohms
maxFreq ¼ 1e4; % maximum frequency to scan in Hertz
84 Chapter 6
%% Conversions
f ¼ 1:maxFreq; % creates a vector of frequency values in 1 Hz
steps
omega ¼ 2*pi*f; % calculates the angular frequency
cutOff= 1/((2*pi*R*C).*(2*pi*R*C));
disp(cutOff);
subplot(2,1,2);semilogx(f,dB_hp);hold on;
line([cutOff,cutOff], [-60,10],‘Color’,‘r’,‘LineWidth’,2);
axis([1 maxFreq -60 10])
grid on;
xlabel(‘Frequency (Hz)’)
ylabel(‘dB’)
title(‘High Pass Filter’);
set(gca,‘FontSize’,9,‘FontWeight’,‘Bold’,‘LineWidth’,2);
hold off;
Instrumentation, Signal Conditioning, and Filters 85
Figure 6.4 Linear plots comparing the transfer functions of the low-pass filter (top) and the
high-pass filter (bottom). In each case the same capacitor and resistor values are used, so
the cutoff frequency is the same in both plots.
The best way to understand the new commands shown in the above
example is to use the built-in MATLAB help and the MATLAB website.
It takes a little bit of thought to figure out the information using a Bode plot,
so Fig. 6.4 shows how the filter outputs look in linear form.
The linear plots show that the simple first-order filters we are looking at
have a very soft turn-on or roll-off with frequency. In some cases it would be
desirable to have these be steeper. This can be accomplished by adding an
additional stage to the filters, such as the second-order filters shown in Fig. 6.5.
The cutoff frequency of the filter is defined as the 3-dB point of the filter,
i.e., the point where output drops by 3 dB from its maximum. This point will
occur when the frequency is 1/2pRC for a first-order filter.
The corresponding Bode plots for these filters are shown in Fig. 6.6.
Notice that the effect of having two identical stages is to improve the rate at
which the filter cuts off or turns on.4 The introduction of the second stages
changes the transfer functions from those shown in Eq. (6.4) to
1
jH LP ðvÞj ¼ pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ,
½ðvRCÞ þ 1½ðvRCÞ2 þ 1
2
ðvRCÞ2
jH HP ðvÞj ¼ pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi : (6.5)
½ðvRCÞ2 þ 1½ðvRCÞ2 þ 1
86 Chapter 6
Figure 6.5 Circuits showing the second-order high- and low-pass filters.
Figure 6.6 Circuits showing the second-order high- and low-pass filters.
The process of adding more resistors and capacitors can continue, but it is
often more effective to move from working with passive components to active
components. This is another way of saying that we return to the use of
operational amplifiers.
Instrumentation, Signal Conditioning, and Filters 87
Figure 6.9 Transfer functions for a bandpass filter showing the lower and upper frequency
limits to the bandpass, the bandwidth, and the quality factor value Q.
Figure 6.10 The stair-step function associated with quantization effects in ADCs. The
steps represent the digitization of the continuum of the points.
Figure 6.11 A noisy signal (shown as dots) and its postprocessed filtered form (smooth
line) compared to the true signal (dashed line).
MATLAB and import them directly and use them. This greatly simplifies
their use but does require some matching of software and particular boards.
While a detailed look at DSPs will require looking into another more
specific book on the subject, we can demonstrate the use of digital filters on
some noisy digital data to show what they can do. The simplest filter we can
make is a smoothing or averaging filter as described by
yi 1 þ 2yi þ yiþ1
Fi ¼ : (6.7)
4
To understand Eq. (6.7), it is simplest to consider a dataset of numbers y.
Each of the individual values in the set are numbered y1, y2, . . . , yN. As long
as we are far enough into the dataset, we can generate the filtered data set F.
By “far enough” it is meant that we have to have data for all three elements. If
we start at the index 2, then y2–1 ¼ y1. So when we filter data this way, we have
to throw out the first and the last points. The power of this filter to smooth out
a noisy signal is shown in Fig. 6.11.
The result of this filter is not a perfect recovery of the original signal, but
the effect of the noise is reduced. A wide array of filter types and combinations
of weighting factors is available, some of which will work better than others
for particular data sets.
Figure 6.12 A DC signal with a random noise component superimposed (top) and the
noise represented by a histogram (bottom).
purpose is to condition the signals for use. This is the point where we will talk
a little bit about noise, its characteristics, and how things should look.
The typical noise source will contribute Gaussian noise to your signal.
Gaussian or normally distributed noise is random noise, and we can reduce
its contribution to our signal in several ways. The easiest noise signals to
work with are additive noise; i.e., the signal we want has had a noise value
added or superimposed onto it. This is illustrated in Fig. 6.12, which shows a
DC value with a random noise signal on top of it. The original signal is just
the DC value of zero, so the width of the signal is strictly due to the added
noise.
A line drawn as an envelope to the histogram would take the shape of a
normal distribution or a Gaussian shape. This is described as
1 ðx mÞ2
I ðxÞ ¼ pffiffiffiffiffiffi e 2s2 : (6.8)
s 2p
The value s describes the width of the distribution, and m its center or
average. This is the same equation as was used to generate Fig. 6.9.
Removal of the noise component from a signal is a study on its own, and
there are many techniques for doing this. We will explore a couple of
techniques later, but one of the simplest is to use a low-order fitting function
92 Chapter 6
to determine the trends in the data. Subtracting out the low-order fit from the
data, if successful, will leave the data centered around zero, allowing the noise
component to be analyzed, and the fit will now represent the true signal.
References
1. B. Carter and T. R. Brown, “Handbook of Operational Amplifier
Applications,” Application Report SBOA0921, Texas Instruments, Inc.,
Dallas, Texas (2001).
2. P. Horowitz and W. Hill, The Art of Electronics, Third Edition,
Cambridge University Press, Cambridge (2015).
3. T. Kugelstadt, “Active Filter Design Techniques,” Chapter 16 in Op
Amps for Everyone, R. Mancini, Editor, Texas Instruments, Inc., Dallas,
Texas, pp. 261–323 (2002).
4. A. S. Sedra and K. C. Smith, Microelectronic Circuits, Oxford University
Press, Oxford (2015).
5. H. Moore, MATLAB® for Engineers, Fourth Edition, Prentice-Hall,
Upper Saddle River, New Jersey (2014).
6. “Op Amp Circuit Collection,” National Semiconductor Application Note
AN-31, National Semiconductor Corp., Santa Clara, California (2002).
Part II: Optics Applications
Safety Warning
Always wear safety glasses when working on or around electronic circuits and
follow all equipment and component manufacturers’ safety instructions.
Circuits included in these chapters may not be suitable for a particular
application.
Chapter 7
Solar Cells and Rechargeable
Batteries
Electronics systems rely on power, and for most portable systems this will be
provided by batteries, and quite often these will be rechargeable batteries. We
can take portable power systems a step farther by using solar cells to provide
the operating power or to recharge the batteries. Solar energy conversion is
not all that efficient and can be affected by the sun’s position in the sky,
shadows, and clouds; however, there is often plenty of light energy available
for small solar cells used in charging small batteries, storage capacitors, or
driving low-power systems.
Recharging batteries is a complicated subject, and each manufacturer and
type of battery can require different charging profiles, i.e., how the voltage
and current are balanced over time.1 Most manufacturers provide very
detailed information about how to optimally charge their batteries, and
electronics manufacturers have responded with specific ICs that have been
developed to provide the correct charging profiles.2,3 The variations in the
needs of different types of batteries make it important that you check with the
manufacturers of the specific components to ensure that the batteries are not
damaged when recharged. This becomes particularly important when fast
charging batteries.1
In this chapter we will be concentrating on the generation of electrical
power using solar cells, and using this to charge batteries and provide power
to other electronics devices and instruments.
95
96 Chapter 7
Figure 7.1 A simple description of a solar cell showing electrical and optical features. Light
enters through the top antireflection coating.
Figure 7.2 A simple charging system (top) that will provide a low-current charge rate
depending on the size of the resistor R selected. An improved design (bottom) includes a
voltage regulator (REG).
control the charging rate so that it does not damage the battery. The latter
varies depending on the physical and chemical makeup of the battery.1
where IS is the diode saturation current, kT/q, the thermal voltage is 25.9 mV
at room temperature, and IL is the current through the load. This equation is
Solar Cells and Rechargeable Batteries 99
Figure 7.3 The current–voltage profile for an ideal solar cell. ISC is the short-circuit current,
and VOC is the open-circuit voltage.
plotted in Fig. 7.3 for a load current of 100 mA and a diode saturation current
of 1 nA. Two points on the curve need to be identified: VOC, which is the
open-circuit voltage, representing the voltage when there is no load attached,
and ISC the short-circuit current, where the output of the solar cell is
connected together. The plot is shown as an inversion around the voltage axis,
the typical representation of the information. The selection of an appropriate
load will allow about 80% of the power given as the product of ISC and VOC to
be available for use. Usually this is described by a power rectangle that can be
inscribed within the curve that defines the maximum voltage and current for
the cell.
The efficiency of the solar cell is defined in the equation below, where FF
is given as the ratio of the areas of the ImVm versus ISCVOC:
F F I L V OC
Efficiency ¼ , (7.2)
Pin
Example 7.1
Plot the current–voltage profile for a solar cell.
%% Example_7_1.m
% SWT 10-21-15
%% Housekeeping
clear all; clc;
%% Parameters
Temp_C = 25; % Operating temperature
IL = 100e-3; % Load current
Is = 1e-9; % Saturation current
n = 1; % Ideality
k = 8.617e-5; % Boltzman’s constant
%% Resistances
Rs = 0; % series resistor value in ohms
Rsh = 5; % shunt resistor value in ohms
%% Coversions
T = 273+Temp_C; % convert to Kelvin
kT_q = k*T; %
%% Plotting
figure(1)
plot(V,-I)
axis([-0 .5 0 .12])
grid on;
xlabel(‘Voltage (V)’);
ylabel(‘Current (A)’);
text(.44,0.0025,‘Voc’);
text(.01,0.105,‘Isc’);
Figure E7.1 The battery voltage is depicted as the solid line with circles, and the recharging
cycle is depicted as a bar chart, showing the effect of cloudy days on the battery level.
Figure 7.4 A simple two-cell battery charger using a solar panel and a blocking diode.
102 Chapter 7
battery from flowing back into the solar cell when the sun is no longer shining.
Without the diode, the newly charged batteries would discharge through the
panel, undoing all the work of charging them. A blocking diode7,8 is really
nothing special; a regular 1N4001 diode will work just fine as long as it works
within the power range you are generating. In the circuit in Fig. 4.7 we are using
a solar panel that produces a fairly low amount of current at a voltage above the
battery pack voltage so that we are well below the rated current of the batteries.
This particular charger would take many hours to charge even small
batteries, as even in full sunlight, which has a rating of 1000 W/m2, the small
size of the solar panel, say 5 cm per side, would be illuminated by only 25 W
of sunlight. Typically, there is going to be less than the maximum amount of
sunlight available, maybe only 80%, so that only 20 W are available for use.
With a 10% efficiency solar panel, this will give only 2 W of power for use. If
we need 4 V to exceed the charging voltage of the battery, only 500 mA of
current is available for charging the battery pack at the maximum. If we
consider that each day there might be only 4 hr of high-quality charging time,
a battery pack with 5000-mA-hr capacity will take nearly 3 days to recharge.
However, these are very specialized devices and are somewhat complicated to
construct into battery chargers, but are well worth the effort to ensure that
batteries are both charged fast and have a long life.
You may be getting the idea that there is a lot more to making an effective
battery charger that you first thought, and this is very much the case. The
circuits used for battery chargers are becoming battery management systems,
and as batteries become more sophisticated in their operation and more
important to their devices, it becomes more important to get the best lifespan
from them as possible.
monocrystalline solar panel for about $150 as of the writing of this book. Such
a panel is about 1.5 in. (3.8 cm) thick and about 8 ft2 or ¾ m2 in area. The
power ratings are VOC ¼ 22.5 V, ISC ¼ 5.75 A, with the optimum values being
18.9 V and 5.29 A for a power output of 100 W, as stated earlier. Of course, if
more power were desired, additional panels could be incorporated into the
collecting area.
The battery capacity is 100 A-hr with a voltage of 12 V for energy of
1.2 kW-hr. If we consider that the available sunlight per day is 4 hrs and it is at
80% of the optimal intensity, then there will be 100 0.8 4 ¼ 320 W-hr of
energy that can be returned to the battery each day. This is about 320/1200 or
just over ¼ of the energy in the battery. If we are powering a light source that
requires 10 W to operate for 10 hr per day, we need 100 W-hr of energy per
day. If we can restore 320 W-hr per day, then there will be no issues in
recharging the full battery each day. If we have 10 days during which there is
no sunlight to recharge, the battery will be depleted by 1000 W-hr and will
require close to 1000/220 or nearly 5 days to recharge under normal operating
conditions. We can implement a simple model to look at the daily battery
levels, as shown in Example 7.2.
Example 7.2
Determine how many cloudy days it will take to disrupt the charging cycle of
a system, and how many days can be tolerated with no recharging.
%% Example_7_2.m
% SWT 12-14-15
%% Housekeeping
clear all; clc;
%% Battery Parameters
batteryCapacity = 100; % A-hr
batteryVoltage = 12; % V
%% Solar Parameters
solarPanel = 100; % Watts
solarEffectiveness = 0.8;
solarHours = 6;
%% Load Parameters
baseLoad = 1; peakLoad = 50; % watts
peakTime = 4; % hours
%% Calculations
batteryEnergy = batteryCapacity*batteryVoltage; % watt hours
solarEnergy = solarPanel*solarEffectiveness*solarHours;
loadEnergy = peakLoad*peakTime + baseLoad*(24-peakTime);
endEnergy = batteryEnergy;
for day = 1:size(noCloud)
netEnergy = solarEnergy.*noCloud(day) - loadEnergy;
endEnergy = endEnergy + netEnergy;
if endEnergy , 0
endEnergy = 0;
elseif endEnergy . batteryEnergy
endEnergy = batteryEnergy;
end
myData(day,1) = day;
myData(day,2) = endEnergy;
end
Solar cells and batteries are of great interest to scientists and hobbyists
alike, so a wide range of online resources are available to draw from, as well
as manufacturers’ pages, many of which provide detailed information on
specific products. These online resources are some of the best ways to get
specific information on products that you either have or are considering
obtaining. Should you not be able to find the information you need, contact
the manufacturer directly for more detailed technical documents.
107
108 Chapter 8
Figure 8.1 A p-n junction representation of a photodiode and the schematic symbol.
being that light can penetrate the electrically active area of the diodes,
allowing them to be sensitive to light. It should be no surprise that the starting
point for the photodiode is the p-n or p-i-n junction.
A photodiode operates2,3 when a photon of sufficient energy is absorbed in
or near the depletion region of the semiconductor producing electrical carriers
known as electron–hole pairs. The electron is negatively charged, while the hole
is positively charged so that electrons and holes can move in opposite directions
and create a current called a photocurrent. This is illustrated in Fig. 8.1.
Clearly, the larger the light signal the more electron–hole pairs can be
created and the larger the photocurrent produced, up to the point where the
system saturates. Competing with the photocurrent is the dark current, i.e.,
a current that originates as a thermal effect, independent of a light source.
A dark current will be present even if light is blocked from reaching the
photodiode and is reduced by cooling the photodiode. It is important to
appreciate that the wavelength of light also plays an important role in
producing the current. Photodiodes made from silicon are able to produce
signals from photons that are in the wavelength range of 190–1100 nm. Other
materials are sensitive to other wavelength ranges. For example, mercury
cadmium telluride can be used over a wavelength range of 400–14,000 nm,
making it an important material.
Photodiodes are available in a wide range of packaging, sizes, and
performance parameters. A key parameter is the responsivity, which describes
the ratio of the generated photocurrent to the amount of light and is stated in
units of amperes of photogenerated current per watt of light power, or A/W.
The responsivity of the photodiode should be compared against the dark
current for the photodiode, particularly if operation at low light levels is
anticipated or accurate optical power measurements are required. A photodi-
ode designed to quickly respond to changes in light will require a short response
Photodiodes 109
time that will depend on the resistance and capacitance of the photodiode, with
larger photodiodes having a larger area and thus a larger capacitance. When
high-speed photodiodes are needed, p-i-n diodes are more often used.
Selecting the right photodiode takes a little effort, mostly because of the
wide selection and choices among many manufacturers. Some key considera-
tions are that photodiodes are very inexpensive, making them a good choice
for light detection solutions, and can come in a wide range of sizes and shapes.
Photodiodes are a good choice for optical power ranges in the pico and
nanowatt range, although the milliwatt range is available in larger or small
collection areas. Another feature of photodiodes is that they can be custom
packaged for a particular application. The process of selecting a photodiode
comes down to very few decisions. First is to determine the wavelength range
of interest, which will determine the semiconductor type. Second is the
sensitivity and responsivity needed to support the signal rates you require.
Finally, the size of the photodiode that can be physically accommodated,
which will limit the light collection area, must be determined. With these
parameters in mind, most manufacturers will provide sufficient information
that you can start looking at their specific parts. Once the diode is selected, the
next step is to determine how to get the electrical signal to be analyzed.
function is the ratio of the voltage out to the input current, which is given as
the impedance. Transimpedance is just a contraction of transfer impedance
and is meant to represent the current-to-voltage conversion.
Photodiodes can be represented operationally as a current source and a
capacitor in parallel. As such their operation when configured in the above
circuit is often limited to DC or very low frequencies. The capacitance in the
photodiode can be altered by increasing the width of the junction depletion
region by reverse biasing the photodiode. This is similar to increasing the
separation of a parallel-plate capacitor to lower its capacitance. Figure 8.3
shows how this can be accomplished: the photodiode is connected in reverse
bias, and a second capacitor is added in the feedback loop. While this does
increase the level of the dark current, it is almost always an improvement in
the overall performance.
The circuit shown in Fig. 8.3 is commonly used to improve the performance
of the photodiode. The bias applied to the photodiode increases the width of the
depletion region, which lowers the capacitance of the photodiode. Large
photodiodes with larger “zero-bias” capacitance require this approach to
Figure 8.3 A reverse-biased photodiode circuit used to reduce the photodiode capaci-
tance. The voltage V is used to increase the reverse bias on the photodiode.
Photodiodes 111
Figure 8.5 Two photodiodes connected to a difference amplifier to remove the effects of
common dark current. Notice that one of the diodes is located behind a light shield to block
photocurrent generation.
interesting ability to difference two signals. Figure 8.5 shows how two identical
photodiodes can be connected to remove the thermally induced dark current.
This technique has been shown for the removal of the dark current and as
such is significant in performing accurate light or laser power measurements. In
the case of monitoring higher-power lasers, a beamsplitter or an angled window
can be used to direct a small amount of the beam toward the photodiode so that
the full optical power is not on the diodes. This is also a very effective means of
compensating for temperature drift in the photodiodes.
An optical engineer might have a number of reasons to compare two actual
light signals in this fashion such that the light shield is not needed or can be
replaced with a specific optical filter with differing wavelengths or with differently
sized pass bands. Similar circuits and clever optical filtering can be used to
generate a wide range of composite signals that can be combined to monitor two
signals compared to each other. Although we will not show it here, a summing
circuit with a number of pass bands can be used to create a combined signal.
Figure 8.6 shows an optical counter that can be used to count events that
change the intensity by a set amount. Comparator circuits were introduced in
Chapter 4 as difference amplifiers.
Figure 8.7 shows an optical power meter circuit that can be used to record
the intensity value seen by a photodiode. This circuit can be combined with a
LED voltage level indicator to make a simple self-contained portable
instrument.
114 Chapter 8
Example 8.1
Design an amplifier system and photodiode with a spectral responsivity or
conversion rate of 1 A/W to provide a 10-V maximum signal at 1-mW input of
light centered at 600 nm with a bandwidth of 10 nm for an efficiency of 87%.
As we are working with effectively 600-nm light, a silicon photodiode will
be able to detect the light. Because the diode efficiency is 87% at the wavelength
being detected, the photocurrent is
A
I pc ¼ εðSRÞL ¼ 0.87 1 1 10 6 W ¼ 0.87 mA,
W
where ε is the diode efficiency, SR is the spectral responsivity, and L is the input
power. The bandwidth is coupled into the spectral responsivity term.
The gain for a transimpedance amplifier depends only on the resistor used
in the feedback loop, as shown in Eq. (8.1). For a 1-MV resistor, the output
voltage is
V out ¼ I pc R ¼ ð0.87Þ1 MV ¼ 0.87 V:
Figure E8.1 The variation in the feedback capacitance with the gain bandwidth product for
a feedback resistance of 10,000 and a photodiode capacitance of 200 pF.
Photodiodes 115
Example 8.2
%% Example_8_2.m
% SWT 12-16-15
% Determines the resistors to support a transimpedance
% amplifier and an inverting buffer to give a desired
% output voltage based on diode parameters.
%% Housekeeping
clear all; clc;
%% Diode Parameters
SR = 1; % A/W
Efficiency = .87;
%% Light Parameters
L = 1e-6; % W
lambda = 600; %nm
%% Transimpedance Parameters
RT = 1e5;
%% Photodiode output
Ipc = L*SR*Efficiency;
%% Transimpedance amplifier
VTout = -RT*Ipc;
%% Buffer amplifier
Gain = -Vout/VTout;
Rf = Gain*Rin;
%% Output
fprintf(‘RT = %3.3f MOhms\n’, RT/1e6)
116 Chapter 8
Results:
RT = 0.010 MOhms
Ipc = 1.500 uA
Transimpedance output = -0.015 V
Buffer gain = 1000.00
Buffer feedback resistor = 1000.0 kOhms
Figure 8.8 A photodiode (PD) modeled with ideal components, showing the effect of
associated capacitance CPD, which must be compensated with a feedback capacitor CF.
Photodiodes 117
by its ideal elements: a current source, a resistor, and a capacitor. You may
recall that this circuit looks a lot like a relaxation oscillator introduced in
Chapter 4, so it should not be surprising that this circuit can be unstable. In
this circuit the DC response is set by the two resistors, and in general the
photodiode resistance will be greater than the feedback resistance, forcing the
operational amplifier DC gain to unity.
Selection of the correct feedback capacitor to suppress oscillation can be
calculated as
1 pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
CF ¼ ð1 þ 1 þ 8pRF C PD GBPÞ, (8.1)
4pRF GBP
where GBP is the gain bandwidth product, and the other components are
shown in Fig. 8.8. The challenge is, of course, working out the gain bandwidth
product and the photodiode properties. A calculator for Eq. (8.1) is shown in
Example 8.3.
Example 8.3
Calculator for the feedback capacitance in a transimpedance amplifier driven
by a photodiode.
%% Example_8_3.m
% SWT 12-17-15
%% Housekeeping
clear all; clc;
%% Diode Parameters
CPD = 200e-12;
%% Transimpedance Amplifer
RF = 10000;
GBP = 1:1000;
%% Calculations
A = 4*pi*RF.*GBP;
CF = (1 + sqrt(1+2./A*CPD))./A;
%% Plot
figure(1); plot(GBP, CF*1e9)
axis([0 1000 0 500])
118 Chapter 8
xlabel(‘GBP’)
ylabel(‘Feedback Capacitance nF’)
set(gca,‘FontSize’,9,‘FontWeight’,‘Bold’,‘LineWidth’,2)
References
1. J. W. Hardy, Adaptive Optics for Astronomical Telescopes, Oxford
University Press, Inc., Oxford (1998).
2. A. S. Sedra and K. C. Smith, Microelectronic Circuits, Oxford University
Press, Oxford (2015).
3. S. M. Sze and M.-K. Lee, Semiconductor Devices: Physics and
Technology, Third Edition, John Wiley & Sons, Inc., New York (2012).
4. P. Horowitz and W. Hill, The Art of Electronics, Third Edition,
Cambridge University Press, Cambridge (2015).
5. “Op Amp Circuit Collection,” National Semiconductor Application Note
AN-31, National Semiconductor Corp., Santa Clara, California (2002).
6. T. Wang and B. Erhman, “Compensate Transimpedance Amplifiers
Intuitively,” Texas Instruments Application Report, SBOA055A (2005).
Chapter 9
Quad-Cells and Position-
Sensitive Detectors
Quad-cells and position-sensitive detectors play an important role in measuring
optical beam deflection as might be encountered in image stabilization and active
or adaptive optics systems.1–3 These are deceptively simple devices that can be
constructed in several ways using discrete components or camera systems. This
chapter will consider several different systems but will be predominantly
concerned with the discrete components for the optically active photodiode-
based subsystems. This will keep the complexity to a minimum and allow us to
keep our focus on the electronics rather than the processing of the information
from these devices.
Position-sensitive detectors and quad-cells can be constructed from discrete
semiconductor photodiodes, and both are photosensitive. Both devices are
regularly used as the sensor of a feedback-controlled positioning system that can
be used to position a beam or to keep a beam of light focused on a single point.
In this chapter we will be concentrating on the electrical configuration,
signal amplification, and filtering of quad-cells and lateral position-sensitive
detectors and how to process their outputs into a useable form using the
analog electronics that we have been working with. In general, analog
electronics allows us to keep as much of the signal information as possible
while performing mathematical operations as fast as possible. These features
are often highly desirable in high-speed, low-light optical systems, making
them a good choice for many applications.
9.1 Quad-Cells
Quadrant-cell detectors or quad-cells are used to measure the position or
centration of a focused spot of light. A quad-cell can be easily constructed by
placing four photodiodes together to form a square, two photodiodes on edge.
Often simple optics will be placed in front of the photodiodes to provide a
focused spot. In the most compact form, a quad-cell can be constructed from
119
120 Chapter 9
Figure 9.1 A quad-cell using four circular photodiodes (PD) and their relationship to a
focused light spot.
four photodiodes placed close together, but they can also be expanded to
include many more photodiodes per side, or even to have different
geometries.1,2 An illustration of a simple photodiode quad-cell using circular
photodiodes is shown in Fig. 9.1.
The circular spot shown partially covering the photodiodes on the quad
cells represents a focused light spot and here is evenly balanced over the four
photodiodes so that each would have the same intensity of light. As the spot
moves around in the area defined by the extent of the sensor, the illumination
of the different photodiodes changes, indicating where the spot is centered.
Notice that in this configuration, not all of the light falling on the sensor is
being collected by the photodiodes. When there is sufficient light in the spot,
this does not pose a problem; however, in low-light conditions, this can greatly
reduce the sensitivity.1,2
Quad-cells are ideal for defining a location where a spot of light needs to
be located. Nulling systems can use active feedback to ensure that the spot
remains on the center of the quad-cell by moving a mirror in the opposite
direction of the spot movement. The effect is to always keep the light balanced
on all four photodiodes.
Quad-cells can be constructed from square photodiodes, or four photo-
diodes can be constructed on a single semiconductor wafer to reduce the
amount of light that will be lost to the spaces between the individual
photodiodes. This latter configuration is very popular and is used in many
commercial products currently on the market. The critical issue for configuring
a quad-cell is to ensure that the light spot is well matched to the size of the
photodiodes. It is easy to see that if the spot were very small, it could fall on the
center of the sensor and not be detected. A properly sized spot will always have
light on all four photodiodes over the deflection range to be measured.
Quad-Cells and Position-Sensitive Detectors 121
ðB þ CÞ ðA þ DÞ
DX ¼ : (9.1)
AþBþCþD
Figure 9.2 A simplified model of the quad-cell used to determine the relationships for
calculating the X and Y displacement.
122 Chapter 9
Example 9.1
Calculate the displacement of the spot shown in Fig. 9.1 using Eqs. (9.1) and
(9.2).
The displacement in the X direction is
Figure 9.3 Quad-cell output for displacement of a circular light spot along the X axis.
Example 9.2
Calculate the quad-cell output as a light spot is moved along the X axis.
%% Example_9_2.m
% SWT 12-17-15
%% Housekeeping
clear all; clc;
%% Circle parameters
CX ¼ -8:0.1:8; % displacement
CY ¼ 1; % displacement
R ¼ 5; % circle radius;
%% Calculator
areaCircle ¼ pi*R^2;
thetaX ¼ 2*acos(CX/R);
area_X ¼ R^2*(thetaX-sin(thetaX))/2;
displacement_X ¼ (areaCircle/2 -area_X)/areaCircle;
124 Chapter 9
thetaY ¼ 2*acos(CY/R);
area_Y ¼ R^2*(thetaY-sin(thetaY))/2;
displacement_Y ¼ (areaCircle/2 -area_Y)/areaCircle;
% %% Output
figure(1); plot(CX,displacement_X)
axis([-8 8 -.6. 6])
grid on;
xlabel(‘Centroid position X’)
ylabel(‘Quad-cell Output’)
The calculator shows results for spot movement in the X axis but would be
very simple to modify to work in both axes. While this code does not explicitly
calculate the amount of light on each element of the quad-cell, this could be
easily constructed.
Figure 9.4 Three operational amplifier circuits that combine the quad-cell output into
usable numbers for determining beam displacement. The top circuit is one of four
transimpedance amplifiers for converting the photodiode current into a voltage; the middle
circuit provides the sums and differences; the bottom circuit provides the sum of the light in a
quad-cell as a voltage to be used in normalization.
Figure 9.5 Illustration of the PSD showing the electrodes and a focused light spot in the
center.
as follows: a spot of light on the surface causes a change in the local resistance
at the point of contact, which causes a current to flow into the electrodes. This
current is related to the position of the spot on the surface. The device
configuration is illustrated in Fig. 9.5.
The PSD is a silicon photodiode with electrodes placed near the edges to
provide signals that are related to the position of the light spot on its surface.
One advantage of the PSD is that a much smaller focused spot can be used,
providing more area in which the spot can move.
The ideal PSD will be a low-cost, low-noise, high-precision, fast-response
device, and in many cases will be able to operate at low light levels. Current
devices have remarkable performance, and as industrial demand for these
devices increases so will their performance; however, some issues of nonlinear
performance remain to be addressed in these devices.
One application of a PSD is in tracking a cooperative beacon some
distance from the observing site. A guide telescope co-aligned with an imaging
telescope at shorter focal length can be kept on target using a PSD. In this case
small movements in the longer focal length guide scope can be seen and used
to provide a correction to the tracking mount. The effect will to be to reduce
the amount of jitter-induced blurring in the image. This approach can also be
used to improve the tracking ability of a mount by providing continual
position corrections.
Quad-Cells and Position-Sensitive Detectors 127
Figure 9.6 A possible implementation of PSD electronics for a single axis. The output
voltage is very sensitive to the denominator normalization, so care must be taken in how the
division is performed.
to connect the sum and difference signal to the microcontroller directly and
perform the division process as a digital division. The circuit shown in Fig. 9.6
is rather minimal and could be improved by having additional buffer
amplifiers or filters to reduce any noise in the system.
References
1. J. W. Hardy, Adaptive Optics for Astronomical Telescopes, Oxford
University Press, Inc., Oxford (1998).
2. F. Roddier, Adaptive Optics in Astronomy, Cambridge University Press,
Cambridge (1999).
3. S. W. Teare and S. R. Restaino, Introduction to Image Stabilization, SPIE
Press, Bellingham, Washington (2006) [doi: 10.1117/3.685011].
4. P. Horowitz and W. Hill, The Art of Electronics, Third Edition,
Cambridge University Press, Cambridge (2015).
5. A. S. Sedra and K. C. Smith, Microelectronic Circuits, Oxford University
Press, Oxford (2015).
6. D. Zwillinger, Ed., CRC Standard Math Tables and Formulae, 32nd
Edition, CRC Press, Boca Raton, Florida (2011).
7. “Op Amp Circuit Collection,” National Semiconductor Application Note
AN-31, National Semiconductor Corp., Santa Clara, California (2002).