Professional Documents
Culture Documents
E lectronics
Third Edition
Sean Westcott
Jean Riescher Westcott
This publication, portions of it, or any accompanying software may not be reproduced in any
way, stored in a retrieval system of any type, or transmitted by any means, media, electronic display
or mechanical display, including, but not limited to, photocopy, recording, Internet postings, or
scanning, without prior permission in writing from the publisher.
S. Westcott and J. R. Westcott. Basic Electronics: Theory and Practice. Third Edition.
ISBN: 978-1-68392-528-6
The publisher recognizes and respects all marks used by companies, manufacturers, and developers
as a means to distinguish their products. All brand names and product names mentioned in this book
are trademarks or service marks of their respective companies. Any omission or misuse (of any kind) of
service marks or trademarks, etc. is not an attempt to infringe on the property of others.
Our titles are available for adoption, license, or bulk purchase by institutions, corporations, etc. For
additional information, please contact the Customer Service Dept. at (800)232-0223(toll free).
All of our titles are available in digital format at www.academiccourseware.com and other digital vendors.
Companion disc files for this title are available by contacting info@merclearning.com. The sole obligation
of Mercury Learning and Information to the purchaser is to replace the disc, based on defective
materials or faulty workmanship, but not based on the operation or functionality of the product.
Chapter 7: Resistors 83
The Mighty Resistor 83
Fixed-Value Resistors 84
Resistor Color Codes and Power Ratings 84
Reading the Code 85
Power Ratings 86
Surface Mount Resistors 87
Single in Line Resistors 87
Variable Resistors 87
Kirchhoff ’s Laws 88
Calculating Resistance 89
Lab 7-1: Using Ohm’s & Kirchhoff ’s Laws to
Determine the Proper Resistor 91
Resistors in Series Circuits 92
Lab 7-2: Resistors in a Series Circuit 92
Resistors in Parallel Circuits 93
Lab 7-3: Resistors in a Parallel Circuit 94
Voltage Division Circuits 95
Lab 7-4: Voltage Division Using Fixed Value Resistors 96
Lab 7-5: Voltage Division Using a Variable Resistor 97
The Least You Need to Know 98
Chapter Review Questions 98
Chapter 8: Capacitors 101
How a Capacitor Works 101
Farads 103
Relative Permittivity 103
Capacitor Ratings 104
Nominal Value and Tolerance 105
Temperature Coefficients 106
Breakdown Voltage or DC Working Voltage 106
Polarized Capacitor Types 106
Appendix A: Glossary319
Appendix B: Timeline of Electronics329
Index 363
T
he study of electronics can be a little overwhelming when you start
out. But without assuming that you remember everything from your
general science classes, we take you through it all step by step so that
you will gain confidence in your understanding of the material. This doesn’t
mean that we give you an oversimplified version of electronics, but it does
mean that we cover the topics in a more digestible style. We believe that by
making the effort to wrap your head around some of the more difficult top-
ics, you will find it easier to progress into further study of electronic theory
or hands-on experimentation.
We believe that a new revolution is under way. Electronics has always
had a thriving hobbyist population, especially in the 1960s and the 1970s.
There were magazines, corner electronics stores; and clubs where enthusi
asts could meet and share their creations. It had its subcultures from ama
teur radio enthusiasts to model rocket builders. In the 1980s, this culture
grew to include people building personal computers before such companies
such as IBM and Apple began to mass produce them.
The hobbyist field changed as electronics advanced. The increasing
sophistication and miniaturization of electronic components and the prod
ucts built with them made hobbyist-built electronics pale in comparison to
their flashier, mass-produced competition. But those same advances are now
putting the design and production back into the hobbyists’ hands. Perhaps
egged on by battling robots out of university engineering departments, a new
generation of electronics buffs is tinkering with technology. With affordable
microcontrollers and a wide range of products and information available
online, the hobbyist can design and build machines that recharge the ideas
of homebrew and do-it-yourself. We can all become Makers.
EXTRAS
Throughout the book, you will find the following sidebars offering addi
tional insights:
Definitions.
Sometimes it helps to have things stated just a little more directly. In
these sidebars, we save you from having to grab a dictionary.
Titans of Electronics.
Not just a parade of historical figures—here we invite you to put yourself
in their shoes. These sidebars offer a closer look at the folks who looked at
things a little differently and changed the world with their ideas.
High Voltage!
When handled safely, electricity can be safe. But the consequences of
not respecting its potential for harm are serious. The more you understand
how electricity moves, the better you can prepare and work safely with it.
Wattage to the Wise.
Here you will find straightforward advice—sometimes practical, some
times more philosophical.
ACKNOWLEDGMENTS
We would like to thank the people who helped us bring this book to
publication, Jen Blaney, Kelly Lee, and David Pallai.
We would also like to thank our colleagues and especially our family for
supporting us as we worked through many beautiful weekends. The readers
and contributors to the Netduino forums provided excellent advice. Special
thanks are extended to Bob Godzwon and John O’Brien of Extech Instru-
ments who provided valuable help as technical reviewers of a previous ver-
sion of this text.
Most importantly, we thank the instructors who have used previous edi-
tions of this book and the readers who have reached out with corrections.
We are thankful for your appreciation for the place this book attempts to fill,
an introduction to concepts that doesn’t require a lot of previous knowledge
of electronics, but that can get you to the hands-on work of making your own
projects and further study. Your feedback is important and appreciated.
THE FUNDAMENTALS
E
lectronics involves controlling the invisible. Most of the time, you
see the effect of electricity but not the actual movement of electric
current. This part pulls back the curtain on that hidden world to give
you a peek at how electricity works at the atomic level.
It all starts with tiny, charged particles called electrons. You’ll learn how
and why electrons move in the natural world and how people have har-
nessed their power using circuits.
No overview of electronic theory would be complete without an ex-
planation of how current (the flow of electrons, also known as electricity),
voltage (the “push” that is caused by the attraction of positive to negative),
and resistance (the “push back” of insulators) work. You will find out what
power really means and the ways that all of these forces interact.
1
THE THEORY BEHIND
ELECTRICITY
In This Chapter
●● Understanding atomic structure
●● Harnessing the laws of attraction and repulsion
●● Controlling the flow of electrons
●● Identifying an element’s conductivity and resistance
E
lectronics is the study of devices that can control the flow of elec-
tricity. You can build devices that detect, measure, power, control,
count, store, and transmit electricity—and much more. But in order
to do all of these things, you first need to know what electricity is and how
it flows.
To get to the essence of electricity, you must delve into some of the
most basic concepts in physics: atoms and their structure.
can vary, and each variation is a different isotope of that element. We call
the combined number of protons and neutrons nucleons. For example,
carbon-14 is an isotope of carbon. It has six protons and eight neutrons. It
is still carbon, but the variation in the number of neutrons affects some of
its properties.
The periodic table of chemical elements, often sim ply called the
periodic table, lists the 118 known elements and basic information—atomic
DEFINITION
number, relative atomic mass (also known as atomic weight), symbol, and
other information, depending on the table—about each element.
Electrons
The atomic number of an element indicates the number of protons. For
an electrically neutral or stable atom, the number of protons and electrons
are equal, which means that once you know the atomic number of an ele-
ment you know the number of electrons it has. Electrons travel around the
nucleus of the atom in an area known as a shell. Shells are layered outward
from the nucleus. Each shell can hold up to a maximum number of elec-
trons. The innermost shell can hold 2 electrons, the second shell can hold 8,
the third shell can hold 18, and the fourth can hold 32.
The following table shows the electron arrangements for some com-
mon elements:
Valence Shell
The outermost shell of an atom is known as the valence shell (or
valence band), and the electrons that inhabit that outer shell are called
valence electrons. The more full the valence shell, the less likely it is
that an atom will lose electrons when a force is applied. The less full
the valence shell, the more likely it is to lose electrons when a force is
applied.
Let’s compare two elements. As you can see from the preceding table,
neon has a full valence shell, meaning that it is unlikely to gain or lose
electrons. Copper, on the other hand, has just 1 electron in its valence
band, which can hold 32 electrons. This lone electron filling the valence
shell is easily attracted away to a nearby atom that has room on its valence
shell.
If a valence shell loses or gains an electron, the atom becomes an ion.
An ion is an atom with a charge. An atom that has more protons than elec-
trons has a positive charge. An atom with more electrons than protons has
a negative charge. Because of the electromagnetic force, negatively charged
electrons will leave their own valence shell to travel to another atom that
has a positive charge.
Conductors
Elements that are grouped on the left side of the periodic table have
fewer electrons in their valence shell and can serve as good conduc-
tors. That’s because these electrons are loosely bound to their nuclei
(the plural of nucleus) and can easily be separated from their atom and
travel to a positively charged ion. In other words, these elements allow
for electricity—which is simply the flow of electrons—to flow easily.
Examples of common metals that are relatively good conductive materi-
als are silver (Ag), gold (Au), and copper (Cu), all of which contain just
one electron in their valence shell; that lone electron is easily removed
when electricity is flowing. Moving to the right from these metals to the
far right of the periodic table you encounter more stable elements that
are less conductive.
Insulators
Elements that have full or nearly full valence shells either hold on to
their existing electrons or attract electrons so that their valence shell be-
comes full. These elements are insulators that have great resistance and can
slow or block the flow of electricity. They don’t have room on their valence
shell to accept electrons, and their nearly full outer shell holds tightly to the
electrons it already has.
The elements at the far right of the periodic table are called the noble
gases. These are extremely good insulators as they are very nonreactive.
The naturally occurring noble gases are helium (He), neon (Ne), argon
(Ar), krypton (Kr), xenon (Xe), and radon (Rn).
Semiconductors
The elements in between the metals and the noble gases on the peri-
odic table are generally semiconductors. Some elements commonly used as
semiconductors are silicon (Si) and germanium (Ge). These elements can
be combined with others to introduce impurities that can conduct electric-
ity. This process is called doping, and when an element is used in this capac-
ity, it is referred to as a dopant.
FIGURE 1.3 Atoms of silicon in a crystalline structure. Note that the image doesnÕt depict all of the atoms
on the outside rows; silicon has four electrons in its valence shell.
FIGURE 1.6 When electrons move to the empty holes during electron flow, the ÔmovementÕ of the empty
holes is called the hole flow.
■■ Electrons travel in shells or bands around the nucleus. The outer shell is
called the valence shell. When electrons move from one atom to anoth-
er, they create an electric current.
■■ Materials are classified as conductors, insulators, or semiconductors
based on their resistance to conductivity. Semiconductors can be doped
to create n-type or p-type semiconductors.
2
HOW ELECTRICITY WORKS
In This Chapter
●● Creating paths for electricity to follow
●● Giving electricity a push
●● Measuring voltage, current, and resistance
●● Calculating power using Ohm’s Law and Joule’s Law
N
ow that you know what electricity is at the most fundamental level,
it’s time to find out more about how it flows and how you can take
charge of that flow. Electricity needs a path and a push. Once you
understand how to manipulate the path and the push, you can control the
devices you connect to the path.
Circuits
The path on which electricity flows is called a circuit. Once flow has
been established, electric current can travel endlessly through a conductive
material if the circuit remains as a loop. Chapter 1 compared the flow of
electric current to marbles moving through a looped straw. In this compari-
son, the circuit is the straw, and it can’t carry electricity if there is a break
anywhere along it.
More practically, a circuit is any arrangement that allows for electri-
cal current to flow. An example of a very basic circuit might be a battery
■■ Friction
■■ Thermoelectrical sources, which use differences in temperature to cre-
ate electricity
Titans of Electronics
The first practical electrical generator was designed by Michael Fara-
day in 1831. He discovered that if you rotate a conductive metal wire in a
magnetic field, a process called induction (see Chapter 11), you can gener-
ate a current. A generator uses mechanical energy to turn the wire, convert-
ing mechanical energy into electric energy that can cause current to flow
through a circuit.
Some generators are hydroelectric, meaning that they use the flow of
water to turn a turbine. Oil and coal can be burned to cause steam, which
also turns a turbine to generate electricity. Atomic energy uses the heat
released by nuclear fission to create steam to turn a turbine. Even green
energy, such as wind power, relies on a turning turbine to create electricity
through induction.
Voltage (V), named after Italian scientist Allessandro Volta, is the
measurement of emf. It is the measure of the force required to move
electricity between two points on a circuit, known as the potential dif-
ference (p.d.) between those two points. You cannot measure the volt-
age at a single point; it is always a measurement across two points. Like
speed or length, to measure voltage you need to have two points to show
a relationship.
It may seem that we are using a lot of words to represent the same
concept and, frankly, we are. Hopefully, using them all in the same sen-
tence will help clarify relationships: Electromotive force (emf), also known
as voltage (V), is the potential difference between two points in a circuit; it
is symbolized by the letter E (usually presented as ℰ ) and is measured in
volts.
Current
Because current (I) is all electrons moving through a circuit, we mea-
sure it as it moves through a single point. To account for the fact that elec-
trons are incredibly small, a large unit was created to represent a set number
Titans of Electronics
French physicist Charles Augustin de Coulomb is the namesake of the
coulomb.
The ampere is named after French scientist André-Marie Ampère.
Again, let’s put it all these terms together in a single sentence: Current
is the number of electrons that move in a circuit, it is symbolized as I, and
is measured in a unit called an ampere (A).
When you consider how small electrons are, you realize that
looking at the number of electrons in a coulomb is almost beyond
comprehension. Here is how a coulomb’s value (6.25 × 1018) in
individual electrons would look written in standard numbers:
6,250,000,000,000,000,000. This number is obviously unwieldy
and difficult to work with, which is why it is almost always repre-
WATTAGE TO THE WISE
sented in scientific notation.
If you use scientific notation to express such a large number, it
makes it much easier to solve equations with incredibly large or
incredibly small numbers. To learn how to express a large number
in scientific notation, refer to Appendix C.
Resistance
Resistance is the oppositional force to emf. It might help to think of re-
sistance as the equivalent of friction slowing down a moving object. As cur-
rent is pushed through a circuit by voltage, it encounters resistance, which
reduces the voltage. This is why we measure voltage across different points
along the circuit. The resistance of the material that makes up the circuit
determines how much the voltage is reduced.
Titans of Electronics
A German provides the name for the unit of measurement this time
around, Georg Simon Ohm.
OhmÕs Law
You have now learned the three measurements that are a part of the
most basic formula in the field of electronics: Ohm’s Law. Ohm’s Law states
that the current (I) between two points is directly proportional to the volt-
age (V) and inversely proportional to the resistance (R). As an equation, it is
written I = V/R. If you have any two of the variables, you can solve for the
other. For instance, if you have R and I, you can solve for V using this equa-
tion: V = R × I. Similarly, if you know the values of V and I, you can solve
for R with this equation: R = V/I.
Power
In a direct current circuit, power is the voltage multiplied by current.
The unit of measurement for power is the watt (W), named after the Scottish
scientist James Watt. One volt pushing one amp of current equals one watt.
You may be more familiar with the term kilowatt (kW) as a unit of
power. A kilowatt is 1,000 watts. Your electric bill lists the number of kilo-
watt hours (kW-h)—the amount of power in total when a kilowatt of power
FIGURE 2.2 OhmÕs Law pyramid shows the relationship between voltage, current, and resistance. Note that
if you look at any of the segments of the pyramid, the other two values are shown in their mathematical
relationship.
JouleÕs Law
Ohm’s law shows the relationship between current, voltage, and resis-
tance. If you want to determine power you need to know another foun-
dational law of electricity: Joule’s law. You can use Joule’s law to calculate
the amount of power provided by a circuit. Joule’s First Law gives us the
following equation:
Power = Voltage × Current or P = V x I
FIGURE 2.3 The four values that can be solved for using OhmÕs and JouleÕs law: power, current, voltage, and
resistance. In each quarter of the circle, you can see the variables needed and the relevant equation to solve
for each value.
Titans of Electronics
Joule’s Law is named after James Prescott Joule, a British physicist and
brewer.
You can combine Joule’s Law and Ohm’s Law to solve for voltage, cur-
rent, resistance, and power.
Electronic Measurements
Quantity Symbol Unit of Measurement Unit Abbreviation
Current I Ampere (amp) A
Voltage E or V Volt V
Resistance R Ohm Ω
Power P Watt W
Materials:
Flashlight bulb (lamp)
9V battery
Jumper wire
Masking tape
Instructions:
Connect the battery with the jumper wires using masking tape as shown
in the diagram. Be sure to connect the wire from the positive terminal to
the bottom of the lamp bulb base. Connect the wire from the negative ter-
minal to the side of the bulb base using tape.
3
CURRENTS AND CIRCUITS
In This Chapter
●● Introducing direct current (DC) and alternating current (AC)
●● Analyzing currents by the waveforms they produce
●● Measuring voltage in AC
●● Identifying different types of circuits
E
lectrical current can travel as a direct current (DC) and an alter
nating current (AC). Both types of current are the movement of
electrons, and both can produce power, but they are not inter
changeable. Most basic electronics encountered by hobbyists or students
are powered by direct current (DC). When working with electronics, we are
primarily concerned with direct current, but it is important to be familiar
with the properties of each.
Direct Current
Direct current (DC) is current that travels in one direction only. Bat
teries of all sorts provide DC power. In a DC circuit, the current flows
from the negative terminal of the battery through the circuit to the posi
tive terminal of the battery. DC is also said to have constant polarity,
meaning that it doesn’t change from positive to negative or vice versa; it
remains as either one or the other. This will become important to know
as you learn more about electronics.
Alternating Current
Alternating current (AC) has electron flow in both directions, alter
nating between forward and backward. It also has changes in polarity.
Most households receive AC current from their power company. AC
is easier to transmit at large voltages across greater distances to neighbor
hood substations. Transformers are used at these substations to lower the
voltages for levels appropriate for household use. You’ll learn more about
working with AC as a power source later in this book, but knowing the
basics will equip you with all you need to get started working safely.
Titans of Electronics
Thomas Alva Edison (1847–1931) is one of America’s greatest inven
tors and scientists. His inventions changed the way we live our lives, from
electricity in the home to mass communication and entertainment. His
early successes with inventions like the quadroplex telegraph (which al
lowed for more than four signals to travel on the same line) allowed him
to finance his great industrial laboratory at Menlo Park, New Jersey. His
legacy includes inventions or improvements in the following technolo
gies: the incandescent light bulb, phonograph, kinetoscope, stock ticker,
film projectors, and delivery of electricity to homes and businesses.
While Edison was refining DC generation, George Westinghouse and
Nikola Tesla were working together on AC generation and transmission.
They believed that AC’s ability to be transmitted over much farther dis
tances made it the clear choice, as fewer generation stations would be
needed.
Edison went on a publicity campaign trying to prove that AC was
dangerous because it used much higher voltages. He arranged to electro
cute stray animals to death and built New York’s electric chair to show the
public the dangers of high voltage. He used the term “Westinghoused”
instead of electrocution—which obviously didn’t catch on.
Some communities did use DC as their current of choice. Edison’s
electric company (later folded into the New York utility Consolidated
Edison, or Con Edison) provided power to areas in New York City and
Westchester County, and other DC systems powered parts of Boston. DC
was phased out slowly starting in the 1960s, and the last of Con Edison’s
DC-powered homes were converted to AC in 2007.
DC still does provide electricity in some situations. Many homes that
go “off the grid” and are self-sufficient store their locally generated power
in DC batteries. Some developing countries use high-voltage DC trans
mission systems, and telecommunications are often powered by DC.
Waveforms
Steady DC produces a constant voltage between two points without any
additional resistance. AC voltage constantly varies among peak positively
charged voltage, no voltage, and peak negatively charged voltage. It does
this in a regular pattern, and the varying voltage can be described by clas
sifying its waveform.
When you look at a waveform, you can identify a few of the parts:
nn Amplitude is the measurement of the distance of any point of the wave
that is above or below the center or mean line.
nn The peak amplitude is the point of the wave that is farthest from the
mean line; it can be positive (above the mean line) or negative (below
the mean line).
nn The cycle of a wave is one complete evolution of its shape.
nn The period is the amount of time it takes to complete one cycle. The
symbol for the period is T and it is measured in seconds (s) or millisec
onds (ms).
nn The frequency is the number of complete cycles in a given amount
of time. The symbol for frequency is f. Frequency is measured in
Hertz (Hz); it is named after the German physicist Heinrich Hertz.
One Hz is equal to one cycle per second. Most U.S. AC power is
delivered at 60 Hz, meaning 60 cycles between negative and positive
and back to the center line again in one second. Frequency and pe
riod are reciprocal to each other. Their relationship can be expressed
as f = 1/T or T = 1/f.
The best way to “see” AC waveforms is to use an oscilloscope, a profes
sional tool that depicts the waveforms produced by electrical current. It
allows you to quickly see a visualization of the voltage and wave character
istics of the current.
Sine Wave
To study waveforms further, let’s look at an AC generator, called an al
ternator. On this type of electrical generator, as the rotating magnetic core
(the rotor) rotates within a stationary wire (the stator), the polarity of the
charge and the direction of the current change.
Peak – amplitude = 1 cycle
Amplitude
Peak + amplitude
In this constant, smooth rotation, the current flows in a continuous
sine wave shape as the voltage fluctuates between a positive and negative
charge.
FIGURE 3.2 An AC generator, called an alternator. At this point there is no current flow.
FIGURE 3.3 As the rotor starts its rotation, a current is generated and the current flows in a negative direction.
FIGURE 3.4 As the rotor returns to a vertical position, there is no current flow.
FIGURE 3.5 As the rotor turns again, current flows in a positive direction.
FIGURE 3.6 A sine wave shape depicting current produced by a rotating alternator shaft.
A sine wave (also called a sinusoidal wave) is the shape that results from
plotting the mathematical equation y = sin(x). The sine wave is the shape
DEFINITION
that occurs most often in ocean waves, sound waves, and light waves.
Other Waveforms
Sine waves are not the only waveforms that occur in electronics. Square,
sawtooth, and triangle waves are some of the most common regular nonsi
nusoidal waveforms. There are also irregular forms of both the sine wave
forms and these other shapes, but for our purposes, we need only identify
the general shape of the waveform.
Square waves are common in digital electronics. A square waveform
depicts a current that sustains a certain voltage, then quickly drops to an
opposite sustained voltage.
Sawtooth waveforms are used in some cathode ray tube (CRT) applica
tions and in manipulations of vocal harmonics. Sawtooth and triangle wave
forms have gradual increases in voltage, then gradual decreases. These odd
shapes are sometimes used in combination with other waves to manipulate
the properties of the initial wave.
Phase
In electronics, phase is the relationship between two waves. Two overlap
ping waveforms are said to be “in phase.” If two waveforms are of the same
frequency and voltage but don’t overlap, they have a phase shift. If you think of
two runners on a race track starting at the same time from different points, or at
staggered start times, they can be said to be in phase shift. The time difference
or space difference between the runners is the amount of phase shift.
When working with AC, you would apply trigonometric analysis to de
scribe the wave and the amount of phase shift. The sine wave is representative
of a circle’s rotation. We can look at the points along the timeline of a waveform
as differences in the degrees of rotation. Phase shift can thereby be described
as being x degrees out of phase.
When two waveforms are out of phase, at any single point you can mea
sure the phase difference between the two. The first wave is called the lead
ing wave and the next wave is the lagging wave. The amount of phase shift
can be measured across the time axis.
If two waveforms of the same frequency and voltage have a phase shift
of 180 degrees, they cancel each other out because they have opposite volt
ages at every point in their waveform except for when they meet at the
center or mean line.
the DC equivalent. For a sine waveform, the rms can be calculated by mul
tiplying the peak voltage times .707 or VP(.707).
Circuit Diagrams
In electronics, diagrams are used to describe circuits. These circuit dia
grams depict the components added along the path of the electron flow.
Most circuits contain a voltage source (a battery in our example), a path
(conductive wire), and a load (the component that does the work of the
FIGURE 3.14 Simple circuit diagrams showing the circuit as open and closed.
circuit; in this circuit, the lamp is the load). The circuit diagram depicts
these using simple symbols for each part of circuit.
A closed circuit provides a constant flow of current. If there are any
breaks in the circuit—anything that interrupts current flow—it is an open
circuit, also called a broken circuit. In open circuits, current doesn’t flow at
all, because a break anywhere along the path stops the current flow from
any part of the circuit.
Most circuits have a switch. A simple switch causes a break in the cir
cuit to stop the flow of current. In our example, we could add a switch that
would serve as an on/off switch for the lamp.
When making or reading a circuit diagram, it is important to pay at
tention to the polarity of the voltage source’s terminals. Remember that
the polarity reflects the charge of the terminal, positive (+) or negative (–).
On a typical battery, the terminals are labeled clearly. Your circuit diagram
should be labeled as well.
FIGURE 3.15 The polarity of the voltage sourceÕs terminals is labeled with positive or negative signs.
Short Circuits
When current flows through a circuit, it must encounter some resis
tance because otherwise it can create a short circuit. A short circuit occurs
when the current takes an unintentional path or unintended shortcut—it’s
like a train jumping a rail. The preceding example uses current to power
the lamp, providing for a drop in voltage after the current encounters the
resistance provided by the load of the lamp. Without the lamp, the voltage
doesn’t drop along a conductive piece of wire before the current is returned
to the positive terminal. Heat is produced along the wire due to friction,
and the heat can damage the chemicals in the battery or cause heat damage
to the wire along the circuit.
You must be careful to create a circuit that takes into account Ohm’s
law. If your circuit has too much resistance built into it, the power it pro
vides to the load may not be adequate to make it work as intended. If you
don’t provide enough resistance, you might exceed the power that the load
can handle. An overloaded circuit can cause excessive heat and the compo
nents could explode or cause a fire.
FIGURE 3.16 Examples of a series circuit, parallel circuit, and a series-parallel circuit. Resistors are labeled
R1, R2, and R3.
YOUR WORKSPACE
AND TOOLS
N
ow that you understand the basic theory of how electrons move, it’s
time to get your equipment in order. You need tools to measure,
connect, observe, and protect. Some of these are familiar—screw-
drivers, pliers, and other hand tools—while others are specialized. Some of
these specialized tools are downright ancient (solder and flux), and others,
like the digital multimeter (DMM), you’ll find you can’t live without.
Where should all those tools go? In a clean, well-lighted space, of
course! This part discusses various options for setting up your workspace,
whether at school or work or inside your home. You will also learn why good
work habits are good safety habits. The effort you put into working deliber-
ately will produce better results.
Because electricity can be very dangerous if handled incorrectly, this
part stresses the importance of respecting its power by always using proper
safety procedures. And should an accident happen, you’ll learn what to do
to minimize the damage.
4
TOOLS OF THE TRADE
In This Chapter
●● Getting a handle on the tools you’ll need
●● Using specialty measuring instruments
●● Acquiring essential soldering equipment
●● Putting safety first
W
hether you’re a home hobbyist or planning to pursue a career in
electronics, you’ll need some tools to get started. This chapter
introduces you to the essential tools and instruments plus some
specialty items for soldering and safety.
Keep in mind when shopping for tools that it’s often a better value to
spend more money on a higher-quality product than to try to save a few
bucks on a low-quality version that probably won’t last as long.
Wire cutters. Don’t skimp on these: Look for a comfortable and solid
grip and high-quality blades that will stay sharp. We suggest buying a
variety of sizes so that you always have the right size for the job. A good
type to look for is a stand-off shear, as this type is less likely to deform
the wire or nearby surfaces and leaves behind a consistent length of wire
when cutting the leads (the wire portion). Some wire cutters have a lead
catcher, a slot that catches wire trimmings so they don’t fall onto your
project.
Wire strippers. This tool cuts and removes the insulation on coated wire
while keeping the wire itself intact. Look for a good-quality handle and
blade. Most users will want a simple small wire stripper and a better-quality
automatic wire stripper with holes for multiple gauges of wire.
Wire gauge is a wire’s thickness, and determines the amount of current
(amperage) a wire can carry. It is measured at the wire’s diameter and
DEFINITION
doesn’t include the insulating covering.
Essential Instruments
You may find used oscilloscopes for very low prices, but make
sure there is some warranty that the scope is in good working
order and properly calibrated.
WATTAGE TO THE WISE
A digital multimeter (DMM). This is the one tool you will use the
most. A multimeter allows you to measure voltage, current, and resis-
tance (as well as many other readings) in DC and AC circuits with an
easy-to-read digital display.
DMMs range in price from under $20 to thousands of dollars. As with
most tools and instruments recommended in this chapter, buying a
well-reviewed, handheld, midprice multimeter will probably be a better
value than buying the cheapest instrument on the market, as this tool is
going to be your workhorse.
Maximum input voltage (max volts) is the highest voltage your meter
can safely read. If you try to use your meter to read a higher voltage,
you will damage it and most likely injure yourself. On the meter
we use for the projects in this book, the max volts AC and DC is
HIGH VOLTAGE 600rms, so we will not take a voltage reading on anything that is
higher than 600V AC or DC.
For all the projects and labs in this book, we use the Extech EX210. We
like this model because it also includes an infrared thermometer, which is
useful for detecting hot spots.
When using a tool for the first time, or when you get frustrated
about a problem that keeps popping up, it really pays to read the
friendly manual.
With certain tools, especially expensive ones or in situations where
safety is at stake, at least read the rudimentary manuals that are
included or go online to locate the resources associated with your
new purchase.
HIGH VOLTAGE
Reading an instrument’s manual when dealing when electricity can
prevent accidents well beyond a simple buzz from a battery. It can
save your life.
Using your DMM properly is key to your success with electronics. Let’s
get some hands-on practice with some labs.
Materials:
AA battery
DMM
Instructions:
1. On your meter, put the black probe lead in the jack labeled “COM.”
2. Put the red probe lead in the jack labeled “V.”
3. Move the settings dial to Vdc.
4. Touch the black lead to the – or negative side of the battery and touch
the red lead to the + or positive side of the battery.
5. Check the reading. It should be around 1.5V.
Materials:
Access to a live wall outlet
DMM
Instructions:
1. On your meter, put the black probe lead in the jack labeled “COM.”
2. Put the red probe lead in the jack labeled “V.”
3. Move the settings dial to Vac.
Very important: Make sure that your lines are not crossed or touching
each other in any way!
4. Place a probe in one slot of a wall outlet and then place the other probe
in the other slot. Again, make sure the probes are not touching each
other.
5. Check the reading. It should register a reading of around 120V.
Materials:
DMM
1 100Ω resistor
Instructions:
1. Put the red lead in the V Ω jack.
2. Put the black lead in the COM jack.
3. Move the settings dial to Ω.
4. Use a resistor with a color code of BLACK BROWN BLACK and touch
the probes one to each side. The meter should register a reading of
100Ω.
Materials:
Nine volt battery
Lamp (bulb) from a flashlight
Two short pieces of wire
Masking tape
DMM
Instructions:
1. Tape one end of a piece of wire to the side of the lamp and the other end
to the + terminal of the battery.
2. Tape one end of the other piece of wire to the bottom of the lamp, then
tape the other end to the red probe.
3. Put the red lead in the 10A jack.
4. Put the black lead in the COM jack.
Maximum input amps is the highest current you can test for on your
DMM. Most meters have a setting for reading low-value currents
in μ or m and a setting for higher current or A. The Extech EX210
DMM, for example, has a jack for μA and mA with a maximum of
200 milliamps (mA) and a jack for a maximum of 10A. When taking
HIGH VOLTAGE
current measurements, always make sure you are using the right set-
tings. You may also need to choose AC or DC; on the EX210, this is
done with the MODE button.
a rosin core, 60/40 type (a mixture of 60 percent tin and 40 percent lead)
or one of the lead-free solders that are designed for electronics solder-
ing. It is sold coiled on a spool.
Soldering iron. A soldering iron is the tool used to melt solder to form
joints. It has a plastic handle and a metal tip that heats up. You will want
a soldering iron that has a variable power control with a maximum watt-
age of 40. Anything higher can damage the parts or the board.
For the projects in this book, we use a Weller WLC 100. This is a good
starter iron, but it does have some drawbacks—the iron itself is not ground-
ed and you can control only the power and not the temperature—but for
this book and most uses, it is more than up to the task.
Solder sucker and solder wick. A solder sucker is used to suck up ex-
cess solder from your projects. A solder wick does the same sort of thing
but is more precise. You typically use the sucker first to get the bulk of
excess solder off and then use the wick to remove what’s left.
Flux and flux bottle. Liquid flux is a chemical cleaning agent used to
prepare your board for soldering. A flux bottle has a needle that allows
for precise application of the flux.
FIGURE 4.10 From left to right, a solder sucker, flux bottle, and solder wick.
Heat sink. A heat sink protects components from heat damage while
they are being soldered in place. Get one with an insulated handle, as it
will get hot.
Circuit board holder. This is a stand with a set of vice grips for holding
a circuit board so you can access both sides of the board.
Jumper wires. These are short pieces of wire with the ends stripped
for use in breadboard projects. To make your own jumper wires, strip
about 1⁄2 inch off both ends of varying lengths of different colored wire.
Clip leads. These are pieces of wire with alligator clips on each end
that are used to make connections on a temporary basis.
5
SHOP SETUP AND SAFETY
In This Chapter
●● Creating a well-lit, organized, and well-equipped shop
●● Being prepared and having good work habits
●● Avoiding electrical dangers
●● Dealing with emergencies
N
o matter where your electronics shop is located—in your basement
or garage, at school, or in a professional shop—you must make safe-
ty your highest priority.
If you’re working in a professional shop or school, it already has safety
rules in place, many dictated by the U.S. Department of Labor’s Occupa-
tional Safety and Health Administration (OSHA) or your country’s work-
place safety regulator. The guidelines discussed in this book are general in
nature and not at all comprehensive.
Ask your supervisor for any safety manuals and acquaint yourself with
the rules before starting work.
This involves ensuring you have adequate space, good lighting and ventila-
tion, and well-organized tools.
Your Workbench
Your workbench should be large enough to hold your instruments and
still leave enough work space. The desk or benchtop should be made of
a nonconductive material such as wood or hardboard, a synthetic surface
that is a good all-purpose material. Any materials labeled as ESD (electro-
static discharge) are good, as they dissipate electrostatic charge. Avoid steel
benches, as they conduct electricity.
Adequate Power
Specialty workbenches usually have built-in power outlets. If you don’t
want to spend the money on a specialty bench, be sure to situate your unit
near adequate power sources. Try to use a circuit of your home that you
don’t have to share with appliances that draw a lot of current like heaters,
mini-fridges, or freezers.
Lighting
Make sure that you have adequate lighting. Clamp-on lamps are good
for spot lighting, but also make sure you have good general overhead light-
ing. Overhead fluorescents are easy to install and fairly inexpensive solu-
tions for basement and garage setups.
Ventilation
Good ventilation is essential. Soldering can release lead oxide from
the solder and the flux (especially in lead-free solders) can release ir-
ritants. If you don’t have access to a window or door to dilute the fumes,
you might want to consider purchasing a fume extractor. Small home-use
extractors, which cost less than $100, are available from home centers or
online sources.
Storage
Having a good organization system not only makes work easier but also
helps keep you and your equipment safe. Tangled cords can become frayed
or develop shorts from being bent. Grabbing the wrong tool or component
can be disastrous. Improperly stacked equipment can topple over, resulting
in injury or damaged equipment.
When working with a tight budget, don’t shortchange safety. You
can get by without expensive furniture or fancy storage systems, but
never skimp on safety equipment or safety procedures.
HIGH VOLTAGE
Safety Equipment
You must have a good fire extinguisher. Check to make sure it can han-
dle Class C (electrical) fires. A water extinguisher is not going to suppress
an electrical fire; in fact, it can cause a much bigger fire.
All fire extinguishers list which fires they are rated for. Dry chemical
and carbon dioxide (CO2) extinguishers will both extinguish electrical
fires, but CO2 extinguishers will not leave residue on your components.
Unfortunately, CO2 extinguishers tend to be more expensive. To deter-
mine which is right for you, balance the initial cost against the likelihood
of damage.
Protective eyewear is essential. Glasses or shop goggles protect the
eyes from wire snips that might go flying when you are cutting or strip-
ping wires.
Grounding straps and a grounding mat (also called antistatic straps and
mat) help keep you and your equipment from damage by discharging any
static electricity that may build up.
ly can keep you on task. Put things back where they belong when you
are done. Most importantly, be careful about where you set things down.
Don’t pile components, wires, and instruments on top of each other
while you work. You could short out your circuits, start a fire, or damage
your equipment.
wet hands. Sweaty hands decrease resistance even more, as the salty
water of sweat is more conductive than plain water.
ELECTRONIC
COMPONENTS
T
his part gets into some of the workhorse components of electronics:
switches and resistors. Every circuit will rely on them so you need
to understand the various types and how they are represented on
circuit board diagrams.
And once current is flowing to the components of the circuit, you need
to be able to fine-tune the flow. Capacitors and diodes make sure that the
flow is just so, avoiding spikes and drops. Capacitors can also store power to
provide quick bursts when needed.
Since their invention in the 1950s, transistors have been as important to
electronics as the portable scientific calculators they made possible. Tran-
sistors enable you to control the amount of current that flows through a cir-
cuit, diverting it or even reversing it. Their invention and use made possible
modern communication and all of the other great electronics advances of
the twentieth century. Transistors’ ability to manipulate the flow of electric-
ity has enabled electronics to create logic gates that can be used to make
calculations, which is the very basis of modern computers.
6
SWITCHES
In This Chapter
●● Using a switch to open and close a circuit
●● Making sense of poles and throws
●● Identifying different types of mechanical switches
●● Getting acquainted with relays
A
switch is the most basic component in a circuit. It has the basic
function of interrupting the current flow and creating an open (or
broken) circuit. You are already familiar with some switches, such
as light switches and on/off switches on any of your electric or electronic
devices. Other switches include keys on a keyboard and buttons on a car
stereo.
Switches always control simple open/close operations; they are not used
for fine-tuning varying levels of current in a circuit. Switches also are es-
sential to the many sub-circuits in more complicated devices.
Switch Symbols
On a circuit board, switches are represented as being either open or
closed, as shown in the following illustration.
Mechanical Switches
One of the most basic types of switches is a mechanical switch. The
conductive parts of mechanical switches are called contacts. When in the
closed state, the contacts allow current to flow through the circuit. A me-
chanical force is controlled by an actuator, which brings the contacts to-
gether or apart. The force required to move the actuator is called the actua-
tion force.
There are a wide variety of mechanical switches available, and each of
them is represented by a specific symbol on circuit boards. The following
sections describe some of the more common mechanical switches.
switch that controls two circuits—one to the light and one to the fan—has
one throw, so it is a double-pole, single-throw (DPST).
Think of poles as the number of things that can be controlled, and the
throws as the actions needed to make the connections. So if you have a
simple on/off switch that controls three circuits, it is a triple-pole, single-
throw (TPST) switch.
(a)
(b)
(c)
FIGURE 6.2 The symbols for SPST, SPDT, and DPST switches on a circuit diagram.
Materials:
9V battery
1 SPDT switch
1 breadboard
2 small lamps
Jumper wire
Instructions:
To do this lab, you need to know how to use a breadboard, an essen-
tial piece of electronics equipment that provides a convenient way to make
non-permanent, solderless connections between components.
A breadboard has a top and bottom portion called a power rail. Each
power rail has two rows of connection plugs. Whether you are using a
battery or power supply, you connect your power in these rows. Keep
the positive lead connection on the top left and the negative lead (for a
battery) or GROUND (GND) lead (for a power supply) connection on
the bottom left.
Each individual hole in the breadboard is called a cell, and the various
cells can be connected plugging jumper wires into them.
The two larger rows between the power rails are the work areas where
you will make your circuit connections when you need more than just a
power connection.
Now that you know how to use a breadboard, let’s get started:
Push-button Switches
In a push-button type switch, the mechanical force either makes the
connection between the contacts or breaks it. Push-button switches are
classified as either normally open (n.o.) or normally closed (n.c.). An n.o.
push-button is a push-to-make switch, meaning that when you push the
button it makes the contact, closing the circuit. An n.c. push-button is a
push-to-break switch, meaning that the contact is made until you push the
button, making a break in the circuit.
A similar way to classify switches is as either break before make (BBM),
which is the same as an n.o. switch, or a make before break (MBB) which is
the same as an n.c. push-button switch.
Knife Switches
A knife switch is an SPST switch. It is constructed of a strip of conduc-
tive material with an insulated handle on a hinge. When the hinge is closed,
the circuit is closed as well. When it is opened, the circuit opens and the
flow of current is interrupted.
This basic switch doesn’t have many applications in home electronics,
but think of a simple switch in a movie laboratory, like the one Dr. Franken-
stein used to create his monster. Large high-voltage switches, like the main
power switch in industrial or commercial settings, are examples of modern
uses of knife switches.
Bi-metal Switches
A bi-metal switch is made of two different metals with different sensi-
tivities to heat. The metals are coiled together in layers and can rotate as
heat rises due to the metal’s expansion when heated and its contraction in
response to the metal’s cooling. When the rotating coil reaches a certain
contact point, it activates a switch. Bi-metal switches are very important in
heat regulation applications, such as in an oven or in an automobile’s tem-
perature control.
In high-power situations, there is a danger of arcing (pronounced
ARK-ing) as contacts come apart. The insulating air between the
contacts can become ionized and the gas/current mixture forms an
electric arc. There are several ways to prevent this potentially dan-
HIGH VOLTAGE gerous and destructive event. One technique is to enclose the switch
in an insulating gas mixture, such as sulfur hexafluoride; another is
to use a magnetic blowout that redirects any arc.
Mercury Switches
A mercury switch is operated by the gravitational effect on a ball of
mercury in a vacuum tube. The mercury will always go to the lowest part
of the tube. If the tube is rolled to the side, the mercury will change where
it makes contact. The advantages of this type of switch are that it will not
DIP Switches
One type of switch that you won’t see as a visible part of many con-
sumer applications is a dual-inline-package (DIP) switch. It is a series of
switches in one unit that can be set individually.
In the past, this type of switch was often used on printed circuit boards
to allow for the manual adjustment of the settings. There are still many
industrial uses for this type of switch. DIP switches can be any of a number
of different mechanical switch types, but the term DIP switch refers to this
type of setup. When you add a resistor into a circuit, the power (current ×
voltage) that flows out of the resistor is less than the power that entered it.
Resistors dissipate the power through heat radiation and are classified by
the amount of resistance they provide.
7
RESISTORS
In This Chapter
●● Using resistors to control current
●● Making sense of the many types of resistors
●● Reading a resistor’s color code
●● Using Ohm’s Law to calculate resistance
R
esistors are electronic components that increase resistance. They
work against the flow, reducing the amount of current in a portion
of a circuit.
Resistors dissipate the power through heat radiation and are classified
by the amount of resistance they provide.
Resistors dissipate the current through heat and are classified by the
amount of energy they can dissipate. Most resistors are made of ceramic or
other materials that radiate heat at a predictable rate.
Fixed-Value Resistors
A fixed-value resistor, sometimes simply called a fixed resistor, is a com-
ponent designed to provide a stable resistance. There are several types of
fixed resistors, including carbon-film, metal-film, ceramic, and wire-wound.
Each relies on layers of resistant materials and is categorized by size, level
of resistance, and tolerance.
two stripes are the significant digits (the digits to the left of the decimal
point), whereas the third digit is the exponent value (the powers of ten).
The formula for calculating the resistance is as follows: AB × 10x, where
A represents the first significant digit, B represents the second significant
digit, and 10x is the exponent of the 10 value.
The fourth stripe of the resistor code, if present, represents the stated
tolerance of the resistor. If there is no fourth stripe, the tolerance is plus
or minus (±) 20 percent. This means that the resistor may provide up to 20
percent more or 20 percent less resistance; so with a resistor with a value of
100Ω, its true range is anywhere from 80Ω to 120Ω.
The following table shows the resistor colors and their assigned values:
mation on the power of 10). To calculate the resistance level, you multiply
64 times 1,000, giving you a value of 64,000Ω.
Let’s consider a resistor that is marked, from left to right, yellow, violet,
and red. The first band is yellow, so the first digit is 4. The second band is
violet, which represents 7. The third stripe is red, which represents 102. So
we would have a resistor value of 47 × 102 or 4,700Ω. As there is no fourth
band, the tolerance is ± 20 percent.
Only the tolerance band can be gold or silver, so if that is the first
band you see, flip the resistor over and start reading the code
WATTAGE TO THE WISE
from the other end.
Power Ratings
Resistors are classified not only by their resistance but also by their
power rating, which represents the highest amount of power a resistor
can withstand. As currents travel through the resistor, heat is released.
If you use a resistor with too low of a power rating, it can fail or cause
damage.
The power rating is given in watts (W). Because watts are a unit of
power and not current or voltage, to determine the appropriate power rated
resistor for your projects you need to calculate the wattage of your circuit.
To solve for watts, you divide the voltage in volts squared by the resistance
in ohms.
Carbon-film and metal-film resistors are usually available in a range
from 1⁄8 to 2W. Usually, the larger the physical size of the resistor, the
higher the power rating. Wire-wound resistors are used where higher
wattage ratings are needed, as they can have a power rating range from
1W to 10W.
Variable Resistors
Some resistors do not carry a fixed resistance value and are called vari-
able resistors. Types of variable resistors include thermistors (variable due
to temperature) and photoresistors (variable due to levels of light), also
known as photocells. Another variable resistor is the varistor (variable +
FIGURE 7.3 The SIL resistor pictured here has nine resistors, each delivering 47Ω. The code reads 470, which
equals 47 × 100, or 47.
Kirchhoff Õs Laws
To calculate the proper resistance to use in a particular part of a circuit,
it is necessary to look at the energy in that circuit. You already know that
voltage pushes electrons, creating an electrical current. To understand what
happens when you introduce resistance to that current, let’s look at another
foundational concept of electronics: Kirchhoff’s laws.
Calculating Resistance
In Chapter 2, you learned about Ohm’s Law, which states that the cur-
rent (I) between two points is directly proportional to the voltage (V) and
inversely proportional to the resistance (R). You learned that as an equa-
tion, it is written I = V/R, and that if you have any two of the variables, you
can solve for the other: V = R × I or R = V/I.
Based on this law, as you construct a circuit, you have three variables to
consider: voltage, current, and resistance. In practice, you will encounter
components that have specified current and voltage levels for their opera-
tion, and you will need to use Ohm’s Law to calculate the amount of resis-
tance that must be provided between the power supply and the component.
In other words, you will be solving for R. The equation for solving for R is R
= V/I, which means to find R, you need to divide the voltage by the current.
Here is a basic example. You have a 5V power supply that provides
500mA of current. If you want to construct a circuit that uses a c omponent
that requires no more than 20mA of current, you can solve for the resis-
tance needed by dividing 5V by .02A. The desired resistance would there-
fore be 250Ω.
Notice that the values for the current in the preceding example were
expressed in milliamps (mA) instead of amps. As you work on electronics,
not all values will be expressed as amps (A), volts (V), or ohms (Ω). You are
regularly going to encounter values such as mA or micro-amps (μA). To do
any calculations, you need to make sure that you convert your variables into
like terms. So if you are dealing with 8V and 500mA, you need to convert
your mA to A by either expressing the number as .5A or 500 × 10–3A. To
keep units expressed in standard metric numbers, remember to use engi-
neering notation (see Appendix D).
To help you with these conversions, consult the following table for a list
of basic metric prefixes and their values:
Once you know the level of resistance needed in the circuit, you can
use the right resistors to achieve the total resistance required. You need to
consider the resistance of the components and then combine different val-
ues of resistors to achieve the overall resistance required. Remember that
resistors have different tolerances, so there may be a variation of up to 20
percent. Most circuits are designed with those variations in mind, but some
will require more precise values.
LAB FIGURE 7.1 Attach the jumper wires to the battery as shown.
You should see that by using Ohm’s law, you have created circuit that
provides adequate voltage and current without overwhelming the toleranc-
es of the load. The LED lights and there is no excessive heat or damage to
the LED.
Materials:
Digital multimeter (DMM)
Breadboard
Jumper wire
Three resistors with values of 470Ω (yellow violet brown), 100Ω (brown
black brown), and 270Ω (red violet brown)
Instructions:
1. Place the resistors in a series on the breadboard exactly as shown in the
diagram.
2. Place the jumper wire on the breadboard as shown.
3. Put the black lead in the COM jack of your meter.
4. Put the red lead in the jack labeled V Ω.
5. Move the selector dial to the Ω position on the meter.
6. Touch the two probes, one to each jumper wire, coming off the bread-
board. The value you get will vary depending on the tolerance of your
resistors, but it should be close to 840Ω.
Instructions:
1. Place the resistors in parallel on the breadboard as shown in the dia-
gram.
2. Place the jumper wire on the breadboard as shown in the figure.
3. Put the black lead in the COM jack of your meter.
4. Put the red lead in the jack labeled VΩ.
5. Move the selector dial to the Ω position on the meter.
6. Touch the two probes, one to each jumper wire, coming off the bread-
board. The value you get will vary depending on the tolerance of your
resistors, but it should be close to 63Ω.
FIGURE 7.7 The symbol for a voltage division circuit on a circuit diagram.
LAB FIGURE 7.3 A voltage divider circuit using fixed a value resistor.
Materials:
DMM
1 breadboard
1 9V battery
Jumper wire
1 470Ω resistor
1 100Ω resistor
Instructions:
1. Use the formula Vout= Vin (R2/R1 + R2) to calculate the resistors required
to produce an output voltage of 7.4V (Vout = 7.4V). To achieve that we are
using two resistors valued at 100Ω (labeled R1 and 470Ω (labeled R2).
Plug the numbers into the formula: 7.4V = 9V (470/100 + 470).
2. Connect the resistors in series as shown in the diagram.
3. Using jumper wires, connect the DMM probes to the bottom and top
leads of the bottom resistor, labeled R2, as shown in the diagram.
Materials:
DMM
1 breadboard
1 9V battery
Jumper wire
1 100Ω resistor
1 photocell
Instructions:
1. Starting from the setup from the previous lab, disconnect the battery.
2. Replace R2 with the photocell.
3. Reconnect the battery.
4. Move your hand to cover the photocell and watch how the voltage out
(Vout) changes on your DMM display. This is because the value of the
resistance of the photocell changes depending on the amount of light it
is exposed to.
8
CAPACITORS
In This Chapter
●● Using capacitors to store charge
●● Understanding the inner workings of capacitors
●● Getting acquainted with electrolytic, non-polarized, and variable
capacitors
●● Charging and discharging capacitors
C
apacitance is the ability to store charge (electrons). A capacitor,
also sometimes called a condenser, is an electrical component that
can store charge. Capacitors are used for many purposes, includ-
ing smoothing out spikes or drops in voltage and releasing quick bursts of
power in applications such as a camera flash.
a positive charge and the other layer with an excess of electrons yielding a
negative charge. The net charge of the capacitor is zero.
When current flows through the capacitor, it charges the capacitor so
that the voltage matches the source voltage. Once the capacitor is charged,
the voltage that flows through the capacitor is the same as the voltage that
enters it.
A capacitor maintains a constant voltage, and the process is often called
smoothing the current. It accomplishes this by using its storage capacity—
its capacitance—to either donate or accept electrons when there is a drop
or a spike in voltage.
Capacitors can be dangerous to work with. In some common elec-
tronic devices, capacitors hold enough charge to be fatal, and they
can hold a charge for quite some time after the device it is con-
nected to no longer works. Always assume that capacitors are fully
HIGH VOLTAGE
charged and can release their full charge.
If there is a voltage drop in a circuit, the capacitor will push elec-
trons toward the direction of the source voltage, acting as a voltage
source. This may seem counterintuitive because we are used to thinking
of electrons flowing in a single direction, from the positive to the nega-
tive terminals of a power supply. But electrons also flow “backwards” in
a circuit if the charge in the capacitor is positive compared to the voltage
entering the capacitor. Electrons are still flowing positive to negative,
but until the charges match, the capacitor acts as the source voltage
until it has exhausted its capacitance.
FIGURE 8.1 The parts of a capacitor. Note that the dielectric is the area between the two layers that holds
the electric fields.
FIGURE 8.2 A capacitor can act as a source when there is a dip in power.
FIGURE 8.3 A capacitor can act as a load when there is a spike in power.
Farads
Differences in the dielectric medium determine the amount of charge
that can be held in the electric field of the capacitor. The measure of ca-
pacitance is the farad, represented by an F. A farad is equal to the current
in coulombs required to raise the voltage across the capacitor by one volt.
Relative Permittivity
Different dielectric materials provide varying levels of capacitance, as
shown in the following table. Remember that the dielectric is the insulating
material in a capacitor that stores charge. Permittivity is the ability to create
Capacitor Ratings
Beyond the materials used to create a capacitor, other factors need to be
considered when choosing a capacitor. Each designated value for a capacitor
also has tolerance, with the performance varying some percentage higher
or lower. In addition, higher or lower temperatures can change the permit-
tivity of the dielectric. Capacitors have maximum circuit voltages, so even
if the capacitor has the proper capacitance, it won’t be appropriate for your
particular circuit if the voltage of the circuit exceeds that maximum voltage.
Each of these factors needs to be considered when choosing a capacitor.
Temperature Coefficients
A capacitor’s performance can vary with the operating temperature.
Capacitors are sometimes marked with a temperature coefficient, usually
given as parts per million (ppm)/°C. The temperature coefficient of (100
ppm/°C) is equivalent to .01 percent/°C.
Temperature coefficients are also usually assigned a negative or positive
value. A positive temperature coefficient means that there is a positive corre-
lation between the temperature and capacitance; in other words, an increase
in temperature increases the capacitance and a decrease in temperature
decreases the capacitance. A negative temperature coefficient means that
the capacitance decreases when the temperature increases and vice versa.
There is a negative correlation between the temperature and capacitance.
Electrolytic Capacitors
Electrolytic capacitors are a type of polarized capacitor that uses an ion-
ized conductive liquid as one of the conductive layers or plates. An alumi-
num electrolytic capacitor is made of two layers of aluminum foil, with one
of the layers covered in a thin film of oxide separated by a paper insulator
soaked in an electrolyte solution. The coated layer and the soaked paper in-
sulator form a cathode (from which electrons flow), whereas the non-coated
layer acts as the anode (into which electrons flow).
Tantalum Capacitors
A tantalum capacitor is a specific type of electrolytic capacitor. The tan-
talum capacitor was developed by researchers seeking a more stable ca-
pacitor that has still a high capacitance relative to its volume. Tantalum (a
lustrous metal element) powder is formed into a pellet and coated in an
oxide layer. Then a conductive material or an electrolytic solution “plate”
surrounds the pellet and the oxide layer. The result is a polarized capacitor
that has a high capacitance with higher breakdown voltages and a potential
life span of decades.
Tantalum resistors are used in many compact devices or in situa-
tions where long-term reliability under high-temperature conductions is
necessary.
including voltage environments, cost, size, tolerance, and life span. The fol-
lowing table lists some common dielectric materials and their properties:
Variable Capacitors
Some capacitors can be adjusted to increase either the area between
the plates or the amount of overlap between the plates. Applications of vari-
able capacitors include digital tuners, sensors in industrial applications, and
capacitor microphones, which adjust their volume according to the effect
of sound on a diaphragm.
Capacitors in a Circuit
Unlike with resistors, when you combine capacitors in a series circuit,
the sum of the capacitance is less than the capacitance of the individual ca-
pacitors. The formula used to calculate capacitance in a series is shown here
(note that this is the same formula used for resistors in parallel).
When you combine capacitors in parallel, the total capacitance is the
sum of the individual capacitances. Again, this is the opposite of the behav-
ior of resistors in parallel.
When a circuit first has current flowing through it, a capacitor has not
yet charged. A capacitor will let current flow through as it charges. A fully
discharged capacitor acts as a short circuit; there is no voltage drop as the
current flows.
When a capacitor is fully charged, the voltage of the capacitor matches
the source voltage and current will not flow. In other words, a fully charged
capacitor acts as an open circuit.
FIGURE 8.7 Calculating capacitance in series, where CT represents the total capacitance and C1, C2, and so
on represent the first and the second capacitors in the series.
FIGURE 8.9 The transient time from zero to approximately fully charged.
Materials:
9V battery
Breadboard
1 470Ω resistor (yellow violet brown)
1 220μF electrolytic capacitor (or cap)
1 red light-emitting diode (LED)
Jumper wire
Instructions:
1. Place the components on the breadboard as indicated on the diagram.
Note that the resistor doesn’t have polarity so it can be connected to
the breadboard in either direction. The LED needs to be connected to
the resistor on its positive lead. (Note: The flat side of the LED is the –
side.)
2. Connect the capacitor at its positive lead. (Note: The cap has + and –
marked, and the longer lead is +.)
3. Connect the jumper wires to the battery. The LED lights up for about
one second, then slowly dims. This is the capacitor charging. To repeat
the lab, first disconnect the battery, then discharge the capacitor by
touching a jumper wire between the two leads of the capacitor. Then
start again.
nn When working with capacitors, you should always assume that the ca-
pacitor is fully charged and could potentially cause injury or damage the
circuit and its components.
nn Capacitors are of two conductive plates with an insulating layer, called
the dielectric, between them. The type of material used for the dielec-
tric affects the capacitance.
nn Capacitors are either in the steady state (fully charged or fully dis-
charged) or are in the transient state. You can determine the charging
(or discharging) time if you know the current and the resistance in the
circuit.
1. In a capacitor, the area where an electric field is held is called the
.
2. is the storage capacity of a capacitor.
3. True/ False. If there is a voltage drop in a circuit, the capacitor will
push electrons toward the direction of the source voltage, acting as a
voltage source.
4. If there is a/an in voltage from the voltage source, the
capacitor will resist that change by storing the excess electrons up to its
rated capacitance.
5. Rank these 3 materials by increasing relative permittivity: air, glass,
hard rubber. , , .
6. If a capacitor has a code of 453D, the nominal value is .
7. The same capacitor has a tolerance of .
8. A capacitor is designed to operate in just one direction in
a circuit.
9. True/ False. When you combine capacitors in parallel, the total capaci-
tance is the sum of the individual capacitances.
10. The time between when a capacitor is fully discharged to when it is
fully charged is called the time.
9
DIODES
In This Chapter
●● Using diodes to allow current to flow in a single direction
●● Classifying diodes by their voltage drop, peak inverse voltage, and
recovery time
●● Distinguishing between P-N diodes, Zener diodes, Schottky diodes,
light-emitting diodes, and photodiodes
●● Using diodes as power rectifiers
D
iodes are components that permit electricity to flow in a single
direction and act against its flow in the opposite direction. They
have two terminals: a positive terminal, also called an anode, and a
negative terminal, or cathode. While this seems like a pretty basic function,
diodes have been used to do some revolutionary things.
Diodes are the technology that made early radio transmission and re-
ception possible. They are essential in converting alternating current (AC)
to direct current (DC). They prevent damage to electronics from high volt-
ages. The use of diodes to create logic gates makes possible the computa-
tions that are the backbone of computers. Your digital camera’s flash de-
pends on diodes. All of these functions are based on the ability of a diode to
determine when to let current through, when to block current, and when it
will send a big jolt of current back through a circuit.
Before the diode can function properly, it first needs to be “turned on.”
When current is first applied, there is a forward voltage drop that needs to
be overcome. This is the amount of current that is necessary before current
can pass through the diode. This forward voltage drop is .7V in diodes made
of silicon and .3V in germanium diodes.
Until this forward voltage drop is overcome, the diode acts as an insula-
tor (it doesn’t permit any current to pass through) even if it is of the correct
polarity. When the diode does overcome the forward voltage drop, it is then
“turned on” and only allows the passing through of current in one direction.
This direction is called the bias of the diode. The time it takes to overcome
the forward voltage drop is called the recovery time.
The word cathode is derived from the Greek kathodos, which means
descent or way down. This also is the reason for the abbreviation k.
WATTAGE TO THE WISE
When the diode encounters current of the opposite polarity, the diode
acts as an insulator. It is this ability to block current in one direction and
allow it in the opposite direction that gives diodes so many uses.
A diode’s insulating effect is not limitless. It is subject to a peak inverse
voltage (PIV). This is the highest amount of voltage in the reverse bias the
diode can withstand before failing. This is like the amount of pressure that
the valve can stand before bursting. Once the PIV is exceeded, the number
of electrons can overwhelm the P-N junction. This is called breakdown.
Usually, breakdown occurs in higher values, typically 50V or more.
Be sure to pay close attention to your diode’s PIV rating to avoid
breakdown. In most cases, if breakdown occurs, the component con-
taining the diode and any other components on the circuit will be
HIGH VOLTAGE destroyed.
Zener Diodes
A Zener diode depends on a precise PIV to act as a type of voltage-de-
pendent switch. These are sometimes called constant voltage diodes. When
the PIV is reached, current can travel in the reverse direction. It is a type
of avalanche diode, which is any kind of diode that depends on a surge in
voltage for the reverse current flow.
Zener diodes are used in surge protectors to protect against spikes.
They are usually used with a resistor to limit the current so the maximum
current parameters are not exceeded.
FIGURE 9.2 A silicon diode. The stripe indicates the location of the cathode within the glass tube.
FIGURE 9.3 The symbol for a diode on a circuit board diagram. It refers to any common diode; if a particular
diode construction is required, it will be represented by that specific symbol.
FIGURE 9.4 The symbol for a Zener diode on a circuit board diagram.
Titans of Electronics
Clarence Zener (1905–1993), the American physicist for whom the
ener diode was named, was an innovator in many areas of applied phys-
Z
ics beyond his work with electronics. His colleague at Carnegie-Mellon,
Hubert Aaronson spoke very highly of his importance: “Zener is a rare,
strange genius. He’s an unbelievably talented innovator. He’s able to go in
to a fresh field, swiftly comprehend the central issues, address them as a
theoretical physicist in a simple but incisive way and make, in a matter of a
few months, important and useful contributions.”1
Schottky Diodes
Schottky diodes are constructed with a metal-semiconductor design. A
conducting metal and a metal-oxide film are attached to an n-type semicon-
ductor. This construction provides both a very low voltage drop (typically
between .15V and .45V) and a very fast recovery time.
Titans of Electronics
Walter Schottky (1886–1976) was a German physicist at Siemens. Many
scientific achievements have been named after him, including the Schottky
effect, the Schottky barrier, Schottky contact, the Schottky anomaly, and
the Schottky diode.
FIGURE 9.6 The symbol for a Schottky diode on a circuit board diagram.
(a)
(b)
Schottky diodes are often used as power rectifiers, but their proper-
ties also make them ideal components in radio-frequency circuits and other
specialty applications. In the supplemental files, please see Animation 9 to
see an animated bridge rectifier in action.
Power Rectifiers
As noted at the beginning of this chapter, diodes can be arranged to act
as AC-to-DC power rectifiers. A bridge rectifier is a type of rectifier con-
sisting of a series-parallel arrangement of diodes that ensure that only one
polarity of current is the output no matter the polarity of the input current.
This may seem like a very complicated construction, but if you want to
see how an AC-to-DC rectifier works, it is important to work through the
two images. In the first figure, during the positive half cycle of the AC wave,
the current flows through the white diodes (forward biased) and DC flows
out of the rectifier.
In the negative half cycle of the AC wave (second figure), the current
travels through the black diodes (reverse biased) and is returned through
the rectifier to the AC source instead of passing to the DC out. This means
that only current in the correct direction (DC) passes through the bridge
rectifier.
FIGURE 9.8 The symbol for an LED diode on a circuit board diagram.
Photodiodes
A photodiode is a specialty diode that detects light. In other types of
diodes, the P-N junction area is usually shielded from light, so light energy
doesn’t interfere with the function of the diode. A photodiode is designed
to register light energy and so is not shielded from light.
Whenever you see the prefix photo-, you know it is about light. A
few other prefixes to keep in mind when working with electron-
ics vocabulary: hydro- relates to water; chrono- relates to time;
WATTAGE TO THE WISE chromo- relates to color; and tele- relates to a distance.
Handling Diodes
Handle diodes with care. It is usually a good idea to use your multime-
ter to test your diode to ensure that it is operating before soldering it into
your circuit.
Always pay attention to the polarity of the leads, as diodes function
correctly only when properly polarized. The positive lead (anode) may be
labeled with an “a” and is slightly longer. The negative lead (cathode) may
be labeled with a “k” and is slightly shorter. As these differences are small
and usually require a magnifying lens to read, a better method of telling the
anode from the cathode is to look for the flat side of a round diode assem-
bly. The flattened side is the cathode. We recommend looking for at least
two of these three features before soldering.
As diodes are easily damaged by heat, extra care should be taken when
soldering them. It is usually a good idea to use a heat sink clipped to the
lead between the soldering joint and the diode body.
5. A diode can block the opposite polarity and act as an insulator until the
is reached.
6. A diode (sometimes called constant voltage diodes) is
a type of avalanche diode that allows current to travel in the reverse
direction once PIV is reached.
7. True/ False. A power rectifier takes DC power in and sends AC power
out.
8. In LEDs, when electrons combine with the holes of specialized mate-
rial, energy in the form of are released.
9. An I-type semiconductor is a/an semiconductor, meaning
that it is a material that has excited electrons even when no dopant is
introduced.
10. When identifying the polarity of a diode you can use three methods,
identify two. and .
10
TRANSISTORS
In This Chapter
●● Using transistors to amplify signals
●● Distinguishing between bipolar junction transistors and field effect
transistors
●● Applying voltage to transistors and the effects
●● Looking at specialized FETs developed for cutting-edge applications
A
transistor is an electronics component that amplifies signals or acts
as a switch in a circuit. Transistors enable us to control the amount of
current that flows through a circuit, diverting it or even reversing it.
Prior to the invention of the transistor in the first half of the twentieth
century, electronics were dependent on vacuum tubes, which were bulky,
expensive to produce, not very rugged, required a lot of power, and gave off
quite a bit of heat.
FIGURE 10.1 Circuit diagram symbols for an PNP BJT and an NPN BJT.
Gain
The amplification effect in a transistor is called a gain. The equation
representing the gain is:
Voltage gain = VOUT / VIN.
The gain is represented by βFE or by hFE. There is a proportional rela-
tionship between the gain and the base current, represented as
βFE = IC / IB.
That is, the gain in current over a transistor is the current at the collec-
tor divided by the current at the base.
Darlington Pairs
Darlington pairs are two transistors sold as one with the leads arranged
as if they are a single unit. This arrangement allows for much more signifi-
cant amplification and is used in situations where gains in the order of 1,000
are called for.
a BJT-type transistor; the drain functions the same as a BJT collector; and
the source does the same work as a BJT emitter.
The gate opens and shuts depending on the voltage applied. The source
to drain area is the channel through which current travels when the gate
allows connection between the two areas. There are two general types of
FETs: enhancement or depletion mode. These modes are further catego-
rized by their bias (n-type or p-type). Further classification is made based
Materials:
1 9V battery
Breadboard
1 2N2222 NPN transistor
1 red LED
1Ω resistor (green blue brown)
Jumper wire
Instructions:
1. Connect the components as shown in the diagram.
2. Use Ohm’s law to calculate the current provided by the circuit with-
out the use of a transistor. The resistance of the human body when
dry is around 100,000Ω. The LED has a voltage drop of 2V. So I = (9–
2)/100,000 + 390 (I = V / R). I = .00007A (.7mA).
3. The LED requires 20mA of current to light, so without an amplification
of current we wouldn’t be able to light the LED.
4. Touch the two leads, each in one hand.
5. Even with the addition of your body’s resistance to the circuit, the lamp
will light due to the transistor amplifying the current to the required
20mA.
nn Field effect transistors (FETs) have four key parts: the body, the gate,
the source, and the drain.
nn There are many specialized FETs used in medical, chemical, and quan-
tum computing applications
11
POWER SOURCES AND
POWER SUPPLIES
In This Chapter
●● Making sense of the many different types of power sources and
supplies
●● Creating a chemical reaction in a voltaic cell to produce energy
●● Turning electricity from a main power source into usable power
●● Getting acquainted with specialized power supplies
T
his chapter is all about power—specifically, power sources and pow-
er supplies. Although the two terms sound quite similar, they have
distinct meanings.
A power source provides electricity. In electronics, we work with two
primary power sources: direct current (DC) voltage from stand-alone bat-
teries and alternating current (AC) power, also called AC mains, provided
by the electric utilities. Each of these sources can provide electricity to a
power supply.
A power supply is the power source in a circuit for a particular electronic
device, whether that source is a battery, a power outlet, or a small circuit that
adapts power from an outlet to the appropriate voltage needed for the device.
Batteries
Batteries—from the tablet-sized cells that power our watches and cell
phones to the large units in our cars—are stand-alone power sources that
don’t rely on electricity from wall outlets.
Instead, they produce electrical energy through a chemical reaction.
Titans of Electronics
The Italian physicist Alessandro Volta (1745–1827) is credited with cre-
ating the first working electrochemical voltaic cell. He was made a count
by Napoleon in 1910, and the Voltian Temple was created in his honor in a
museum in Como, Italy.
Voltages in Batteries
Each cell in most common battery types produces 1.3 to 3V, but across
most battery types, the voltage is usually 1.5V. The chemical construction of
each cell determines its voltage. This is why some battery types are not inter-
changeable in different applications. For instance, because rechargeable AA
batteries made with nickel cadmium produce 1.25V and alkaline AA batter-
ies produce 1.5V, they cannot be used together to power an electronic device.
Multiple cells are often contained in a battery to produce different volt-
ages. When you see a 9V battery, think of it as having six cells (6 × 1.5V = 9V).
Materials:
Digital multimeter (DMM)
Clip leads
1 potato
1 dime
1 penny
Instructions:
1. Push the edge of the dime halfway into the potato.
2. In a spot about 2 inches away from the dime, push the edge of the
penny halfway into the potato.
3. Connect the probe leads to your meter: black to COM and red to VΩ.
4. Attach the clip leads to the meter probes.
5. Clip the lead that is attached to the COM or black probe to the penny.
6. Clip the lead that is attached to the VΩ or red probe to the dime.
7. Move the dial to V DC. The DMM should register a very low voltage
reading. You have just made a battery.
FIGURE 11.3 Batteries in parallel. You can see that the resistance of each battery, .2Ω each, is reduced by
this arrangement to an overall resistance of just .04Ω. The voltage overall is not increased, it remains at 2.2V.
Amp-hours
Batteries are usually categorized by their voltage, but they are also cat-
egorized by their amp-hours (AH). An amp-hour is a unit of energy capac-
ity; it is equal to the amount of continuous current in amps per hour that
a battery can provide before depletion. You will also see energy capacity
described in milliamp-hours (mAH).
The discharge time for a battery depends on the load on the circuit.
Lighter loads take longer to discharge than higher loads. The ratings given
by battery manufacturers vary according to operating conditions (tempera-
ture, age of the battery, amount of heat lost to resistance in a circuit, and
so on), but you can get the approximate hours of operation by dividing the
amp-hour rating by the continuous current (in amps).
Transformers
As noted in the preceding section, transformers reduce or increase AC
voltage. They do this through the operation of mutual induction. A trans-
former consists of two coils (also called windings) separated by a laminated
iron core. AC power is applied to the first coil, creating an electromagnetic
field in the core. A secondary current is transferred to the second coil.
The secondary current isn’t conducted across the core, however, in-
stead, it is induced through electromagnetism.
SMPS constantly switches very quickly between on and off, using this rap-
id switching to manage the various voltages in a computer instead of having
specified voltage levels constantly delivered as in so-called “linear” methods.
SMPSs are much more complex than other power supplies, but they
are also more efficient. They are able to provide high current for modern
computer processing units (CPUs) and can handle a greater range of input
and output voltages. An added benefit of SMPSs is that they are less likely
to draw power when switched off.
GETTING TO WORK
N
ow that you have a grasp of the major electronics components, it’s
time to learn how to connect them together in a circuit. But to do
that, you need to know how to use a soldering iron and solder.
This part also explains the different types of power sources, from potato
batteries to more practical power supplies you can use in your projects. By
the time you’re done with this part, you’ll have made your own direct cur-
rent (DC) variable power supply.
12
SOLDERING
In This Chapter
●● Connecting parts of a circuit with solder
●● Getting acquainted with your soldering iron
●● Using flux to prevent oxidation and improve the solder connection
●● Working with circuit boards
●● Desoldering poorly executed joints
S
oldering is an ancient art, dating back to at least ancient Egypt, where
soldering was used in creating jewelry. It is the use of a material (sol-
der) to create a joint. For electronics, the process is specifically used
to create joints that allow for the conductivity of electricity and to protect
against water movement through a joint. It is done by applying a melted
layer of filler material (solder) to bridge the joint. Unlike welding, which
melts the base metals to combine the two components being joined, solder-
ing melts only the solder that forms the joint between components.
Soldering is used in a number of non-electronic applications, including
plumbing, jewelry making, creating the separation between colored glasses
in stained glass, and attaching flashing on roofs. Each of these applications
has different requirements with regard to the type of solder and flux used
and the temperature needed to make the joint. Some tools and techniques
overlap among the various soldering applications, but soldering in electron-
ics has particular requirements to achieve optimum results.
Solder
Solder is a wire-shaped alloy sold in spools. The most commonly used
solder in electronics is a 60/40 alloy of tin and lead, which has a melting
range of 183° to 190°C (361–374°F).
Lead-free Solder
Increasingly, governments around the world are prohibiting the use of
lead in the manufacture of electronics because of the negative health con-
sequences associated with lead ingestion. Lead can also damage the envi-
ronment when it is released into the environment in the manufacture or in
the recycling of electronics.
Manufacturers are quickly moving to lead-free soldering, and even
hobbyists should prepare for the eventual phase-out of lead alloys. Because
most lead-free solders are even less eutectic than our 60/40 tin/lead stan-
dard, they require better technique to form a good solder joint.
Flux
In soldering, flux is a compound that prepares a surface base metal
so that it can be joined efficiently with solder. It is often said that flux is a
cleaning agent to prepare components for soldering, but it doesn’t clean
dirt and grime. Instead, it reduces oxides to prevent oxidation during the
soldering process. When heat is applied to copper, oxidation often occurs,
preventing the formation of a good solder joint. Flux prevents the oxidation
process.
Flux also assists in wetting, which is the process of reducing the surface
tension of the base metal so that the liquid solder can make better contact
with it. To get a better sense of wetting, think of a bead of water on a newly
waxed car. The water forms a bead because of the greater surface tension
of the waxed surface; in other words, the water does not make good contact
with the surface. Flux prevents beading of solder, enabling the solder to
adhere as a flat droplet instead of an angled bead.
Solder is often sold already combined with flux, in the form of rosin-
cored or flux-cored solder. This is often all the flux you need in a basic
printed circuit board (PCB) solder. If you are working with surface-mount
soldering, you may also want to prepare the surface of the PCB and the
component itself with additional liquid flux.
Rosin is a pine tree resin that has been used as flux for many hundreds of
DEFINITION years for its ability to reduce friction.
electronics, you should look for a relatively low-power unit (25–50W) that
can accept a variety of tips and comes equipped with a stand and an on/off
indicator light. Our iron also has a place for a sponge for wiping off any sol-
der residue after each use. If yours doesn’t come with a sponge, you’ll need
to buy one and keep it on hand when soldering.
You will also want at least two different types of tips: one with a flat
head much like a screwdriver (this is the one that will come with your iron)
and one with a fine point. Tips are usually made of a copper core because
of copper’s conductivity. The tips are then covered with iron, chrome, and
nickel to provide hardness and better high-temperature performance.
Read the manual that comes with your iron before beginning to use it to
find out how to properly attach your tips and other advice operating the iron.
FIGURE 12.5 YouÕll want a flat-head tip (left) and a fine-point tip (right) for your soldering iron.
Heat Sink
A heat sink is used to protect heat-sensitive components from damage
during the soldering process. Basically, it is a piece of metal that increases
the surface area available for the release of excess heat. As we discussed in
Chapter 4, there is a specific electronics tool called a heat sink, but you can
also use alligator clips for this purpose.
Circuit Boards
The type of circuit board you use to construct your circuits depends
on how permanent of a project you are creating. When you’re doing quick
labs or constructing test circuits and plan to reuse the board, a breadboard
is the best choice because it enables you to experiment without making
permanent connections.
When you are repairing electronics, you will likely encounter only sur-
face-mount PCBs, so you’ll need to become comfortable soldering on these
types of boards.
Electronics manufacturers often use multilayer PCBs to connect
multiple circuits compactly. Because of the layered construction, it
is difficult to access the connections, effectively making most home
HIGH VOLTAGE repairs unfeasible.
Surface mounts can be more difficult to work with because it’s not as
easy to keep the components in place while you are soldering them together.
One trick is to melt a bit of solder on the solder pad, place the component
before the solder cools, heat the component’s lead, and then apply more
solder. Prepping the areas to be soldered on the PCB with liquid flux prior
to soldering can be helpful as well, because the flux helps prevent solder
bridges (unintended joints) between part leads that are very close together.
1. Make sure your iron’s tip is clean and shiny. Know which part of the tip
is the proper work area.
2. Prepare your sponge by dampening it (not soaking it until it is dripping
wet).
3. Turn your iron on. Follow your manufacturer’s instructions for the
proper settings for the solder you are using.
4. Wipe the iron’s tip on the damp sponge and apply a bit of solder to the
tip to tin it. Tinning helps in the even heat transfer from your iron to
the solder, so even if your tip is pre-tinned, it’s a good idea to re-tin
every time you wipe the tip with the sponge. You can also buy tinner,
which is a dip-in product that cleans and tins tips.
HIGH VOLTAGE
Irons are hot! Follow these safety tips when soldering:
■■ Don’t touch a hot iron’s tip.
■■ Don’t leave a hot iron unattended.
■■ Don’t set a hot iron on anything but its stand.
■■ If you get burned, follow basic burn first aid.
■■ Wait until the iron has cooled completely before storing it.
■■ Know where your fire extinguisher is. Be sure it is rated for electrical
fires (Class C) and is up to date.
■■ Keep the iron’s power cord out of the way so you don’t risk tripping over it.
Soldering Technique
A steady hand is always your best tool. Hold your iron like a pen, with a
comfortable, relaxed grip. Then follow these steps:
Desoldering
If any solder joints are cracked, incompletely connected, or overlap
onto other components or traces, it’s best to start over, remove the solder (a
process called desoldering), and then try again.
Keep in mind that melted solder can cause severe burns. Always
wear protective eyewear, avoid loose clothing, and use caution when
soldering.
HIGH VOLTAGE Follow these steps for desoldering:
1. Clean the area around the solder joint. Again, steel wool should do the
job nicely.
2. Gather your tools: soldering iron, solder sucker, and soldering wick.
3. Heat the joint to melt the solder.
4. Depress the plunger on the solder sucker; when the solder melts, use
the solder sucker to take up the solder. This may be the only step you
need to take to remove all of the solder.
5. If there are bits of solder left, heat a portion of solder wick (enough
to hold the remaining solder) and place it on the remaining solder. It
should suck up the remaining solder.
6. Clean the area with steel wool to remove any remaining rosin or solder
bits.
1. Solder
2. Soldering iron
3. Heat sink
4. Flux
5. Rosin
6. Solder sucker
7. Solder wick
8. Breadboard
9. Tracing
10. PCB
13
CONSTRUCTING A
POWER SUPPLY
In This Chapter
●● Building a variable direct current (DC) power supply from a kit
●● Studying the schematic
●● Producing various DC voltages
●● Troubleshooting common problems
A
variable power supply is an essential tool for any student of electron-
ics. You can buy one already assembled, but this chapter teaches you
how to construct one using a kit. Doing it yourself gives you hands-
on experience producing an electronics project using the tools you’ve gath-
ered and provides you with an opportunity to apply some of the concepts
you’ve learned up to this point.
or another) you can practice your soldering skills and gain some hands-on
experience with the components in a power supply.
Basic kits generally range from $25 to $40.
Using the set of instructions that comes with the kit, assemble the pow-
er supply. If you accidentally break a part, you can order replacements (see
the instructions for details). But if you follow the instructions and use a heat
sink on the diodes, you shouldn’t have any problems.
This power supply uses household alternating current (AC) for its
power source. Household AC mains in the United States deliver
current at 120V; worldwide, the range is 100V to 250V. Serious
injury or even death can result from electric shock at these voltages.
HIGH VOLTAGE You should not be terrified of working around AC, but you need to
be alert and double-check everything you do.
FIGURE 13.1 The top of printed circuit board (PCB) diodes and the heat sink. Note the placement of the
diodes and how to apply the heat sink before soldering.
FIGURE 13.2 Bottom of the PCB. Note the leads and the copper traces and the first soldered joints in the
upper left side of the PCB.
FIGURE 13.3 Finished top view. Your supply will look like this when completed.
FIGURE 13.4 Finished bottom view. DonÕt forget to place the feet to raise the power supplyÕs conductive
traces. Even with the feet applied, we recommend only using your power supply when it is placed on a non-
conductive surface.
Safety First
Turn over the power supply. Do you see those traces—the copper lines
in the PCB? Each one is conductive. To keep things safe, use a large wood-
en cutting board as a work surface. Be very careful about where you place
your hands and test probes when the power is on.
These traces can carry live current; if they come into contact with
another conductive surface, such as your skin or metal, they can
cause an electrical shock.
We also recommend using a power strip that has an on/off switch as
this power supply does not have its own power switch—the only way
to turn it off is to unplug it. Using a power strip will save wear and
tear on the power cord.
Another good practice is to use test probes with clips that will hold
HIGH VOLTAGE the probe in place so you don’t have to hold it in place by hand. This
way you can place your test probes where they need to be with the
power off and step back before turning the power on. This process
can help you build confidence in what you are doing as well. Re-
member, people work safely with AC power every day.
Powering On
After you’ve assembled the kit, it’s time to start exploring what you can
do with your new power supply.
First, plug the power supply in to a power strip with the switch turned
off. Then turn the power strip on.
You should see LED1 light up; if not, there is a problem. Refer to
the instructions that came with the power supply for troubleshooting
tips. In addition, you can check the following for commonly encoun-
tered problems:
nn Is the LED properly installed in the proper position?
nn Is the power cord connected correctly?
nn Check for the proper placement of C1 and C2 the + and –.
nn Check for 18.5 VDC across C1. Attach the black probe to the – side and
the red probe to the + side, and set your DMM to VDC. Be sure to also
check the same across C2.
FIGURE 13.5 Schematic of the assembled power supply. Note the use of the circuit diagram symbols you
have learned so far. (Courtesy of Jameco)
First, let’s look at the schematic of the assembled power supply that’s
included in the instructions.
The filled dots are test points. They are labeled TP1 through TP26.
1. Using your DMM, place the black probe on TP3 and the red probe on
TP2.
2. Set your DMM to VAC (volts AC).
3. Turn on the power. You should have a reading of around 12.6VAC. This is
the effect of the power supply’s transformer stepping down the 120VAC
from the mains to 12.6VAC, as described in Chapter 12.
4. If you have an oscilloscope, place the probe on TP4 and place the
ground clip on the circuit ground (labeled GND on the schematic). You
should see a positive pulsing waveform (also known as a rippling DC
wave).
5. Ripples or pulses, which are variations in the current, occur when the
current has not yet been smoothed by the capacitors. The power supply
at this point has removed the negative portion of the AC, but it is not yet
ready to be used as a DC power source.
6. Even though this current needs to be further smoothed by the power
supply, it does provide power to the LED, letting us know that the
power is on.
1. With the power to the supply turned off, connect your DMM to the
power supply: The red lead to the +DC terminal and the black lead to
the ground (labeled GND in the next illustration).
2. Attach the black probe to the COM on the meter and attach the probe
end to the GND post of the power supply.
3. Attach the red probe to the VΩ on the meter and attach the probe end
to the + post of the supply.
4. Set the meter to read DC voltage.
5. Turn the power on and see what output you have.
Try to adjust the output voltage. You can adjust this by using the settings
knob of R3. You should see the output voltage changing. If not, check the
following:
nn Are either IC1 or IC2 installed backward? If yes, they will need to be
replaced, as they were most likely destroyed. You will need to reorder
new ones using the part numbers provided in the instructions.
nn If the output stays high, check for proper solder on R3 and R4.
FIGURE 13.8 +DC and ground on your power supply, along with the R4 adjustment for DC output.
nn If the output is not constant or is hard to adjust, check for the proper
placement of C3, C4, CR3, and CR4.
The other settings knob, R4, changes the negative output voltage.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
GOING DIGITAL
T
ransistors were quite a leap in the history of electronics, but another
equally revolutionary development was the application of binary val-
ues to the on/off (well, really high- and really low- voltage) states,
and the idea of representing questions in logic to electronic circuits. The
following chapters explain how digital electronics work and how you can
put them to work for you.
You will learn about integrated circuits, which are simply multiple cir-
cuits miniaturized and combined on a single chip. You will next learn how
memory stores data as well as the instructions for running digital devices.
You will be able to understand that writing a program is speaking to a ma-
chine in its own language.
Microcontrollers are amazing digital tools. They are small computers
designed to work in embedded devices, including your own electronic proj-
ects. They have a streamlined construction and are easy to customize.
14
DIGITAL THEORY
In This Chapter
●● Using binary digits in electronics
●● Distinguishing between analog and digital electronics
●● Representing logical operations with truth tables
●● Using logic gates to control circuits
T
he idea of linking the binary digits 1 and 0 to high-voltage and low-
voltage levels, respectively, made possible revolutionary changes in
how we use electronics. Great strides had already been made in elec-
tronics prior to this digital revolution, especially in the field of communica-
tions and the launch of radio and television. But once digital concepts were
overlaid on electronics theory, the pace of change in technology accelerated
to warp speed.
Titans of Electronics
Claude Shannon (1916–2001) is considered the father of digital
circuits, but his impact goes much further. His work at Bell Labs
and MIT with electronics, cryptography, and mathematics provided
inspiration to generations of future engineers.
Shannon was quite a character, and often invented contraptions for
pure enjoyment: a motorized pogo stick, a rocket-powered flying disk,
and a mechanical mouse that could solve a maze. He would ride his
unicycle through the halls of Bell Labs while juggling balls. He and a
fellow MIT professor enjoyed taking their mathematical research on
trips to Las Vegas to test drive some theories at the blackjack table and
roulette wheel. Unfortunately, his final years were spent in the fog of
Alzheimer’s, but his lasting impact remains perfectly clear.
FIGURE 14.1 An analog wave (top) and its digital equivalent (bottom).
A digital signal can be much more compact than its analog counterpart,
which means it requires fewer resources to transmit, receive, or store. A
digital signal is also less likely to be affected by noise.
Truth Tables
The most common questions asked about a relationship of numbers in
Boolean logic can be expressed by the following logical operations:
nn NOT: negation
nn AND: conjunction
nn OR: inclusion
nn NOR: neither/nor
nn NAND: not both
nn XOR: exclusive
nn XNOR: equality
Truth tables can be created for each of the logical operations you just
learned. Let’s look at AND. The operation AND is true only if both op-
erands are true—in other words, only when both operands are 1. Stated
another way, the operand 0 represents false and the operand 1 represents
true. So false AND false is false; true AND false is false; false AND true is
false but true AND true is true.
The operation OR is false only if both operands are false—that is, only
when both operands are 0.
The operation NOR is true only if both operands are false—only when
both operands are 0.
The operation NAND is true only if at least one of its operands is false.
One operand must be 0 and one must be 1.
Two common operations of Boolean logic that we use in electronics re-
quire two inputs: XOR or “exclusive-OR” and XNOR or “exclusive-NOR.”
These operations compare the two inputs and ask a question about them.
Here is the truth table for XOR. Looking at the two inputs, the output
is true if one (and only one) of the inputs is true.
The XNOR gate is the inverse of XOR. For XNOR, looking at the two
inputs, the output produces a value of true if and only if both operands are
false or both operands are true.
The field of logic takes some getting used to. It all makes sense—it is
logic, after all—but only if you work deliberately through each state-
ment. This is not a problem for electronic signals; they simply do what
their circuit tells them to do. When working with logical statements,
WATTAGE TO THE WISE designers and programmers use tools such as truth tables to keep their
ones and zeroes straight.
Binary Numbers
Binary numbers are distinct from Boolean numbers. Binary numbers
use the same two digits as Boolean numbers, but binary numbers are real
numbers that represent values beyond 0 and 1. (See Appendix C for details
on working with binary numbers.) A binary system can represent numbers
from the base 10 system (our familiar numbering system with digits from 0
to 9) with a string of binary zeroes and ones. Binary number representations
A bit is a binary digit. Four bits are called a nibble. A set of eight bits is a
DEFINITION byte.
Application to Electronics
So why do you need to know about binary numbers and Boolean opera-
tions? Because of the real-world application of these concepts to electron-
ics. You’ve already learned that, using diodes and transistors, you can create
circuits that can pass through no (or relatively low-) voltage or relatively
higher-voltage signals.
If you go back to the idea of a computer as something that performs
computations, you can see that creating a series of questions or logical op-
erations could get you to a result. Of course, the number of operations re-
quired to perform even simple tasks would require lots of these operations
and, therefore, lots of circuits.
Logic Gates
Each of the circuits that do these computations contains gates. In digi-
tal or logic circuits, the gates are called logic gates. Each gate gives one
output but can have multiple inputs.
NAND gates and NOR gates are known as universal gates because
given enough combinations, they can mimic the function of any other logic
gate. A NOT gate is also called an inverter because it inverts one signal into
the reverse.
When you begin designing your own circuits or doing your own
programming, you need to think like a circuit or a computer. It is
important to map out the processes step by step.
Designers and programmers often use flowcharts to represent the
WATTAGE TO THE WISE
inputs and the decisions at each step. As you start out in electron-
ics, get in the habit of planning things out. You might be going
high-tech, but a pencil and paper can still be your most useful tools!
FIGURE 14.10 Symbols for various logic gates on a circuit board diagram.
Materials:
1 9V battery
2 single-pole, single-throw (SPST) switches
Jumper wire
1 flashlight bulb
Instructions:
1. Connect the jumper wires as shown in the diagram to the two switches,
the light bulb, and the battery.
2. Turn on SW1 to turn the light bulb ON.
3. Turn on SW2 to turn the light bulb ON.
The circuit is constructed so that if SW1 = ON AND SW2 = ON, then
TRUE. The true answer is represented by high voltage so it turns the light
ON.
4. Now let’s generate a FALSE output by turning off SW1. This yields a
FALSE (or low voltage) because with SW1 = OFF, it is not true that
both are on. The result would be the same if both were turned off, as
they both need to be ON to be TRUE.
1. Connect the jumper wires as shown in the diagram to the two switches,
the light bulb, and the battery.
2. Turn on SW1 to turn the lamp ON.
3. Turn off SW1 to turn the lamp OFF. The light bulb will light because if
we ask the question SW1 = ON OR SW2 = OFF, the answer is TRUE.
4. Turn on SW2 to turn the lamp OFF.
5. Turn off SW2 to turn the lamp ON. Again, the light bulb will light be-
cause if we ask the question SW1 = OFF OR SW2 = ON, the answer is
TRUE.
1. The binary digits one and zero are linked to voltage for
one and for zero.
2. True/False A sound wave can only be represented by a digital wave.
3. Two benefits of using digital signals mentioned in the text are:
and .
Give the name of the logical operation that express the relationship
below:
4. Negation
5. Inclusion
6. Equality
7. Not both
8. Conjunction
9. Equality
10. Neither/ Nor
15
INTEGRATED CIRCUITS
In This Chapter
●● Integrated circuits (ICs)
●● Analog ICs
●● Digital ICs
●● Mixed signal circuits
A
n integrated circuit (IC) is a miniaturized circuit that rests on a semi-
conductor base, also known as a chip. Modern ICs can contain many
millions of transistors all in a compact package. ICs can be analog,
digital, or a mix of analog and digital signals.
ICs are manufactured on a mass scale, so we won’t address their con-
struction, but they are a part of almost any modern electronic device. There
were ICs in your power supply project (see Chapter 13) and they will be on
most other project shopping lists as you work in electronics.
Each of the ICs discussed in this chapter have standard functions and
are common tools in the electronics toolbox. Other ICs are designed for
specific applications.
Analog ICs
Analog ICs work with varying levels of voltages, not simply high or low
voltage. They are used in sensors, timers, and power management and as
Digital ICs
Digital ICs, also called logic ICs, range from very simple circuits that
process a single input from a light sensor to chips that can perform millions
of logic operations. Digital circuits perform one of two types of functions:
decision making using logic gates or memory storage.
You can compare the computing and storage of ICs to the same
ability in the human brain. Our brains process data (sensing,
processing, and decision making), give an output and then store
the whole matter into our memory to recall for future use.
Engineers are working toward achieving an artificial re-creation
WATTAGE TO THE WISE of these abilities in the field of artificial intelligence. Neurobi-
ologists are also analyzing just how our brains do what they do.
Imagine the possibilities if scientists are able to create electronic
models of human decision making.
Flip-flops
As you’ve seen so far, a logic gate is designed to produce just one output.
It’s possible, however, to arrange a circuit that will have the output feedback
to the input; that is, the gate constantly feeds its output value back around
to the gate as an input value. These types of gates are called multivibrators.
One use of a multivibrator is a flip-flop. A flip-flop is used to store a
single bit in either a high or low state. It can be created by arranging the
connections so that the output provides feedback that keeps it in that state
of either high or low. This is essential to the concept of storing memory (see
Chapter 16 for more on memory). A flip-flop has two outputs, labeled Q
and not-Q. The symbol for not-Q is a Q with a horizontal line over it.
The primary output, Q, holds the logic state of the flip-flop. The output
at not-Q is a complementary output, so it holds the opposite value. If Q is 1,
not-Q is 0. When Q is 1, the flip-flop is in set mode; when Q is 0, the flip-
flop is in reset mode.
FIGURE 15.5 A D flip-flop circuit diagram symbol; note the symbol for the not-Q output.
FIGURE 15.6 A storage register is composed of four D flip flops connected to a clock input.
s ynchronized signals. The more sophisticated the operation, the more pre-
cise the timing must be.
There are many methods of providing a clock or timing input, some
involving the oscillation of different crystals or nuclear materials, but in
most electronic devices a specialized IC known as a timer is used. Timers
rely on the frequency of an outside supplied voltage to create a signal that
is fed back to the system using digital logic. Two common logic ICs are
the 555 and 556 timers. Each has three operating modes that can perform
many functions. A 555 IC has 8 pins (leads or connectors) and the 556 has
14 pins.
FIGURE 15.7 The symbol for a 555 timer on a circuit board diagram.
FIGURE 15.8 The symbol for a 555 timer on a circuit board diagram.
These timers have three distinct modes. In astable mode, the 555/556
pulses a continuous square wave at the frequency you set. It is called astable
because the output is constantly alternating between two states. Some uses
include any sort of pulsing circuit, such as flashing light-emitting diodes
(LEDs) or clock pulses.
In bistable mode, the output stays at one state until a triggering input
switches it to the other state. This can operate a switching circuit or a flip-
flop.
Operating in the monostable mode, the output remains low until a trig-
ger event, and then a single pulse of high voltage is output. This can be used
to overcome the electrical noise from the bounce of a switch (the energy
created by the mechanical operation of a switch) by sending a reverse pulse,
or in any application where a triggering event is needed.
Counters
ICs can act as counters. Counters are used to count the number of
pulses to then trigger another operation or to provide information back into
the system. There are two main types of IC counters: ripple and synchro-
nous. A ripple counter counts through a series of flip-flops. Each output
state cascades to the next. A synchronous counter uses a single clock pulse.
Ripple counters count on the falling edge of each square wave, and
synchronous counter counts on the rising edge of each square wave. Many
basic counters use binary-coded decimal (BCD).
100 characters that could be input into your computer. Instead of each key
having a direct input into your computer’s central processing unit, an en-
coder transmits the character name in BCD, binary, or hexadecimal via the
encoder chip’s single output.
Each value represents a character in ASCII (American Society for Code
Information Interchange) or the more recent Unicode standards (UTF-8 is
the current Unicode standard). These systems are standards for communi-
cating on the web and via e-mail. UTF-8 encodes each character in one to
four octets (8-bit bytes). The first 128 characters of the Unicode character
set (which correspond directly to ASCII) use a single octet with the same
binary value as in ASCII. The first 32 characters in ASCII (and UTF-8) are
nonprinting control characters such as ESC and DEL.
The following ASCII chart gives the binary, octet, decimal, hexadeci-
mal, and keyboard character values.
ASCII Values
Binary Octet Decimal Hexadecimal Character
100 0000 100 64 40 @
100 0001 101 65 41 A
100 0010 102 66 42 B
100 0011 103 67 43 C
100 0100 104 68 44 D
100 0101 105 69 45 E
101 0111 127 87 57 W
101 1000 130 88 58 X
101 1001 131 89 59 Y
101 1010 132 90 5A Z
101 1011 133 91 5B [
101 1100 134 92 5C \
101 1101 135 93 5D ]
101 1110 136 94 5E ^
101 1111 137 95 5F _
Materials:
Breadboard with 5Vdc power supply
4 or 8 dual-inline-package (DIP) switches
1 7448 decoder
7 270Ω resistors
1 common cathode 7-segment LED display
Jumper wire
In this lab, you will learn to use a schematic instead of a picture show-
ing the components on the breadboard. You should recognize many of the
symbols from previous labs, like the 270Ω resistors between the decoder
and the LEDs, but in this case, the LEDs are all in the 7-segment display.
Schematics may seem complicated to read at first, but they give you all of
the information you need. They are also much less cluttered than the same
circuit shown as a photograph. Compare the schematic below with the pho-
tograph of the same circuit in the photograph following the schematic.
Before we leave you to your own devices with a schematic, let’s take
the time to learn a bit more about using a breadboard. In the lab in Chap-
ter 6, you learned about the power rails of the breadboard (the outer two
horizontal rows on the top and bottom) and that the two larger work areas
in the middle are where you should build your circuits. Note: When we talk
about rows and columns, we are looking at the breadboard aligned so that
the breadboard is wider rather than taller. So how do you get the power to
the work area?
From the power rail row (horizontal), use a jumper wire to connect to a
cell in the work area. When you add power to the work area, all of the cells
in the column (vertical) you place the jumper wire in will now have power.
Keep this in mind as you construct your circuit. Leave enough room to fit
all of your components along the rows so you don’t cross columns that are
connected to an earlier powered column or component lead.
Be sure to connect your circuit to the power rail that leads either to the
negative end of your battery or the ground lead of your power supply.
On the 7448 decoder, you will need to be able to find pin 1. This is
where you will start making your connections. If you look at the following
figure, you see that pin 1 is on the top left of an IC on the side where this
Instructions:
1. Before assembling your circuit, make sure your power supply is off.
2. Use the breadboard to connect the circuits as shown in the diagram.
Make sure you connect the ON side of the DIP switch to the correct
pins of the 7448 decoder. The resistors are labeled R1-7.
3. Connect your power supply to your breadboard. See the following figure
to identify the +DC and GND terminals. The wire from the +DC terminal
should connect to the top row of your breadboard, and the wire from the
ground (GND) terminal should connect to the bottom row of your bread-
board.
1 100KΩ resistor
1 1MΩ resistor
1 10μF electrolytic capacitor
1 0.01μ capacitor
Jumper wire
Instructions:
1. Before assembling your circuit, make sure your power supply is off.
2. Remove the DIP switch.
3. Follow the schematic to add the timer IC (labeled S1) and the decade
counter IC (labeled S2) as shown in the schematic.
4. Turn on your power supply. The numbers on the display should change
every four seconds. When it is running, the counter goes from 00002 to
11112 (decimal numbers 0 to 15). With just a single display, numbers con-
taining more than two digits (9 and above) are represented by symbols.
LAB FIGURE 15.2 (1) Schematic of our modified circuit, replacing the DIP switches with a timer and a
decade counter.
LAB FIGURE 15.2 (2) Your display will show the digits 0-9, and then a series of symbols to represent the
digits 10-15.
Materials:
1 perf board
¼ inch mono audio jack
0.01µF capacitor
LM386 op amp (operational amplifier)
8-pin socket
5KΩ potentiometer
100µF electrolytic capacitor
220µF electrolytic capacitor
10Ω resistor
0.047µF capacitor
25Ω rheostat
9V battery
9V battery connector with leads
8Ω speaker
Guitar to test amp
Perf board has pre-drilled holes covering the entire board. There are
solder pads on every hole, but none of the solder pads are connected to one
another. You solder your components in place and then connect them to
each other by soldering pieces of wire to make the connections.
Instructions:
1. Attach the 8-pin socket to the board. This is the most delicate part of the
project.
2. Place the rest of the components on the circuit board as indicated by the
schematic and diagram, but don’t solder them yet. First, expose the last
inch or so of wire on each of the leads that are marked as GND. Then
twist the wires to make a connection between them all. Now you can
solder them together.
3. Use the other component leads to connect them to the appropriate pins
of the socket, the speaker, and the other components.
4. Use some jumper wire to connect pins 3 and 4 to the interconnected
ground leads. Connect the lead of the negative terminal of the battery
connector to the ground leads. Connect the positive terminal lead to the
junction of pin 6 and the 100µF electrolytic capacitor.
LAB FIGURE 15.3 (1) Schematic for the guitar amp project.
LAB FIGURE 15.3 (2) Diagram of the perf board with all of the components attached.
16
MEMORY
In This Chapter
●● Digital vs. analog storage
●● Data and addressing
●● Writing and reading
●● Volatile and nonvolatile memory
●● Storage media
I
f we had written this book 10 years ago, we would probably have titled
this chapter “Computer Memory,” but memory is now an essential ele-
ment of most modern digital electronics. From the computers that run
your car’s various systems, to the digital picture frame on your desk, to the
greeting card you pick up at the drug store, digital memory storage has
made its way into all sorts of consumer and industrial products. Advances in
chip design and manufacturing are leading to cheaper, bigger, more stable
memory, and less power consumption every year.
While your beginner electronics projects may not involve a great deal
of memory, if you do any further study of electronics or plan to create more
complicated projects, you will have to use memory. Almost all modern elec-
tronics have at least a small amount of memory, and the dividing lines be-
tween computer and electronic devices are becoming more meaningless.
seven bits out of eight to allow for the addition of a parity bit. Before a byte
(which is 8 bits) is transmitted, the digits representing the data are added
together and determined to be either even or odd. The parity bit is then
occupied with either a 1 or a 0. When the byte is transmitted, the parity
bit travels along with the data. When the data is received, the parity bit is
checked and bytes that don’t match the parity are discarded and an error
message is created.
Hexadecimal
Everything we have talked about so far when discussing digital cir-
cuits and memory has been linked to binary numbers. However, many
computer designers and programmers use a base-16 numbering system
called hexadecimal. Hexadecimal allows us to store more data in fewer
bits.
Hex digits range from 0 to 9, and the additional digits are represented
by the letters A to F. Each nibble (four bits) can hold a hexadecimal value
that can represent up to 65,535 in decimal (6553510, base-10). That same
number would be 11111111111111112 in binary (base-2) and FFFF16 in
hexadecimal (base-16).
FIGURE 16.1 Conversion chart for binary, digital, and hexadecimal numbers.
Just because you store something doesn’t mean you can find it.
Think of the dreaded junk drawer you may have in your kitchen
or a basket of laundry. Each of those storage places can store
things but do not have system to find anything. It is not an ef-
ficient system.
Now think of a filing cabinet with files arranged alphabetically or a
WATTAGE TO THE WISE datebook that stores appointments chronologically. Each of those
has an addressing system. If you know the system, you can easily
find what you are looking for. Memory addressing methods are like
a filing system. They describe where data are stored so that they
can be retrieved later.
There are two primary methods used in memory addressing: stack data
architecture and dynamic memory allocation. With stack memory, data are
stored in stacks of memory on a last-in, first-out basis. Data just keeps on
getting stored without any check to see if enough space is available. It is fast
and simple, but it is subject to error when more memory is allocated than is
available; this is called a stack overflow error.
With dynamic memory allocation, memory is allocated as the programs
run. Available memory is taken from the heap (a supply of available memo-
ry storage locations). This approach is subject to the fragmentation of data,
which happens when the available memory is scattered and only available
in separate locations. This can slow the retrieval of the data when it is frag-
mented widely.
Titans of Electronics
John Von Neumann (1903–1957) was a Hungarian-born mathematician
who came to Princeton University in 1930 and was part of the founding
faculty of Institute for Advanced Study (along with other notables including
Albert Einstein and Kurt Gödel).
The Von Neumann model owes much to the theories of Alan Turing
and others, but he definitely had a major role in the adoption of the archi-
tecture as a standard. Von Neumann contributed to many fields includ-
ing math, economics, mechanics, quantum theory, and many scientific and
mathematical concepts bear his name.
The Von Neumann model consisted of three main portions: the CPU,
the input and output (I/O) subsystems (all of the I/O devices), and the
memory. These building blocks are all connected by a system bus, the data
bus, and the control bus.
Memory Registers
Remember that data are stored in an IC called a memory register,
which is part of the CPU. The two primary types of memory registers are
the Memory Address Register (MAR) and the Memory Data Register
(MDR). The MAR holds the location and the instructions; the MDR stores
the actual data. When data are fetched, they are moved to the Memory Buf-
fer Register (MBR) which is a holding position, then on to the Instruction
Register (IR) where the specified programming instruction is performed.
Storage Media
Several types of media are available for storing memory. These in-
clude magnetic storage on tapes; magnetic storage on disks (hard drives);
optical storage on removable disks; and flash (which is a type of electri-
cal erasable programmable ROM, or EEPROM); and other solid-state
memory (that is, media storage that doesn’t require any moving parts).
Each storage type has drawbacks. Magnetic storage can be corrupted
by exposure to magnetic fields (either electromagnetic or natural mag-
nets). Hard drives can suffer from mechanical failure. Optical storage
can degrade because of the chemical characteristics of the storage disks
themselves. Flash memory can degrade after multiple reprogramming
and is expensive relative to other memory types. Each type can be pro-
tected against these threats, and flash memory is becoming more afford-
able per byte of memory. New types of solid-state memory are being
developed, each trying to become a near-perfect universal memory.
17
MICROCONTROLLERS
In This Chapter
●● Microcontrollers vs. computers
●● Understanding how microcontrollers are made
●● Programming microcontrollers
●● Shopping for microcontrollers
M
icrocontrollers (MCUs or μCs) are self-contained, embedded
computers. When a computer or device is embedded, it means
that it is integrated into the operation of that device and isn’t avail-
able for purposes outside of that device. Everyday devices, from micro-
waves to your television remote, have microcontrollers that enable these
devices to execute commands based on inputs and generate outputs that
are customized to the operation of that particular device.
Microcontroller Components
Typical microcontroller components include a CPU, serial I/O ports, mem-
ory (both volatile for data storage and read-only memory [ROM] or flash mem-
ory for instructions) and usually an analog-to-digital converter (ADC). Other
components can include timers, clock generators, and event counters.
Inputs/Outputs
When choosing a microcontroller, be sure that there is an adequate
number of I/Os for your project and that they are of suitable types. Most
should have both analog and digital I/Os. A computer-compatible I/O for
programming is useful, as well. Most use a universal serial bus (USB) or
micro USB connector. If you have a particular project in mind, you can
research how many I/Os that project will require.
Titans of Electronics
Ajay V. Bhatt is the creator of the USB I/O. You may have seen him on
Intel’s “rockstar” commercials, or at least an actor portraying him. Coming
from a middle-class family in India, he moved to the United States to study
at the City University of New York. As a consumer himself, he became frus-
trated at having different connectors for his computer and saw the need for
a universal connection device. He and his team at Intel developed the USB
as a universal connector for computers and other devices and peripherals,
as well as specialized software to make connections. Now USB connectors
are used on all sorts of devices.
He also was part of the team that developed other I/O interfaces, in-
cluding the Accelerated Graphics Port (after he saw a need) and the PCI
Express, two interfaces for graphics cards. Mr. Bhatt has appeared on The
Tonight Show with Conan O’Brien and in India GQ, where he was listed as
one of “50 Most Influential Global Indians.”
Programming Microcontrollers
Microcontrollers must be coded with instructions that the CPU under-
stands. The most basic instructions must be in machine code or machine
language, which is made up entirely of zeroes and ones. As machine lan-
guage is very unwieldy, assembly language is used to translate basic com-
mands into machine language. Assembly language is considered a low-level
programming language. Low-level languages are more widely applicable to
any computing environment, but they are much more difficult to program.
Programmers usually use high-level programming languages and then use
a compiler to translate the source code of the high-level program language
into assembly language.
ELECTRONICS
IN PRACTICE
H
ere is where the action is. We’ve learned about how electronics
can be used to perform instructions in a computer, but when we
want to have a circuit or a series of circuits interact with the world
around it, we want to add motors, sensors, transmitters, and receivers.
In this next section, we will learn about motors and controlling motors
to move or control mechanical operations. We will discover that sensors
can be used to measure movement, interact with global positioning systems
(GPS), sense direction with magnetometers, and sense gas, light, move-
ment, and pressure. Electronic communication can be with signals across
the electromagnetic spectrum, from radio waves all the way to gamma rays.
This will set us up for our next and final section, applying all we’ve
learned to build a robot that can put your newfound skills to use.
18
MOTORS AND
CONTROLLERS
In This Chapter
●● Understanding brushed and brushless direct current (DC) motors
●● Using stepper and servo motors
●● Controlling motors using pulse width modulation (PWM)
●● Controlling motors using H-bridge circuits
T
o get your electronics to do some work, you need to enlist the aid
of motors. You can use electronic controls to regulate the current
to drive the motor. Choosing the right motors and control systems
enables you to move, make, and drive your designs in a deliberate and ef-
fective manner.
It is easy to get lost in all of the discussions of new digital devices
and think that electronics is all about computing and home entertain-
ment, but electronics is so much more than these gadgets and consumer
products. Electronics play a large role in manufacturing, transportation,
energy (production, delivery, and heating/cooling), medicine, and yes,
computers and home entertainment. If you are planning to pursue a ca-
reer in electronics, you need to understand how electronics interact with
things that move. If you want to build remote control cars, airplanes, or
bomb disposal robots, you need to make them move—and motors are
what make things move.
Brushed DC Motors
A basic brushed DC motor operates through the use of a commu-
tator, brush, and armature assembly. A magnet, called a stator, is fixed
in place, and the armature is arranged so that it can revolve inside the
stator’s magnetic field. In Chapter 12, you learned about induction, and
how a conductor inside of an electromagnetic field can generate an AC
electrical current. In a motor, this process takes place when the armature
(which is a conductor with a wire attached) revolves inside the magnetic
field of the stator.
We now have a wire that is conducting current. When a wire is carry-
ing a charge, it creates its own electromagnetic field. When the armature
(think of it as the motor’s arm) has a charge applied by a DC power source,
it rotates 180° inside the larger magnet because of the interaction of the
magnetic fields (like charges repel and opposite charges attract, causing a
180° spin). This rotational force is called torque.
Brushless DC Motors
Brushless DC (BLDC) motors operate without a commutator or brush-
es. Instead, they use electronic controls to apply reversals of polarity to the
armature.
The lack of a mechanical commutator and brush system reduces the
motor’s weight, which translates into a lower power consumption and less
friction. In other words, these motors are more efficient. The downside
is that the electronic controls make BLDCs more expensive than conven-
tional brushed motors.
The current-to-torque ratio in brushless motors is linear. This means
that proportional increases in current will result in proportional increases in
torque. There isn’t a loss due to friction, which affects the performance of
brushed motors. This makes BLDC motors the preferred choice when preci-
sion applications are involved. There is also less opportunity for sparking as in
brushed motors and there is a significant reduction in the mechanical noise.
BLDC motors are used in many consumer electronics applications, in-
cluding computer hard drives and CD/DVD drives.
Stepper Motors
A stepper motor is a brushless DC motor that is controlled by the interac-
tion of multiple electromagnetic points (or steps) turned on and off to move
the rotor in a highly controlled fashion. Stepper motors are the motor of choice
in precision environments, where control is the most important factor. Stepper
motors drive things as diverse as hard drives to aerospace applications.
There are three principal types of stepper motors. The oldest is the
variable-reluctance–type motor with a large, iron-toothed gear set inside a
series of electromagnets. The magnets can be powered to create rotation.
A second version of the stepper motor is the permanent magnet type.
Instead of using a toothed rotor, it has a large permanent magnet construct-
ed to have alternating strips of north and south polarities. Electromagnetic
fields are created by two external terminals, which cause the rotation be-
tween the stepped strips of the magnets.
Hybrid stepper motors are a mix of variable-reluctance and permanent
magnet motors. In these motors, a permanent magnet rotates between the
terminals but the rotor also has teeth to allow for more precise control of
the steps.
Servo Motors
A servo motor is a brushless motor that provides feedback to the mo-
tor control. The typical servo motor has an actuator arm that broadcasts its
angle of rotation back to the control system.
The feedback allows for error correction and real-time instructions.
Servo motors can be any of the various motor technologies just described—
it is the ability to provide feedback to the system that defines them as servo
motors. One popular use of servo motors by hobbyists is in robotics and
radio-controlled airplanes.
Servos are usually controlled by three leads: the power, the ground, and a
control lead. The control lead transmits a signal that relates to the angle of an
actuator arm. That signal is fed back to the control unit. The length of the pulse
indicates the angle that the actuator is rotated, usually with a cap of 180°.
For many hobbyists, servo motors are their go-to motor because of
how they are controlled and their flexibility of use. Servo motors are
widely adaptable and generally affordable. Fans of shows like Myth-
busters or fans who have seen any robotics competition will see the im-
portant role that servo motors provide when it is time to combine design,
power, and agility.
Controllers
Be it a simple switch or a dedicated microcontroller, all motors need a
control. In DC motors, if you apply a voltage, the gear will spin; if you re-
verse the voltage, you reverse the direction of the spin. To control a motor
beyond these basic movements requires some control system.
You can control a motor’s speed by managing the amount of current
provided. The torque of a motor is directly related to the current driving it,
so controlling the voltage through varying resistance or switches can man-
age the amount of current provided.
H-bridge
An H-bridge circuit is often used to control DC motors by reversing
polarity. It consists of four switches that are turned on and off in different
combinations that each yield different results.
Depending on what switches are opened or closed, you can control the
motor’s direction, apply a brake, or let the motor power off without braking.
The other possible combinations of open and closed switches (such as
1111 and 1100) will result in short circuits.
Most H-bridge circuits are built with semiconductor transistors (either bi-
polar junction transistors [BJTs] or field effect transistors [FETs]) to protect
against potentially damaging flyback voltages. A flyback voltage is like a switch
bounce—the mechanical force of the motor turning on and off can generate a
voltage. For this reason, diodes are usually included in the circuit.
19
SENSORS
In This Chapter
ll Understanding electronic sensors
ll Measuring movement with accelerometers
ll Giving direction with magnetometers
ll Sensing light, color, sound, gas, and position
A
sensor is a device that sends back a signal or indication to represent
a measurement. Examples of nonelectronic sensors are a mercury
thermometer, which represents temperature displayed by the vol-
ume occupied by the mercury in a tube marked with different temperature
values, and a weathervane, which rotates to indicate wind direction.
In this chapter, we introduce some of the many types of sensors avail-
able. With sensors, outside information can be interpreted by electronic
circuits. With the addition of instructions given by the designer, that outside
information can be acted on.
What Is a Sensor?
A true sensor must be sensitive to what it is measuring. It must not react
to other properties that it is not measuring, nor should it affect the value
that it is sensing.
Electronic Sensors
Sensors in electronics can detect and measure many different values:
motion (control, location, gravity, speed, and position), the amount of a par-
ticular substance in the environment (gases), light (including color), infra-
red, radiation, sonar, collision/touch, temperature, humidity, and sound or
radio frequencies. The wide range of modern, affordable sensors combined
with a microcontroller means that you are limited only by your imagination
when constructing electronic projects.
Some of the better-documented hobbyist projects using sensors and
microcontrollers involve robots that can move autonomously based on sen-
sors that read their environments or radio-controlled vehicles, such as cars
or airplanes, that rely on radio signals to control speed and direction. Other
popular fields include security systems for home or office that rely on mo-
tion sensors and switches, as well as other home automation projects.
Don’t be limited by these ideas, though. Imagine building your own
Breathalyzer interface for your laptop to prevent you from posting on social
media websites after drinking too much or perhaps a magnetic lock and
actuator that open your back door when your dog barks (matched to the
voiceprint of your dog’s particular bark). Let’s look at a few of the more pop-
ular and readily available sensors that can be used with microcontrollers.
This brief list is by no means exhaustive.
Accelerometers
An accelerometer measures its orientation relative to either one or
more axes (the plural of axis, pronounced AK-sees). It makes that measure-
ment by measuring acceleration expressed in g-forces (gravitational forces).
G-force is the measure of acceleration relative to free fall. The standard
gravity unit of 1 g is the amount of acceleration due to gravity at sea level
on Earth. The more planes of movement on an axis (up/down, right/left,
or diagonally) that are measured, the more accurate the device will be at
tracking motion.
The basic model of an accelerometer can be constructed by a mass
connected to a spring. Reorientation (movement in any direction such as
height, to the left or right, or angled in any way) from the neutral position
will stretch or compress a spring. The displacement of energy on that spring
can be measured as a voltage. Think of a gyroscope: any tipping of the gyro-
scope would reorient it in space.
One of the most common types of accelerometer relies on principles of
piezoelectricity. Piezoelectric sensors are created from materials (such as
quartz and tourmaline) that produce an electric charge when subjected to
pressure due to the rearrangement of their crystalline structures. Piezo is
the Greek word for pressure.
Modern accelerometers and many other sensors are micro-electrome-
chanical systems (MEMS). These are complete systems but at a very small
scale, ranging from 20μm to 1mm. The small scale and power requirements
have enabled their use in a multitude of small electronics. Smartphones use
MEMS to orient their image display based on how the phone is held. Tab-
let computers, digital cameras, and game controllers use accelerometers to
enable more realistic game play. Digital cameras and video recorders use
MEMS to autocorrect motion in video or still images. The uses are limitless.
Titans of Electronics
Edwin Hall (1855–1938) was an American physicist. His graduate work
at Johns Hopkins led to the discovery of the effect that bears his name. He
made his observations with gold leaf on a glass plate exposed to magnetic
fields. He became a physics professor at Harvard and did further research
in thermodynamics.
Some sensors are simple switches indicating the presence of light, whereas
others can distinguish the light intensity and color.
Color is just a different frequency of light wave. There is no physical
property of “greenness” or “orangeness;” it just is a matter of frequency
and wavelength. The following chart shows the electromagnetic spec-
trum, which includes the portion of the spectrum that includes visible
light.
Light and color sensors are very flexible tools. They can be used in
navigation, signal reception, and energy detection. The sensors can be con-
structed from many technologies, including photoresistors, photovoltaic
cells, photodiodes, phototransistors, and charge-coupled devices.
Microphones
A microphone is a type of sensor as well. It is a transducer that detects
sound waves and converts them to an electrical signal. Microphones are es-
sential components in sound recording, telecommunications, hearing aids,
voice recognition, and many non-voice sound applications, including those
used in the field of ultrasonic imaging in industrial applications.
Microphone sensors use many different technologies, including con-
densers (also called a capacitor microphone), piezoelectricity, and fiber
optics (by sensing the differences in the light intensity bounced off of a re-
flective diaphragm sensitive to sound vibrations). Microphones designed to
work with microcontrollers usually are MEMS and are sometimes referred
to as microphone chips.
GPS Sensors
The type and specificity of data available via global positioning system
(GPS) satellites are incredibly valuable in electronics. GPS can provide lo-
cation in longitude, latitude, altitude, and time of day. Using that informa-
tion sampled over time, you can detect speed as well. GPS signals can be
integrated into mapping systems, which can be used to provide informa-
tion, make decisions based on set instructions, and make adjustments in
navigation.
The number of projects that can take advantage of GPS sensors is again
limited only by your imagination.
20
ELECTRONIC
COMMUNICATION
In This Chapter
ll Transmitting and receiving basics
ll Understanding various types of signals
ll Creating and detecting signals
ll Converting visual images to signals
U
p to this point, you have explored how electronic devices transmit
information via electrical signals in a closed system of an electric
circuit. This chapter focuses on how electronics can be used to
transmit and receive signals across a room, a field, a city, a continent, an
ocean, and even into space.
Signal transmission is a very broad area of study. The aim of this chapter
is to get you acquainted with the very basics of the topic. At the end of the
chapter, you will build an FM transmitter to get some hands-on experience
with signal transmission.
The wavelength is the distance over which the wave’s shape repeats
along an axis. A symbol for wavelength most often used is the Greek let-
ter lambda (λ). The amplitude is the measurement either above or below
an axis at its greatest point. The frequency of a wave is determined by the
velocity (v) of a wave, which is the distance traveled over a period of time.
Frequency is expressed in Hertz (Hz), which is the number of waves that
pass in a second, and is symbolized as f.
The formula showing the relationship between wavelength, frequency,
and velocity is f = v / λ, where v = velocity of the wave (meters/second, m/s),
f = frequency (in Hertz, Hz), and λ = wavelength (in meters, m).
From electronic communication, the size of the wavelength can range
from 1 x 103m in the lower end of the spectrum (radio waves) to 1 x 10-11
at the high end (gamma rays). The frequency increases as the wavelength
decreases, so the very long wavelengths of radio relate to very low frequen-
cies (from 148.5kHz of long wave AM radio), and the very short wave-
lengths of gamma rays relate to very high frequencies (with Hz values up
to 1020).
The amplitude of a wave is also a key concept in electronic communica-
tion. Remember that amplitude can be measured in different ways depend-
ing on the type of wave shape. On non-sinusoidal waves, the peak amplitude
of a wave is the absolute value of the wave (the highest or lowest point). The
amplitude of an electromagnetic wave is a representation of its voltage.
FIGURE 20.2 Longer wavelengths relate to lower frequencies. Frequency increases as we move to the right
on this chart.
Radio Waves
Radio waves are the most widely used signals in electronics communi-
cation. They are used in radio and television broadcasting, mobile phones,
and wireless computer networking signals such as Wi-Fi and Bluetooth.
The range of radio wave frequencies encompasses ultra-low frequency sig-
nals to high-frequency signals, each with its own properties of transmission.
Low frequencies can travel long distances and aren’t dependent on a line
of sight between transmission points. High frequencies are much more de-
pendent on line-of-sight transmission and are less likely to be able to trans-
mit through buildings or natural obstacles.
Microwaves
Microwaves are used in short-range point-to-point communication ap-
plications, in satellite communications, and in radar applications. The ad-
vantages of using microwaves for communication are that they have a high
bandwidth and they use line-of-sight technology, so the same frequency can
be used as long as they don’t cross paths. The disadvantages of using micro-
waves for communication is that they do require line-of-sight relationships
between transmitter and receiver and they are affected by environmental
factors.
Infrared
Infrared light is used in short-range communication applications such
as in sensors or between two nearby devices. Signals can be sent between
LEDs and photodiodes, or with infrared lasers across longer distances.
Many TV and other remote control devices use infrared light.
Visible Light
The visible light portion of the spectrum can be used to transmit and
receive information, but it is not widely used for this purpose. However,
there is considerable research into its use as a very large bandwidth trans-
mission medium.
Amplitude Modulation
Amplitude modulation encodes the information signal wave within the
amplitude of the carrier signal wave. In the following figure, notice how
the carrier wave is the outside limits of the wave. The information is stored
within the “envelope” of the carrier wave.
Frequency Modulation
With frequency modulation, the carrier signal wave is set to a particular
steady frequency and information is set within minor variations above and
below that frequency. It is a bit harder to visualize, but note in the following
figure that the information is encoded above and below the carrier signal
wave.
Phase Modulation
In phase modulation, the encoding and the decoding of the informa-
tion signal wave requires a timing key. The information signal wave is a set
off-phase from the carrier signal wave. The difference in phase contains
the information. The timing key is required at the transmitting end and the
receiving end of the communication.
The receiver uses a type of filter called a bandpass filter to select only
signals that fall within a certain range of frequencies or wavelengths. The in-
formation is then separated from the carrier wave signal by a demodulator.
Rasterization
To send a visual image via electronic means, it is necessary to convert
it into a mathematical representation of a visual image, a process called
rasterization. A three-dimensional (3D) visual image is described geometri-
cally as a series of polygons composed of various triangles. The relationship
between these shapes can be expressed mathematically to create a two-
dimensional (2D) image that can be displayed on a television, computer, or
camera screen. Once the image is expressed mathematically, it can be sent
as an electronic signal.
When the signal for an image is received, it is constructed of a series of
instructions for pixels or dots that are arranged according to the rasterized
signal. Information such as color and brightness can also be embedded in
the signal.
Materials:
1 FMST-100 kit
1 antenna (you can use any RCA cable)
1 9V battery
Instructions:
The instructions that come with the kit give good step-by-step advice,
but here is an overview of the process:
CONSTRUCTING A ROBOT
AND USING RASPBERRY PI
W
e give you two options to program with two of the most popular
open-source microcontrollers: the Netduino and the Arduino.
Choosing between Netduino and Arduino is a matter of personal
preference and comfort levels with the two programming environments.
There are hardware differences that will affect choices between the two,
but for our purposes and for most basic projects, either will suit someone
starting out. Arduino has a larger community and Netduino is often favored
by those who are comfortable programming in C#. If you are not yet a
programmer, explore some of the communities online to help you decide
between the two.
To get started building your very own robot, you first need to do a little
shopping. Once you have all your supplies, you’ll need to do some basic
programming using your home computer and a microcontroller, attach
some wheels, and give it some motor power and control.
Then we look at all of the sensors that we can use to give your robot its
many jobs. At their most basic level, sensors sense things. Imagine anything
that can be sensed—light, temperature, radio signals, gases, and a whole
lot more—and there is probably a sensor that detects it. The information
that the sensors provide can be fed back to your robot and, with your help,
your robot can use the information to make decisions. You will use a very
sophisticated ultrasonic sensor to detect objects and make your robot do
something unsophisticated: dance.
The Raspberry Pi is an affordable and adaptable small computer that
many electronics hobbyists are using for their projects. We teach you the
basics of connecting it to various inputs and outputs so you can tackle more
complex projects.
21A
ARDUINO: BUILDING
YOUR ROBOT
In This Chapter
●● Shopping for Your Robot
●● Get the Software You Need
●● Connecting Your Arduino and Getting to Work
T
ime to get your geek on: first by shopping, then by building a robot—
a machine that follows a set of instructions to perform different tasks
without human assistance. We sourced our parts through Sparkfun.
com but see Appendix E for other resources.
Feel free to shop at any store you like and choose different components.
make your robot your own. Most of the connections and construction are
made to be reconfigurable—screws and bolts, snap-in pieces—so you can
adapt and add-on. We want you to try getting the basics together of a micro-
controller (to program), motors (to drive), wheels or tracks (to move), and
the addition of a sensor (to provide feedback to the microcontroller) that
work together to make a functioning robot.
You should be able to purchase all of these items for under $175.
These items are available directly from the manufacturer at www.Tami-
yaUSA.com.
Let’s take a look at what your code is doing. The “int led = 13” line is
a name so we can use that name later in our code. Further down you see
“pinMode(led, OUTPUT);” this is setting pin 13 as an output. In the last
section, we set up a loop function and set it to run forever “void loop()”.
The “digitalWrite(led, HIGH);” and the “digitalWrite(led, LOW);” sec-
tions are setting the voltage to HIGH and LOW is setting the voltage to
LOW.
The “delay(1000);” is calling for 1000 milliseconds or 1 second.
4. Your Arduino should still be connected by the USB cable, so now press
the arrow button at the top of the window.
5. After a few seconds, you should see the LED on the Arduino blinking.
FIGURE 21A.5 Upload to Arduino using the FIGURE 21A.6 See the blinking LED as
indicated button. indicated above.
21B
NETDUINO: BUILDING
YOUR ROBOT
In This Chapter
●● Shopping for Your Robot
●● Get the Software You Need
●● Connecting Your Netduino and Getting to Work
●● Downloading to the Netduino Microcontroller
T
ime to get your geek on: first by shopping, then by building a robot—
a machine that follows a set of instructions to perform different tasks
without human assistance. By the time you’re done with this chapter,
you’ll have your robot up and running and even performing a trick or two.
You’ll also have the knowledge you need to try your own programs and add
some capabilities on your own.
make your robot your own. Most of the connections and construction are
made to be reconfigurable—screws and bolts, snap-in pieces—so you can
adapt and add-on. We want you to try getting the basics together of a micro-
controller (to program), motors (to drive), wheels or tracks (to move), and
the addition of a sensor (to provide feedback to the microcontroller) that
work together to make a functioning robot.
You should be able to purchase all of these items for under $175.
These items are available directly from the manufacturer at www.Tami-
yaUSA.com.
FIGURE 21B.1 The Netduino download page. Choose the downloads under the Netduino.
FIGURE 21.3 The start page for Microsoft Visual C# 2010 Express. Choose New Project.
FIGURE 21B.5 You should see the LED Blink project on the list.
In the first line of code, you are creating a new output, naming it “led”
and telling the program to use the pin named ONBOARD_LED. You may
have noticed when typing that a list of pins appears from which you can
choose the pin rather than typing in the complete name of the pin.
Adding “false” after the pin name sets the LED to “off” as its default
state.
The “while (true)” statement tells the LED what to do when it is on.
The “led.Write(true);” statement turns the LED on.
The “Thread.Sleep(250);” statement keeps the LED on for 250 mil-
liseconds (ms).
The “led.Write(false)” statement turns the LED off and the line
“Thread.Sleep(250)” sets the time interval at 250 ms.
When writing code, you will get prompts on what the compiler
thinks you may need next; this is called intelli-sense. A short list
of possible commands to use next will pop up. You can select
WATTAGE TO THE WISE this command with the arrow keys and then press the Tab key to
insert it into the code you are writing.
1. From the menu bar, choose Project, then LED Blink Properties.
2. Under Target framework, select .NET Micro Framework 4.1, and
under Transport, select USB.
FIGURE 21B.8 Under Target framework, select .NET Micro Framework 4.1.
3. Under the file menu, choose Save all then click the green play arrow
on the top menu bar or press F5 to debug the program. If your code is
correct, it will load the program you entered onto your Netduino. The
LED on the microcontroller will be blinking. If you have any errors or
bugs, the screen on your computer will highlight any bugs that need to
be corrected. Check that your code is typed correctly, as typos are the
most common errors.
A bug is an error in programming that causes unintended consequences.
DEFINITION To debug a program is to find errors and correct them.
FIGURE 21B.10 If you installed the program correctly, your LED should be blinking.
22A
ARDUINO: GETTING
YOUR ROBOT MOVING
In This Chapter
●● Mounting your motor and microcontroller
●● Adding power
●● Programming your robot to start and stop
●● Controlling your robot’s speed
●● Assembling the robot platform
Y
ou can’t have a robot that just sits there. Let’s get things moving by
mounting a motor, adding a power supply, and giving the robot some
controls. We’ll start with a few commands, but the tools are in your
hands if you want to add more.
Instructions:
Sparkfun has a great online tutorial on putting the motor driver shield
together with color photos and soldering tips. You can find them on the
product page on their website (www.sparkfun.com). Follow their instruc-
tions and assemble the shield.
Power It Up
Initially, power for your Arduino Microcontroller came from your
computer via the Micro USB cable. This provided enough power for
programming the device and making the light-emitting diode (LED)
blink.
We need to also consider power for the motors; the 5 volts coming
from your controller is fine for small tasks like talking to the attached
shields but not enough to provide power for the drive motors. In fact,
attaching something that needs more than 35 milliamps can damage
your microcontroller.
Take a look at the motor shield and you will see “VIN Max 12V” and two
holes for connecting an external power source. We used a 9V battery with
the 9V battery clip with wire to connect here.
onds then backward for 500 milliseconds and repeat until you discon-
nect the power.
You can disconnect the Micro USB cable after you have success-
fully uploaded the code to the Arduino Microcontroller. It will
WATTAGE TO THE WISE
hold the code until you reprogram it.
5. Disconnect the power cord when you are sure that everything is
functioning.
FIGURE 22A.5 Top plate for mounting microcontroller, batteries, and range sensor, as discussed in Chapter
23. We cut the top plate and the supports to hold the microcontroller, batteries, and sensor.
22B
NETDUINO: GETTING
YOUR ROBOT MOVING
In This Chapter
●● Mounting your motor and microcontroller
●● Adding power
●● Programming your robot to start and stop
●● Controlling your robot’s speed
●● Assembling the robot platform
Y
ou can’t have a robot that just sits there. Let’s get things moving by
mounting a motor, adding a power supply, and giving the robot some
controls. We’ll start with a few commands, but the tools are in your
hands if you want to add more.
The parts included with the Arduomoto Motor Driver Shield are as
follows:
Motor driver shield
Shield board
2 6-pin stackable headers
2 8-pin stackable headers
2 2-pin screw terminals
Instructions:
Sparkfun has a great online tutorial on putting the motor driver shield
together with color photos and soldering tips. You can find them on the
product page on their website (www.sparkfun.com). Follow their instruc-
tions and assemble the shield.
After assembling the motor shield, you will need to make one small
change. This shield was designed for the Arduino microcontroller, and we
are using a Netduino microcontroller; some of the output pins are different.
The Netduino uses I/O pins 6 and 9 for PWM (pulse width modula-
tion) but the input for PWM on the motor shield is on 3 and 11. You will
see them labeled on the board as PWMA and PWMB. This is an easy fix.
1. On the bottom of the board, trim off pin leads 3 and 11.
2. Next, use two small jumper wires on the top side. Use one to connect 3
to 6 and the other to connect 9 to 11.
After these changes, the output from the Netduino will be connected to
the right input on the motor shield.
Power It Up
Initially, power for your Netduino Microcontroller came from your
computer via the Micro USB cable. This provided enough power for pro-
gramming the device and making the light-emitting diode (LED) blink.
We need to also consider power for the motors. The 5 volts coming from
your controller is fine for small tasks like talking to the attached shields but
not enough to provide power for the drive motors. In fact, attaching some-
thing that needs more than 35 milliamps can damage your microcontroller.
Take a look at the motor shield and you will see “VIN Max 12V” and two
holes for connecting an external power source. We used a 9V battery with
the 9V battery clip with wire to connect here.
You can disconnect the Micro USB cable after you have successful-
ly uploaded the code to the Netduino microcontroller. It will hold
WATTAGE TO THE WISE
the code until you reprogram it.
1. Make sure the power cord is disconnected before you load the program-
ming onto your robot.
2. Connect the Micro USB and press play or F5 to
load the program.
FIGURE 22B.6 Top plate for mounting the microcontroller, batteries, and range sensor discussed in Chapter
23. We cut the top plate and the supports to hold the microcontroller, batteries, and sensor.
23A
ARDUINO: ADDING
SENSORS TO YOUR ROBOT
In This Chapter
●● Attaching an ultrasonic range finder to your robot
●● Setting up the power switch
●● Coding for collision avoidance
●● Letting your robot go
O
nce the wheels are spinning under the control of your program,
you have successfully built a robot. But you can do so much more
with a combination of new programming and add-on sensors. This
chapter gets you going by adding a sensor that can detect objects and their
distance through the use of ultrasound waves.
Materials:
MaxBotix Ultrasonic Rangefinder LV-EZ1
Breadboard
5V power supply
Jumper wire
DMM
Instructions:
1. Connect the 5V power supply to the pin labeled +5.
2. Connect the pin labeled GND to GND.
3. Set your DMM to read VDC.
4. Connect the black lead to the GND.
5. Connect the red lead to the pin labeled AN.
6. Turn the power on.
7. Move your hand in front of the sensor; as you do, the voltage will
change. The closer you are, the lower the voltage produced; the farther
you move away, the higher the voltage produced.
Materials:
Your robot
Double-sided tape
MaxBotix Ultrasonic Rangefinder Maxbotix LV-EZ1 sensor
Small breadboard
Jumper wire
Instructions: Arduino
1. Use double-sided tape to secure the small breadboard to the front of the
robot.
Use the photo to see that all you need to do is use the jumper wire to
directly connect the Arduino GND to GND, 5V to 5V and A0 to AN.
1. On the 9V-to-barreljack adapter cable, working from the end that has
the battery connector, strip off approximately 6 inches of the outer insu-
lation, exposing the red and black wires.
2. Determine where you want to place your switch, making sure to leave
plenty of ground clearance between your robot’s base and the running
surface.
3. Attach your switch to your base. Bring the black wire to the switch leads
to see where to make your cut.
4. Cut the black wire and strip off enough of the black insulation to make
your connections.
5. Solder the wires to the switch lead.
Arduino Code
The code for your Arduino is as follows:
When the analog input reads a value of less than 6, one of the wheels
will reverse direction causing the robot to spin until the analog input reads
greater than 6, then the robot will start moving forward again.
23B
NETDUINO: ADDING
SENSORS TO YOUR ROBOT
In This Chapter
●● Attaching an ultrasonic range finder to your robot
●● Setting up the power switch
●● Coding for collision avoidance
●● Letting your robot go
O
nce the wheels are spinning under the control of your program,
you have successfully built a robot. But you can do so much more
with a combination of new programming and add-on sensors. This
chapter gets you going by adding a sensor that can detect objects and their
distance through the use of ultrasound waves.
Materials:
MaxBotix Ultrasonic Rangefinder LV-EZ1
Breadboard
5V power supply
Jumper wire
DMM
Instructions:
1. Connect the 5V power supply to the pin labeled +5.
2. Connect the pin labeled GND to GND.
3. Set your DMM to read VDC.
4. Connect the black lead to the GND.
Materials:
Your robot
Double-sided tape
MaxBotix Ultrasonic Rangefinder Maxbotix LV-EZ1 sensor
Small breadboard
Jumper wire
100μF capacitor
100Ω resistor
Instructions:
1. Use double-sided tape to secure the small breadboard to the front of the
robot.
2. Use the following diagram to make connections between the motor
shield on your robot, the breadboard, and the sensor. Add the sensor
to the breadboard so that the sensing side is facing forward (the circuit
board will be facing the rear). The sensor will insert directly onto the
breadboard. The connections between the breadboard and the motor
shield should be made with jumper wire. Notice the placement of the
100μF capacitor and the 100Ω resistor.
FIGURE 23B.3 Connection diagram for sensor; connections to be made on the small breadboard.
This flowchart may seem very simple, but as you work on more compli-
cated programs, you will find that using a flowchart helps to produce bug-
resistant, if not bug-proof, programs. You can use proper flowchart symbols
if you wish, but even a list of steps will help you accomplish your goals.
Now we can add code to provide collision avoidance. Insert this code
just below the comment line “//write your code here” but above the PWM
lines:
AnalogInput a5 = new AnalogInput(Pins.GPIO_PIN_A5);
This code creates a new analog input named a5 and assigns it to analog
pin 5. Now, add this code below the last output motor line:
int i = a5.Read();
if (i > 20)
This will read the input and, if the value is greater than 20, the robot
will move forward. If the value is less than or equal to 20, the “else” state-
ment will kick in. This reverses one of the motors, which will make one
wheel reverse and cause the robot to spin away from the object until the
input value is once again above 20. When it reaches 20, it will return to
normal forward motion.
Here’s the full code for your robot so far:
// write your code here
AnalogInput a5 = new AnalogInput(Pins.GPIO_PIN_A5);
pwm2.SetDutyCycle(100);
pwm1.SetDutyCycle(100);
Motor1.Write(false);
Motor2.Write(true);
}
}
24
USING RASPBERRY PI IN
YOUR ELECTRONICS
PROJECTS
Getting to know and configuring your Raspberry Pi V3
In This Chapter
ll Setting up your Raspberry Pi with an OS
ll Adding Inputs and Outputs (I/O) to your Pi
ll Using the Python command shell
ll Programming with Python on the Pi
ll Programming a button in Python
ll Controlling an LED with the button
N
ow that you have learned how to work with your microcon-
troller, why would you want to work with a Raspberry Pi? Each
has its advantages, and you want to choose the right tool for
the right job, but it may come down to your own preferences for a pro-
gramming and operating environment. A microcontroller is designed
more for embedded applications that require less power, but many
projects would benefit from the c apabilities that come from using a
The Micro SD card is inserted into a slot on the underside of the Pi.
For power, the Pi uses a MicroUSB connection (the Adafruit kit in-
cludes a power supply). This is a very common connection-type and one
nice thing about this is it makes easy to connect a battery to power your Pi.
We have found that a simple external battery pack used for charging mobile
phones is a great option.
Materials:
1 Raspberry Pi 3, connected to your keyboard, mouse and monitor.
1 ribbon cable
1 GPIO
1 LED (any color)
1 47Ω resistor
2 jumper wires
1 breadboard
The Raspberry Pi 3 has 40 I/O pins. We will be using a GPIO connected
to a breadboard to perform the labs in this section.
1. Connect the ribbon cable, being careful to align the cable with pin one
on the Pi and pin one on the GPIO. The ribbon cable will have a colored
stripe on one side to indicate the connection to pin 1.
The breadboard we used has numbers running down the sides. Try to
align the pins of the GPIO with the numbers on your breadboard. This
should make it easier to not confuse the I/O pins.
2. Connect one end of a jumper wire to a 3V3 pin and the other end of the
jumper wire to one side of a 47Ω resistor. Connect the other side of the
resistor to the long leg (anode) of the LED.
3. Connect a jumper wire to a GRND pin and the other end to the short
leg (cathode) of the LED.
4. Connect the ribbon cable to the Pi interface board.
5. Power on the Pi by connecting the MicroUSB power supply.
The LED should light up. If it doesn’t, check your jumper connections
and the resistor value.
Figure 24.7 Completed circuit. (Note this image, 24.8, 24.11, and 24.13 were created using the open source
tools available from fritzing.org)
At the “>>>” prompt, start typing the following, and press “Enter” after
each line:
from gpiozero import LED
led = LED(17)
Now we will turn on the LED. At the “>>>” prompt type the following,
and press enter after each line:
led.on()
The circuit remains the same as above. Let’s write some code.
From your Pi screen, start a new file by selecting the Raspberry icon
in the upper left hand corner, then choose “Programming ,” and then
“Python 3(IDLE).”
Now choose “File>New File.”
In the new window, choose “File>Save As.”
Give the file a name. Lets use “blink.py.”
Click “Save.”
In the open window type:
from gpiozero import LED
from time import sleep
led = LED(17)
while True:
led.on()
sleep(1)
led.off()
sleep(1)
Connect a jumper wire from GND to the leg next to the one you just
used.
From your Pi screen, choose the Raspberry icon in the upper left hand
corner, then choose “Programming ,” and then “Python 3(IDLE).”
Now choose “File>New File.”
In the new window, choose “File>Save As.”
Give the file a name. Let’s use “buttonHello.py.”
Click “Save.”
In the open window type:
from gpiozero import Button
button = Button(12)
button.wait_for_press()
print('button pressed')
Press the F5 key to run the program. When you press the button, the
LED will turn on for 3 seconds and then turn off. Pressing the button will
do nothing.
Going Forth
There are lots of fun projects online and in books and magazines. A great
resource for next steps is RaspberryPi.org. With a little more research and
tweaks, you can adapt your robot from the previous chapters to be driven by
your Pi or take on all of the possibilities your electronics knowledge paired
with this powerful little computer provide.
25
CYBERSECURITY AND THE
INTERNET OF THINGS (IoT)
FOR ELECTRONICS PROJECTS
T
he next step for many electronics projects is adding the im-
mense opportunities made possible by connecting your proj-
ects to the Internet. Your project can become part of the In-
ternet of Things (IoT). The functionality of your device can enable
you to monitor whatever you are sensing, give commands remotely,
or interact with people or devices anywhere.
Some devices, like a Raspberry Pi, provide the information pages for
setting up security
(for example, https://www.raspberrypi.org/documentation/configuration/
security.md)
1. Protect device security, i.e., prevent an IoT device from being used
to conduct attacks.
2. Protect security of data, including personally identifiable informa-
tion; and
3. Protect individuals’ privacy.
A
GLOSSARY
accelerometer a sensor that measures acceleration relative to free fall.
actuation force the force required to throw the actuator.
actuator a mechanical system that controls a device or system.
algorithm a mathematical formula.
alloy is a combination of two metals.
alternating current (AC) electron flow in both directions alternating
between forward and backward. It also has changes in polarity.
alternator an AC electrical generator.
ampere a coulomb of current that moves through a point in one s econd.
amplifier a circuit or device that increases a signal.
amplitude the measurement of the distance of any point of the wave
that is above or below the center or mean line.
analog describes systems that are continuous as opposed to stepped.
An analog signal can be represented by a wave and not individual, uncon-
nected points.
anode an electrode that receives current.
armature the rotating arm in a brushed motor that interacts with the
stator to create a torque on it.
assembly language a low-level programming instruction that uses
symbols to represent the machine code.
electrostatic force the force that bonds the protons and the electrons
of an atom.
element the most basic unit of each distinct type of matter.
encoder a circuit that represents a signal in machine-readable code.
engineering notation scientific notation that uses powers of 10 that
are divisible by 3 to coordinate with metric prefixes.
EPROM electrically programmable read-only memory.
farad a unit of measurement equal to the charge in coulombs required
to raise the voltage across the capacitor by one volt.
firewall a network security device that provides security on incoming
and outgoing network traffic, typically between an internal network and the
Internet.
flux a chemical used to clean oxidation from components prior to
soldering.
forward error correction a method of error protection that sends
redundant transmissions.
frequency the number of complete cycles in a given amount of time.
function generator an instrument that creates waveforms and signals.
fuse a single-use component that protects against short circuits.
gain the increase in a signal.
gravitational force the measure of acceleration relative to free-fall.
gauge is a wire’s thickness, and determines the amount of current (am-
perage) a wire can carry. It is measured at the wire’s diameter and doesn’t
include the insulating covering.
heat sink a device that assists in cooling by increasing the surface area.
Hertz equal to one cycle per second.
hexadecimal a base-16 numbering system; it has the digits 0–9, plus
A–F.
I-type semiconductor is an intrinsic semiconductor, meaning that it
is a material that has excited electrons even when no dopant is introduced;
instead, the electrons are excited through thermal excitation or by crystal-
line defect when a current is applied.
rosin is a pine tree resin that has been used as flux for many hundreds
of years for its ability to reduce friction.
scientific notation a system that represents decimal numbers as a
product of the numbers 1 through 9 multiplied by a power of 10.
secondary battery a battery that can be recharged after depletion.
semiconductors materials, generally with crystalline structures, that
are in the middle range of materials as to conductivity or resistance.
sensor a device that feeds back a signal or indication to represent a
measurement.
shell the area around the nucleus where the electrons travel.
signal is information communicated through electromagnetic
ethods.
m
sine wave (also called a sinusoidal wave) is the shape that results from
plotting the mathematical equation y = sin(x). The sine wave is the shape
that occurs most often in ocean waves, sound waves, and light waves.
solder a metal that is melted to form connections between wires and
components.
soldering iron a tool used to melt solder to form connections between
wires and components.
source code the lowest human-readable programming instructions.
stator a stationary magnet used to provide a magnetic field in a motor.
switch a component or device that opens or closes a circuit.
thermistor a resistor that is reactive to temperature.
throw a contact that completes a circuit.
tolerance the percentage in possible variation from the stated value.
torque rotational force; a twisting force around an axis or pivot point. It
is sometimes referred to in mechanical engineering as moment or moment
of force.
trace a wire set into a circuit board.
transducer a device that converts one type of inputted energy into an
output of another type of energy.
transformer a device that can either “step up” or “step down” voltage
in AC through the operation of mutual induction.
transistor an electronics component that amplifies signals or acts as a
switch in a circuit.
truth table a chart of the possible outcomes in a logical decision de-
pending on the inputs.
universal memory the goal of developing memory that is both afford-
able to produce and energy-efficient. It should be fast, nonvolatile, and
resistant to magnetic interference.
valence band/valence shell the outermost electron shell of an atom.
varistor a variable resistor that is designed to protect circuits from ex-
cessive voltage.
volatile memory memory that is lost when power is not supplied.
voltage the “push” that gets the electrons jumping from one atom to
another, sending a current of electrical flow along the way. See also electro-
motive force, potential difference.
voltaic cell a chamber that is composed of two half cells that facilitates
the chemical reaction that produces electrical energy in a battery.
watt a unit of measurement equal to one volt pushing one amp of
c urrent.
waveform a graphical depiction of a signal across the x and y axes to
describe its features.
wetting in soldering, the process of reducing the surface tension to
ease the flow of solder.
writing in computing, storing data in memory.
B
TIMELINE OF ELECTRONICS
1600 British scientist William Gilbert first uses the word electricity.
1660 Otto von Guericke invents the first electrostatic generator.
1729 Stephen Gray experiments with the concept of the conductivity
of electricity.
1745 While working at Leiden University, Pieter van Musschenbroek
invents the first storage device (a capacitor) for static electricity, the Leyden
Jar (sometimes spelled Leiden).
1747 William Watson creates a circuit that carries the current from
a Leyden Jar. He also adds lead foil to the inside of the jar to increase its
capacity. Benjamin Franklin discusses his ideas about electrical fluid com-
posed of particles. Henry Cavendish measures the conductivity of different
materials.
1750–1752 Benjamin Franklin develops the lightning rod; he explains
that lightning is electricity.
1800 Alessandro Volta invents the first electric battery and shows that
electrical current can travel through wires.
1820 The electromagnet is invented by D. F. Arago.
1820–1821 Charles Babbage proposes a Difference Engine, which is
to be a massive steam-powered mechanical calculator. He later proposes
the Analytical Engine, which uses punch-cards based on the Jacqard loom.
1821 Michael Faraday invents the first electric motor.
1826 Georg Simon Ohm introduces his law: V = IR.
1937 Claude Shannon publishes his paper laying the basis for the ap-
plication of binary numbers to switches in electronic circuits, which be-
comes the basis of digital circuit design.
1940 Bell Labs demonstrates the Complex Number Calculator, which
is able to perform calculations over the telephone line.
1941 Konrad Zuse creates the Z3 computer in Berlin. It is destroyed
in a 1943 bombing raid. The Bombe computer is developed from a Polish
design by the British. It is used by the Allied forces to decrypt Nazi war
communications.
1945 John von Neumann outlines the structure of a stored-program
computer, the Electronic Discrete Variable Automatic Computer (ED-
VAC). It introduces the ideas for the binary system and leads the way for
digital computing.
1947 William Shockley, John Bardeen, and Walter Brattain of Bell
Labs invent the transistor. Electronic Numerical Integrator and Computer
(ENIAC) is developed at the University of Pennsylvania.
1948 Freddie William and his colleagues invent the Random Access
Storage Device.
1949 Electronic Delay Storage Automatic Calculator (EDSAC) is in-
troduced at Cambridge University. It uses subroutines stored on punched
paper tapes and thus is the first practical stored-program computer. It is the
realization of the EDVAC idea.
1950 Engineering Research Associates sells its ERA 1101 (the first
commercially produced computer) to the U.S. Navy. The National Bureau
of Standards constructs two large computers (the SEAC and the SWAC) to
test components. The Standards Eastern Automatic Computer (SEAC) is
the first to use all-diode logic.
1951 Another early commercial computer, the Ferranti Mark 1, is re-
leased. The UNIVAC I built by Remington Rand is sold to the U.S. Census
Bureau.
1953 International Business Machines (IBM) releases its model 701,
the first electronic computer.
1954 Texas Instruments sells the first consumer transistor radio, the
Regency TR1. IBM releases the IBM 650 magnetic drum calculator, the
first mass-produced computer.
1956 The IBM 305 hard disk is released. It can store 5MB.
1958 NEC builds the NEAC 1101, Japan’s first electronic computer.
1959 A germanium-based integrated circuit is patented by Jack Kilby.
Robert Noyce develops a silicon-based integrated circuit. IBM introduces
the 7000 series mainframes—transistor–based computers.
1960 Massachusetts Institute of Technology (MIT) students write the
first computer videogame on Digital Equipment Corporation’s (DEC)
PDP-1.
1961 IBM releases the 1401 Data Processing System.
1962 The metal-oxide semiconductor field effect transistor (MOS-
FET) is invented by Steven Hofstein and Frederic Helman. It is cheaper,
smaller, and uses less power than earlier transistors.
1964 Beginners’ All-purpose Symbolic Instruction Code (BASIC) is in-
troduced. IBM releases the System/360 mainframe computer. It introduces
the concept of expandability and the use of peripherals.
1965 Robert Lucky of Bell Labs invents the automatic equalizer. Gor-
don Moore publishes the paper that popularizes the idea that integrated
circuits will be able to be twice as complex (that is, that they could be com-
posed of twice as many components) year over year for at least 10 years.
This comes to be known as Moore’s Law.
1966 Hewlett-Packard introduces a general-purpose business com-
puter that supports several computer programs, including BASIC and IBM
Mathematical Formula Translating System (FORTRAN).
1968 Seymour Cray designs the CDC 7600, from CDC, which uses the
idea of peripheral processors working together with a central processing
unit. Doug Engelbart develops a word processor, a collaborative applica-
tion, and an early hypertext system.
1969 A team at MIT and the Defense Advanced Research Projects
Agency (DARPA) creates the Advanced Research Projects Agency Network
(ARPANET); it introduces the concept of data transfer through packets ac-
cessible to multiple machines. ARPANET laid the basis for future systems
that would develop into the Internet. Bell Labs introduces UNIX. Dynamic
random access memory is invented by Robert H. Dennard.
1971 Ted Hoff and his team at Intel release the first commercial micro-
processor, the Intel 4004. Kenbak-1, the first kit-based personal computer,
is introduced. Bill Gates and Paul Allen develop a computer traffic-analysis
tool.
1972 Hewlett-Packard releases the HP-35, a scientific handheld cal-
culator advertised as “a fast, extremely accurate electronic slide rule.” Atari
releases Pong for the arcade.
1973 Intel releases the Intel 8080, used in the MITS Altair 8800.
1974 Xerox Palo Alto Research Center (PARC) develops the Alto,
which uses a mouse for input and can be linked in a small network. Never
sold, it was given to universities for research and development. Bob Kahn
and Vinton Cerf introduce a set of ideas that would become the Internet,
and their paper includes what is considered the first use of the term Inter-
net.
1975 The Altair 8800 is released. It is sold by mail order as a kit and
uses Altair BASIC (developed by Paul Allen and Bill Gates) as its software
language. The Intel 8048 is the first commercially available chip with both
random access memory (RAM) and read-only memory (ROM) on the same
chip.
1976 Steve Wozniak designs the Apple I.
1977 The Commodore Personal Electronic Transactor (PET) is intro-
duced. It arrives fully assembled and is easy to operate. The Apple II is
released; it can be attached to a color TV to produce color graphics. Radio
Shack sells 10,000 TRS-80s in the first year; it is the first computer designed
for the computer novice.
1978 International Packet Switched Service (IPSS) is launched by the
British Post Office, Western Union International, and Tymnet.
1979 Usenet is established as a Unix-to-Unix Copy (UUCP) link be-
tween the University of North Carolina–Chapel Hill and Duke University.
Compuserve becomes the first public e-mail service for personal computer
users.
1980 Built-in Self Testing (BIST) circuit boards are introduced. Com-
puserve offers real-time chat. Many bulletin board systems (BBS) are
launched, offering online access to other users. The Institute of E
lectrical
C
MATHEMATICS FOR
ELECTRONICS
In This Appendix
ll Basic Operations and Symbols
ll Multiplication
ll Division
ll Scientific Notation
ll Engineering Notation
ll Order of Operations
ll Solving Equations
ll Binary Numbers
D
o you remember sitting in algebra class and wondering, “When will
I ever use this?” Now’s the time. Electronics gives practical use to
many of the math skills you learned in school. In this appendix, we
freshen up a few concepts so you’re ready to put the basic math of electron-
ics to use.
Multiplication
Multiplication can be represented in a variety of ways using different
symbols. The following equations represent multiplying X times Y:
X×Y
XY
X•Y
X(Y)
In this book, we generally use the X × Y format.
Division
Division is usually represented in one of the following ways:
X÷Y
X/Y
In this book, we use the X / Y format.
Scientific Notation
Using scientific notation makes it much easier to solve equations with
incredibly large or incredibly small numbers.
To express a large number in scientific notation, follow these steps:
1. Determine the coefficient. The coefficient is the single digit at the be-
ginning of the number followed by a decimal point and then any num-
bers that precede the zeroes. For example, the coefficient of 4,560,000
would be 4.56.
2. Count the number of decimal spaces that follow the first digit. This is
the power of 10. Our example is 10 to the sixth power, which is written
as 106.
3. Finally, express your number as the coefficient times the power of 10.
So, our number expressed in scientific notation is 4.56 × 106.
For extremely small numbers, you can use negative powers of 10:
Engineering Notation
In engineering and electronics, most practitioners use engineering no-
tation. Engineering notation sticks to exponents in multiples of 3: 10–3, 100,
103, and 106. This keeps the numbers in line with the metric prefixes such
as milli-, kilo-, and mega-. To express the number 24,000, use 24 × 103 as
engineering notation instead of 2.4 × 104 in scientific notation.
Order of Operations
When presented with an equation, it is important to know where to
start. This is called order of operations. If you don’t follow the proper se-
quence, you will not get the right answer. If you are feeling a little rusty on
these concepts, be sure to double check before proceeding.
First, you solve anything that is in parentheses. This is often called solv-
ing parentheses from the inside out. By solving, we mean doing any ad-
dition, multiplication, or solving of a fraction. Some equations may have
parentheses and brackets surrounding those.
Solve the innermost set first.
Second, solve any exponents.
Third, perform any multiplication and division, from left to right.
Fourth, perform any addition and subtraction, from left to right.
Solving Equations
Electronics involves a lot of equations where you need to use basic al-
gebra to solve an equation to find the value of a variable. There are several
steps to follow when you are solving for a variable.
1. First, combine like terms. If you have a set of values of resistance, for
instance, you should combine them. 120Ω + 220Ω should be simplified
as 340Ω.
2. Next, isolate the variable you wish to solve for. If you want to solve for I
(current) in this equation:
5V = I / 220Ω,
you need to isolate the variable I. In this case you can multiply each side
by 220 to isolate I, as follows:
220Ω × 5V = I / 220Ω × 220
220Ω × 5V = I
I = 220Ω × 5V
I = 1100A
One important note, however, is that when working through electron-
ics equations the various units of measure (Ω, V, and A, for example) aren’t
variables. We don’t want to treat them as if the letters are variables to be
solved. You want to leave them in the equation to keep your units straight.
3. Last, substitute your answer into the original equation and check that it
works.
Binary Numbers
Binary is called a base-2 system, which means that each of the place
numbers represent a power of 2. (The decimal system is a base-10 number-
ing system. Binary has 2 digits—0 and 1—; decimal has 10—0, 1, 2, 3, 4, 5,
6, 7, 8, and 9.) Working from the right, the first place is held by 20, which is
2 × 0, so 0. The next place working from right to left is the 21, which is the
identity of 2, so just 2. Next, 22, which is 2 × 2, so 4. 23, which is 2 × 2 × 2, so
8. This continues infinitely with each place moving to the left representing
a further power of 2.
The binary system was used in several ancient traditions, including the
Indian, the Chinese (yin as 0 and yang as 1), the Ifà tradition of West Af-
rica, and in medieval geomancy (divination through the use of rocks, sticks,
and sand) in Europe, the Middle East, and Africa. In each system, binary
numbers could serve as symbols to represent a range of values, and each
was formalized so that practitioners could have a uniform way of reading
the symbols.
Each binary digit, called a bit, is a power of 2. To represent the number
1 in the decimal system as a binary number, you would write 01, the num-
ber 2 in decimal is 10 in binary.
One easy approach to convert decimal numbers to binary is to look at
a chart, such as the one included in this section, that has the values of the
powers of 2. Look for the largest power of 2 that will go into that number
without going below 0, put a 1 in that place, then with the remainder go to
the next power of 2, and see if it is large enough to subtract that number.
If it is, enter a 1 in that place, if not, enter a 0, and then do the same until
you have no remainder, entering 0s in any places between your 1s and the
decimal point.
For example, let’s convert the number 9 into binary. 23 or 8 is the largest
power of two that can be subtracted. So, we know that the first 1 we can en-
ter is in the fourth place from the right. 1XXX. 9 – 8 = 1, so our remainder is
1. 22 or 4 is the next power of 2. As you cannot subtract 4 from 1, you would
enter a zero in that place. 10XX. Next, 21 is 2. Again, you cannot subtract
2 from 1, so add another 0. 100X. The last digit would be 1, so the decimal
value 9, is 1001 in binary.
There are eight bits in a byte. A kilobyte is 210 or 1,000 bytes. When
speaking of computer memory storage a kB is actually 1,024 bytes.
The following table lists some decimal values written in binary form:
Decimal 23 (8) 22 (4) 21 (2) 20 (0) Binary
equivalent Value
0 0 0 0 0 0000
1 0 0 0 1 0001
2 0 0 1 0 0010
3 0 0 1 1 0011
4 0 1 0 0 0100
Continued
D
CAREERS IN ELECTRONICS
In This Appendix
ll Training for a Career in Electronics
ll The Hobbyist and Curious Self-Taught
ll Electronics Technician
ll Electronics Technologist or Engineer
ll Graduate Level Electronics Engineer
ll Career Fields
ll Computers and Information Technology
ll Automotive and Transportation
ll Construction and Building Maintenance
ll Biotechnology
ll Manufacturing
ll Legal
ll Entertainment, Broadcast Media, and Visual Arts
T
here are four general levels of electronics study, each opening up
different career paths.
Electronics Technician
Electronics technicians train in a community college or technical school
environment. They learn professional approaches to manufacturing, test-
ing, repairing, and maintaining equipment from the household consumer
level up to the most advanced technologies across many disciplines. The
emphasis is on hands-on and experiential learning, but they should also
have a solid grasp of the theory behind electronics.
To keep current, electronics technicians should be aware of new devel-
opments and technologies through industry publications or further study.
Using the same skills and curiosity as the self-taught, an electronics techni-
cian can bring a lot of value to almost any sort of industry. Being flexible and
curious ensures a long-lasting career and avoids obsolescence.
Electronics technicians should emphasize science and math in their
high school programs with special attention to physics and algebra.
Career Fields
You can put your knowledge of electronics to use in the following fields.
Many high schools offer courses in computer science and IT. You can
also gain a lot of knowledge through independent study, courses taught at
training centers and community colleges, and by hands-on experimenta-
tion. You can gain certifications that establish your mastery of a particular
subject to help you establish your proficiency to potential employers.
Biotechnology
The field of biotechnology combines technology and medicine. Wheth-
er maintaining or designing monitors, lab equipment, surgical devices, or
even bionics that replace organs or structures, electronics are essential to
this fast-growing field. Inventors with all levels of training have really ex-
panded what is possible, and their creativity and knowledge can be highly
rewarding both in financial terms and in improving the quality or length of
life.
Manufacturing
In manufacturing, electronics are used not only in the final product but
also in the many processes used to create that product and get it to market.
Whether using robotics to perform a highly detailed manufacturing step or
to track inventory in a plant, electronics allow for more efficient methods
of producing more advanced products and lowering the production costs of
products.
Legal
To act as a patent attorney, one needs to have a technical grounding in
a particular field in addition to the training to be an attorney. People work-
ing in this specialized field create, protect, and defend the rights of those
who hold patents on their intellectual property and defend inventors from
unjustified claims of patent infringement.
To become a patent attorney, an advanced degree is usually required
paired with a law degree. Because of the specific educational require-
ments to be a patent lawyer, there is significant demand for those who are
qualified.
E
RESOURCES
In This Appendix
ll Shopping Resources
ll Microcontroller Sources
ll More Specialized Resources
ll Information Resources
O
ne of the most enjoyable aspects of working with electronics is be-
ing part of a community of electronics hobbyists. The new wave
of electronics aficionados call themselves “Makers,” and you will
find communities of Makers both online and in your own towns. Here is
a shopping list for all of the items used in the labs. The parts for the robot
project are listed in those chapters. The list below features items that can
be purchased from general retailers and those that are likely to be found
only at electronics specialty sources. We encourage you also to check your
local area to see if there is a specialty shop nearby. Those stores are likely to
have well-trained staff and fellow customers who can be a terrific resource
for advice, project ideas, and networking events.
Flashlight bulb
9V battery
AA battery
Jumper wire
Masking Tape
Wire cutters
Wire strippers
Screwdriver set
Lamp with magnifying glass
Pliers
Tweezers
Scientific calculator
Logic Probe
Oscilloscope (optional)
Digital multimeter
Breadboard
Solder 60/40
Soldering iron
Solder sucker
Solder wick
Flux
Heat Sink
Circuit board holder
Clip leads
Function generator
Ground strap
Ground mat
Fire extinguisher Class C type
2-SPST switches
2 lamps
Red LED
10Ω resistor
8-100Ω resistors
16-270Ω resistors
8-390Ω resistors
8-470Ω resistors
560Ω resistor
100KΩ resistor
1MΩ resistor
Photocell
0.01 µF capacitor
0.047 µ capacitor
10 µF electrolytic capacitor
100 µF electrolytic capacitor
2-220 µF electrolytic capacitors
25Ω rheostat
2N222 NPN transistor
4 or 8 DIP switch
7448 decoder
Common cathode 7 segment display
555 timer
7490 decade counter
1/4 inch mono jack
LM386 op amp
8 pin socket
5 KΩ potentiometer
Shopping Resources
Electronics specialty stores:
Adafruit Industries
www.adafruit.com
Taking inspiration from the Lady Ada Lovelace Byron herself, Adafruit
Industries is more than a store. There are forums, videos, and kits from
the very basic to 3-D printing supplies. They also support skills building
through the Adafruit Academy that connect to badges available for achieve-
ments in electronics, science, and engineering.
DigiKey
www.digikey.com
Aimed more directly at the professional market, this large online store
also has significant education resources and has an active newsroom and
social media presence.
Jameco Electronics
www.jameco.com
Jameco is a great resource for electronics for the hobbyist, the student,
and the professional. It offers a very broad range of products including
brand names, as well as more affordable components.
eBay
www.ebay.com
Microcontroller Sources:
Arduino Microcontrollers
www.arduino.cc/en/Main/Hardware
Home to the Arduino microcontroller community.
Microchip
www.microchip.com
Manufacturer of the PIC controllers.
Secret Labs
www.netduino.com
This is the site for the manufacturer of the microcontroller we use in
the robot in the book.
Information Resources:
San Jose State University’s Dr. Buff Furman’s Mechatronics Portal
www.engr.sjsu.edu/bjfurman/courses/ME106/mechatronicstutorials.
htm
Dr. Furman links to many online resources.
Microsoft Robotics
www.microsoft.com/robotics/
A portal site for Microsoft’s Robotics Developer Studio 4; it also in-
cludes case studies, tutorials, and links to robotics sources.
Data Sheet Catalog
www.datasheetcatalog.com
This site offers data sheets for just about everything.
Make: Online
www.makezine.com, www.makershed.com, and www.makerfaire.com
Make magazine’s tagline is “technology on your time.” This magazine
both inspires and reflects a renaissance of hands-on invention. The maga-
zine’s site offers podcasts related to the material covered in the magazine
and the companion store, Makershed. It offers project kits, tools, and books.
Maker Faire is the in-person gathering of Makers and vendors held in the
Bay Area and New York each year with almost 100 more Mini and Featured
Maker Faires held around the world.
Society of Robots
www.societyofrobots.com
Roboticist John Palmisano’s site has materials for beginners through
much more advanced robot designers.
F
ODD-NUMBERED
QUESTIONS
Chapter 1
1. negatively
3. ion
5. The physical characteristics and the temperature.
7. negative
9. Helium (He), Neon (Ne), Argon (Ar), Krypton (Kr), Xenon (Xe), and
Radon (Rn).
Chapter 2
1. The lamp
3. Any 3 of these: Chemical reactions, as in a battery, Electromagnetic
generators, Photovoltaic cells (solar), Generators that convert mechan-
ical energy to electrical energy, Friction, Thermoelectrical sources
5. electrons
7. 1.5V
9. 15W
Chapter 3
1. constant
3. cycle
5. phase
7. closed, no
9. series
Chapter 4
1. gauge
3. wave form
5. breadboard
7. tin, lead
9. function generator
Chapter 5
Chapter 6
1. circuit
3. actuator
5. double
7. gravitational
9. key
Chapter 7
1. fixed
3. this is in reverse, so 1, 5, × 106 which is 15,000,000 or 15 MA
5. ± 2
7. 3,7, × 100 or 37
9. False
Chapter 8
1. dielectric
3. True
5. Air, Hard Rubber, Glass
7. ±0.5
9. True
Chapter 9
Chapter 10
1. vacuum tubes
3. collector, emitter, base
5. False
7. amplifier
9. open switch
Chapter 11
1. True
3. half cells, electrolyte, separator
5. batteries arranged in series provide higher voltages to a circuit, bat-
teries arranged in parallel reduce the resistance of the batteries which
results in an increase in the overall current.
7. transformer, rectifier, smoothing, and regulator.
9. It is a power supply that draws power from two sources (AC mains and
battery) and can provide battery power if there is an interruption in
the AC mains power to ensure a near-instantaneous switch to prevent
damage or data loss.
Chapter 12
Chapter 13
1. LED
3. Resistor
5. Tapped secondary transformer/inductor
7. Diode
9. Potentiometer
Chapter 14
1. high, low
3. more compact transmission size, less likely to be affected by noise
5. OR
7. NAND
9. XOR
Chapter 15
1. True
3. logic
5. 1
7. astable, monostable, bistable
9. Encoders
Chapter 16
1. sampled
3. 16
5. 0-9. A-F
7. stack data, dynamic
9. False
Chapter 17
7. False
9. Any two folders: PIC, Atmel AVR, Intel 8051, Intel 8052, and BASIC
Stamp
Chapter 18
1. brushed DC
3. alternating
5. False
7. Hybrid
9. 50
Chapter 19
Chapter 20
1. transmitting, decoding
3. Noise
5. Peak
7. True
9. False
Chapter 25
1. Internet of Things
3. True
5. Protect device security, protect security of data, and protect
individuals’ privacy.
G
AND SUPPLEMENTARY
VIDEO DIRECTORY
NOTE: There is no audio for the labs.
W wire-wound resistors, 86
wall wart, 139 workbench, 64
watt (W), 19 writing and reading, 210–211
waveforms, 27–28 X
direct current (DC), 34
XNOR gate, truth table, 178, 179
Weller WLC 100, 57
XOR gate, truth table, 178, 179
wetting, flux and, 149–150
x-rays spectrum, 245
windings, transformers, 139
wiper, 88 Z
wire cutters, 46 Zener, Clarence, 117
wire gauge, 46 Zener diodes, 116–117
wire strippers, 46