Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
What is electricity?
Electricity is the flow of charge around a circuit carrying energy from the
battery (or power supply) to components such as lamps and motors.
Electricity can flow only if there is a complete circuit from the battery through
wires to components and back to the battery again.
The diagram shows a simple circuit of a battery, wires, a switch and a lamp.
The switch works by breaking the circuit.
With the switch open the circuit is broken - so electricity cannot flow and the
lamp is off.
With the switch closed the circuit is complete - allowing electricity to flow and
the lamp is on. The electricity is carrying energy from the battery to the lamp.
We can see, hear or feel the effects of electricity flowing such as a lamp
lighting, a bell ringing, or a motor turning - but we cannot see the electricity
itself, so which way is it flowing?
We say that electricity flows from the positive (+) terminal of a battery to the
negative (-) terminal of the battery. We can imagine particles with positive
electric charge flowing in this direction around the circuit, like the red dots in
the diagram.
2
However this is not the whole answer because the particles that move in fact
have negative charge! And they flow in the opposite direction! Please read
on...
The electron
When electricity was discovered scientists tried many experiments to find out
which way the electricity was flowing around circuits, but in those early days
they found it was impossible to find the direction of flow.
By the time the electron was discovered the idea of electricity flowing from +
to - (conventional current) was firmly established. Luckily it is not a problem to
think of electricity in this way because positive charge flowing forwards is
equivalent to negative charge flowing backwards.
Voltage and Current are vital to understanding electronics, but they are quite
hard to grasp because we can't see them directly.
Voltage attempts to make a current flow, and current will flow if the circuit is
complete. Voltage is sometimes described as the 'push' or 'force' of the
electricity, it isn't really a force but this may help you to imagine what is
happening. It is possible to have voltage without current, but current cannot
flow without voltage.
Voltage, V
You may find it helpful to think of voltage like height in geography. The reference point of zero
height is the mean (average) sea level and all heights are measured from that point. The zero
volts in an electronic circuit is like the mean sea level in geography.
Some circuits require a dual supply with three supply connections as shown
in the diagram. For these circuits the zero volts
reference point is the middle terminal between
the two parts of the supply.
Current, I
The need to break the circuit to connect in series means that ammeters are difficult to use on
soldered circuits. Most testing in electronics is done with voltmeters, which can be easily
connected without disturbing circuits.
In this circuit the 4V across the resistor and the 2V across the LED add up to
the battery voltage: 2V + 4V = 6V.
The current through all parts (battery, resistor and LED) is 20mA.
Ohm's Law
To make a current flow through a resistance there must be a voltage across
that resistance. Ohm's Law shows the relationship between the voltage (V),
current (I) and resistance (R). It can be written in three ways:
V V
V=I×R or I= or R=
R I
For most electronic circuits the amp is too large and the ohm is too small, so
we often measure current in milliamps (mA) and resistance in kilohms (k ). 1
mA = 0.001 A and 1 k = 1000 .
The Ohm's Law equations work if you use V, A and , or if you use V, mA
and k . You must not mix these sets of units in the equations so you may
need to convert between mA and A or k and .
What is power?
The typical power used in mains electrical circuits is much larger, so this
power may be measured in kilowatts (kW), 1kW = 1000W. For example a
typical mains lamp uses 60W and a kettle uses about 3kW.
There are three ways of writing an equation for power, current and voltage:
P P
Power = Current × Voltage so P = I × V or I = or V =
V I
where: P = power in watts (W) or: P = power in milliwatts (mW)
V = voltage in volts (V) V = voltage in volts (V)
I = current in amps (A) I = current in milliamps (mA)
You can use the PIV triangle to help you remember the three
versions of the power equations. Use it in the same way as the
P
Ohm's Law triangle. For most electronic circuits the amp is too
large, so we often measure current in milliamps (mA) and power in
milliwatts (mW). 1mA = 0.001A and 1mW = 0.001W. I V
10
Normally electric power is useful, making a lamp light or a motor turn for
example. However, electrical energy is converted to heat whenever a current
flows through a resistance and this can be a problem if it makes a device or
wire overheat. In electronics the effect is usually negligible, but if the
resistance is low (a wire or low value resistor for example) the current can be
sufficiently large to cause a problem.
You can see from the equation P = I² × R that for a given resistance the power
depends on the current squared, so doubling the current will give 4 times the
power.
Resistors are rated by the maximum power they can have developed in
them without damage, but power ratings are rarely quoted in parts lists
because the standard ratings of 0.25W or 0.5W are suitable for most circuits.
Further information is available on the Resistors page.
Wires and cables are rated by the maximum current they can pass without
overheating. They have a very low resistance so the maximum current is
relatively large.
Energy
The amount of energy used (or supplied) depends on the power and the time
for which it is used:
A low power device operating for a long time can use more energy than a high
power device operating for a short time. For example:
The standard unit for energy is the joule (J), but 1J is a very small amount of
energy for mains electricity so kilojoule (kJ) or megajoule (MJ) are sometimes
used in scientific work. In the home we measure electrical energy in kilowatt-
hours (kWh). 1kWh is the energy used by a 1kW power appliance when it is
switched on for 1 hour:
For example:
Alternating Current (AC) flows one way, then the other way, continually
reversing direction.
The diagram shows a sine wave but these properties apply to any signal with
a constant shape.
1 1
frequency = and time period =
time period frequency
Instead we use the root mean square voltage (VRMS), which is 0.7 of the
peak voltage (Vpeak):
The RMS value is the effective value of a varying voltage or current. It is the
equivalent steady DC (constant) value, which gives the same effect.
For example a lamp connected to a 6V RMS AC supply will light with the
same brightness when connected to a steady 6V DC supply. However, the
lamp will be dimmer if connected to a 6V peak AC supply because the RMS
value of this is only 4.2V (it is equivalent to a steady 4.2V DC).
You may find it helps to think of the RMS value as a sort of average, but
please remember that it is NOT really the average! In fact the average voltage
(or current) of an AC signal is zero because the positive and negative parts
exactly cancel out!
AC voltmeters and ammeters show the RMS value of the voltage or current.
DC meters also show the RMS value when connected to varying DC providing
the DC is varying quickly, if the frequency is less than about 10Hz you will see
the meter reading fluctuating instead.
What does '6V AC' really mean, is it the RMS or peak voltage?
For example a '6V AC supply' means 6V RMS, the peak voltage is 8.6V. If the
main supply is 230V AC, this means 230V RMS, then the peak voltage of the
mains is about 320V!
First square all the values, then find the average (mean) of these square
values over a complete cycle, and find the square root of this average. That is
16
the RMS value. Confused? Ignore the maths (it looks more complicated than
it really is), just accept that RMS values for voltage and current are a much
more useful quantity than peak values
Power Supplies
Next Page: Transducers
17
There are many types of power supply. Most are designed to convert high
voltage AC mains electricity to a suitable low voltage supply for electronics
circuits and other devices. A power supply can by broken down into a series
of blocks, each of which performs a particular function.
Dual Supplies
Dual supplies have three outputs, for example a ±9V supply has +9V, 0V and
-9V outputs.
Transformer only
18
The low voltage AC output is suitable for lamps, heaters and special AC
motors. It is not suitable for electronic circuits unless they include a rectifier
and a smoothing capacitor.
Transformer + Rectifier
The varying DC output is suitable for lamps, heaters and standard motors. It
is not suitable for electronic circuits unless they include a smoothing
capacitor.
The smooth DC output has a small ripple. It is suitable for most electronic
circuits.
The regulated DC output is very smooth with no ripple. It is suitable for all
electronic circuits.
Transformer
circuit symbol
Transformer
Transformer
20
The input coil is called the primary and the output coil is called the
secondary. There is no electrical connection between the two coils; instead
they are linked by an alternating magnetic field created in the soft-iron core of
the transformer. The two lines in the middle of the circuit symbol represent the
core.
Transformers waste very little power so the power out is (almost) equal to the
power in. Note that as voltage is stepped down current is stepped up.
The ratio of the number of turns on each coil, called the turns ratio,
determines the ratio of the voltages. A step-down transformer has a large
number of turns on its primary (input) coil, which is connected to the high
voltage mains supply, and a small number of turns on its secondary (output)
coil to give a low output voltage.
Vp Np power out = power in
turns ratio = = and
Vs Ns Vs × Is = Vp × Ip
Vp = primary (input) voltage Vs = secondary (output) voltage
Np = number of turns on primary coil Ns = number of turns on secondary coil
Ip = primary (input) current Is = secondary (output) current
Rectifier
Bridge rectifier
A bridge rectifier can be made using four individual diodes, but it is also available in
special packages containing the four diodes required. It is called a full-wave rectifier
because it uses all the AC wave (both positive and negative sections). 1.4V is used up
in the bridge rectifier because each diode uses 0.7V when conducting and there are
always two diodes conducting, as shown in the diagram below. Bridge rectifiers are
21
rated by the maximum current they can pass and the maximum reverse voltage they
can withstand (this must be at least three times the supply RMS voltage so the
rectifier can withstand the peak voltages). Please see the Diodes page for more details,
including pictures of bridge rectifiers.
A single diode can be used as a rectifier but this produces half-wave varying
DC which has gaps when the AC is negative. It is hard to smooth this sufficiently well
to supply electronic circuits unless they require a very small current so the smoothing
capacitor does not significantly discharge during the gaps. Please see the Diodes page
for some examples of rectifier diodes.
Smoothing
5 × Io
Smoothing capacitor for 10% ripple, C =
Vs × f
Voltage regulator
Regulator
Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or
variable output voltages. They are also rated by the maximum current they
can pass. Negative voltage regulators are available, mainly for use in dual
23
The resistor limits the current (like an LED resistor). The current through the
resistor is constant, so when there is no output current all the current flows
through the zener diode and its power rating Pz must be large enough to
withstand this.
Transducers
Next Page: Voltage Dividers
Input Transducers
25
Examples:
LDR
LDR converts brightness (of light) to resistance.
Thermistor converts temperature to resistance.
Microphone converts sound to voltage.
Variable resistor converts position (angle) to resistance.
Output Transducers
Examples:
Loudspeaker
Lamp converts electricity to light.
LED converts electricity to light.
Loudspeaker converts electricity to sound.
Motor converts electricity to motion.
Heater converts electricity to heat.
VoltageDivider
Next Page: Transistor
Circuits
27
If you need a precise value for the output voltage Vo you can use Ohm's law and a little
algebra to work out the formula for Vo shown on the right. The formula and the approximate
rules given above assume that negligible current flows from the output. This is true if Vo is
connected to a device with a high resistance such as voltmeter or a chip input. For further
information please see the page on impedance. If the output is connected to a transistor Vo
cannot become much greater than 0.7V because the transistor's base-emitter junction
behaves like a diode.
Voltage dividers are also called potential dividers, a name which comes
from potential difference (the proper name for voltage).
Most input transducers (sensors) vary their resistance and usually a voltage
divider is used to convert this to a varying voltage which is more useful. The
voltage signal can be fed to other parts of the circuit, such as the input to a
chip or a transistor switch.
The sensor is one of the resistances in the voltage divider. It can be at the
top (R1) or at the bottom (R2), the choice is determined by when you want a
large value for the output voltage Vo:
Put the sensor at the top (R1) if you want a large Vo when the sensor
has a small resistance.
Put the sensor at the bottom (R2) if you want a large Vo when the
sensor has a large resistance.
OR
The value of the resistor R will determine the range of the output voltage Vo.
For best results you need a large 'swing' (range) for Vo and this is achieved if
the resistor is much larger than the sensor's minimum resistance Rmin, but
much smaller than the sensor's maximum resistance Rmax.
You can use a multimeter to help you find the minimum and maximum values
of the sensor's resistance (Rmin and Rmax). There is no need to be precise,
approximate values will do.
For example:
An LDR: Rmin = 100 , Rmax = 1M , so R = square root of (100 × 1M) = 10k .
The resistor and sensor can be swopped over to invert the action of the
voltage divider. For example an LDR has a high resistance when dark and a
low resistance when brightly lit, so:
If the LDR is at the top (near +Vs),
Vo will be low in the dark and high in bright light.
If the LDR is at the bottom (near 0V),
Vo will be high in the dark and low in bright light.
29
If you are planning to use a variable resistor connected between the +Vs
supply and the base of a transistor you must include a resistor in series with
the variable resistor. This is to prevent excessive base current destroying the
transistor when the variable resistor is reduced to zero.
30
Transistor Circuit
Types of transistor
The leads are labeled base (B), collector (C) and emitter (E).
These terms refer to the internal operation of a transistor but they are not much help in
understanding how a transistor is used, so just treat them as labels!
Transistor currents
(C) to its emitter (E). This collector current is large enough to make LED C
light brightly.
When the switch is open no base current flows, so the transistor switches
off the collector current. Both LEDs are off.
This arrangement where the emitter (E) is in the controlling circuit (base current) and in the
controlled circuit (collector current) is called common emitter mode. It is the most widely
used arrangement for transistors so it is the one to learn first.
Additional notes:
A resistor is often needed in series with the base connection to limit the
base current IB and prevent the transistor being damaged.
Transistors have a maximum collector current I C rating.
The current gain hFE can vary widely, even for transistors of the
same type!
A transistor that is full on (with RCE = 0) is said to be 'saturated'.
When a transistor is saturated the collector-emitter voltage V CE is
reduced to almost 0V.
32
Darlington pair
This is two transistors connected together so that the current amplified by the
first is amplified further by the second transistor. The overall current gain is
equal to the two individual gains multiplied together:
This gives the Darlington pair a very high current gain, such as 10000, so that
only a tiny base current is required to make the pair switch on.
Darlington pairs are available as complete packages but you can make up
your own from two transistors; TR1 can be a low power type, but normally
TR2 will need to be high power. The maximum collector current I C(max) for
the pair is the same as IC(max) for TR2.
33
This means that the transistor should not become hot in use and you do not
need to consider its maximum power rating. The important ratings in switching
circuits are the maximum collector current IC(max) and the minimum
current gain hFE(min). The transistor's voltage ratings may be ignored unless
you are using a supply voltage of more than about 15V. There is a table
showing technical data for some popular transistors on the transistors page.
For information about the operation of a transistor please see the functional
model above.
Protection diode
The diagram shows how this is connected 'backwards' so that it will normally
NOT conduct. Conduction only occurs when the load is switched off, at this
moment current tries to continue flowing through the coil and it is harmlessly
diverted through the diode. Without the diode no current
could flow and the coil would produce a damaging high
voltage 'spike' in its attempt to keep the current flowing.
Advantages of relays:
Relays
Relays can switch AC and DC, transistors can only switch
DC.
Relays can switch high voltages, transistors cannot.
Relays are a better choice for switching large currents (> 5A).
Relays can switch many contacts at once.
Disadvantages of relays:
Relays are bulkier than transistors for switching small currents.
Relays cannot switch rapidly, transistors can switch many times per second.
Relays use more power due to the current flowing through their coil.
Relays require more current than many chips can provide, so a low power
transistor may be needed to switch the current for the relay's coil.
Most chips cannot supply large output currents so it may be necessary to use
a transistor to switch the larger current required for output devices such as
lamps, motors and relays. The 555 timer chip is unusual because it can
supply a relatively large current of up to 200mA which is sufficient for some
output devices such as low current lamps, buzzers and many relay coils
without needing to use a transistor.
A resistor RB is required to limit the current flowing into the base of the
transistor and prevent it being damaged. However, R B must be sufficiently low
to ensure that the transistor is thoroughly saturated to prevent it overheating,
this is particularly important if the transistor is switching a large current (>
35
100mA). A safe rule is to make the base current I B about five times larger than
the value which should just saturate the transistor.
Example
The output from a 4000 series CMOS chip is required to operate a relay with a 100 coil.
The supply voltage is 6V and the chip can supply a maximum current of 5mA.
1. Load current = Vs/RL = 6/100 = 0.06A = 60mA, so transistor must have IC(max) >
60mA.
2. The maximum current from the chip is 5mA, so transistor must have hFE(min) > 60
(5 × 60mA/5mA).
3. Choose general purpose low power transistor BC182 with IC(max) = 100mA and
hFE(min) = 100.
4. RB = 0.2 × RL × hFE = 0.2 × 100 × 100 = 2000 . so choose RB = 1k8 or 2k2.
36
The procedure for choosing a suitable PNP transistor is exactly the same as
that for an NPN transistor described above.
Note that the switching action of this circuit is not particularly good because
there will be an intermediate brightness when the transistor will be partly on
(not saturated). In this state the transistor is in danger of overheating unless it
is switching a small current. There is no problem with the small LED current,
but the larger current for a lamp, motor or relay is likely to cause overheating.
Other sensors, such as a thermistor, can be used with this circuit, but they
may require a different variable resistor. You can calculate an approximate
value for the variable resistor (Rv) by using a multimeter to find the minimum
and maximum values of the sensor's resistance (Rmin and Rmax):
You can make a much better switching circuit with sensors connected to a
suitable IC (chip). The switching action will be much sharper with no partly on
38
state.
Inverters (NOT gates) are available on logic chips but if you only require one
inverter it is usually better to use this circuit. The output signal (voltage) is the
inverse of the input signal:
When the input is high (+Vs) the output
is low (0V).
When the input is low (0V) the output
is high (+Vs).
If you are connecting the inverter to a CMOS logic chip input (very high
impedance) you can increase RB to 100k and RC to 10k , this will reduce
the current used by the inverter.
An analogue meter can display any value within the range available on its
scale. However, the precision of readings is limited by our ability to read them.
For example the meter on the right shows 1.25V because the pointer is
estimated to be half way between 1.2 and 1.3. The analogue meter can show
any value between 1.2 and 1.3 but we are unable to read the scale more
precisely than about half a division.
All electronic circuits suffer from 'noise' which is unwanted signal mixed in with
the desired signal, for example an audio amplifier may pick up some mains
'hum' (the 50Hz frequency of the UK mains electricity supply). Noise can be
difficult to eliminate from analogue signals
because it may be hard to distinguish from
the desired signal.
Digital systems
Digital systems process digital signals which can take only a limited number of
values (discrete steps), usually just two values are used: the positive supply
voltage (+Vs) and zero volts (0V).
A digital meter can display many values, but not every value within its range.
For example the display on the right can show 6.25 and 6.26 but not a value
between them. This is not a problem because digital meters normally have
40
Logic Gates
41
Introduction Logic states
True False
Logic gates process signals which represent true or false.
Normally the positive supply voltage +Vs represents true and 1 0
0V represents false. Other terms which are used for the true High Low
and false states are shown in the table on the right. It is best to
be familiar with them all. +Vs 0V
On Off
Gates are identified by their function: NOT, AND, NAND, OR,
NOR, EX-OR and EX-NOR. Capital letters are normally used to make it clear
that the term refers to a logic gate.
Truth tables
Input A Input B Output Q
A truth table is a good way to show the function of 0 0 0
a logic gate. It shows the output states for every
0 1 0
possible combination of input states. The symbols
0 (false) and 1 (true) are usually used in truth 1 0 0
tables. The example truth table on the right shows 1 1 1
the inputs and output of an AND gate.
Logic ICs
The output Q is true when the input A is NOT true, the output is the inverse of
the input: Q = NOT A
A NOT gate can only have one input. A NOT gate is also called an inverter.
Input A Output Q
0 1
1 0
AND gate
The output Q is true if input A AND input B are both true: Q = A AND B
An AND gate can have two or more inputs, its output is true if all inputs are true.
This is an AND gate with the output inverted, as shown by the 'o' on the
output.
The output is true if input A AND input B are NOT both true:
Q = NOT (A AND B)
A NAND gate can have two or more inputs, its output is true if NOT all inputs are
true.
OR gate
The output Q is true if input A OR input B is true (or both of them are true):
Q = A OR B
An OR gate can have two or more inputs, its output is true if at least one input is true.
This is an OR gate with the output inverted, as shown by the 'o' on the output.
The output Q is true if NOT inputs A OR B are true: Q = NOT (A OR B)
A NOR gate can have two or more inputs, its output is true if no inputs are true.
The output Q is true if either input A is true OR input B is true, but not when
both of them are true: Q = (A AND NOT B) OR (B AND NOT A)
This is like an OR gate but excluding both inputs being true.
The output is true if inputs A and B are DIFFERENT.
EX-OR gates can only have 2 inputs.
This is an EX-OR gate with the output inverted, as shown by the 'o' on the
output.
The output Q is true if inputs A and B are the SAME (both true or both false):
Q = (A AND B) OR (NOT A AND NOT B)
EX-NOR gates can only have 2 inputs.
The summary truth tables below show the output states for all types of 2-input and 3-
input gates.
47
Inputs
OR N
OREX Summary for all 3-input gates
-
OREX Inputs Output of each gate
- B A B C AND NAND OR NOR
NORO 0 0 0 0 1 0 1
utput of
each 0 0 1 0 1 1 0
gate A 0 1 0 0 1 1 0
0A 0 1 1 0 1 1 0
ND
0 0 1 0 1 0 1 1 0 0 0 1 1 0
NA
ND 1 0 1 0 1 1 0
0 1 0 1 1 0 1 0 1 1 0 0 1 1 0
1 0 0 1 1 0 1 0 1 1 1 1 0 1 0
1 1 1 0 1 0 0 1
Q = A AND NOT B
Truth tables can be used to work out the function of a combination of gates.
Inputs Outputs
A B C D E Q
48 0 0 0 1 0 1
0 0 1 1 0 1
For example the truth table on the right show the 0 1 0 0 0 0
intermediate outputs D and E as well as the final output
Q for the system shown below. 0 1 1 0 1 1
1 0 0 0 0 0
1 0 1 0 0 0
1 1 0 0 0 0
1 1 1 0 1 1
D = NOT (A OR B)
E = B AND C
Q = D OR E = (NOT (A OR B)) OR (B AND C)
Logic gates are available on ICs which usually contain several gates of the
same type, for example four 2-input NAND gates or three 3-input NAND
gates. This can be wasteful if only a few gates are required unless they are all
the same type. To avoid using too many ICs you can reduce the number of
gate inputs or substitute one type of gate for another.
The number of inputs to a gate can be reduced by connecting two (or more)
inputs together. The diagram shows a 3-input AND gate
operating as a 2-input AND gate.
Reducing a NAND or NOR gate to just one input creates a NOT gate. The
diagram shows this for a 2-input NAND gate.
For example an OR gate can be built from NOTed inputs fed into a NAND
(AND + NOT) gate.
The table below shows the NAND gate equivalents of NOT, AND, OR and
NOR gates:
Gate Equivalent in NAND gates
NOT
AND
OR
NOR
Then simplify the system by deleting adjacent pairs of NOT gates (marked X
above). This can be done because the second NOT gate cancels the action of
the first.
The final system is shown on the right. It has five NAND gates and requires
two ICs (with four gates on each IC). This is better than the original system,
which required three ICs (one for each type of gate).
Substituting NAND (or NOR) gates does not always increase the number of
gates, but when it does (as in this example) the increase is usually only one or
51
two gates. The real benefit is reducing the number of ICs required by using
just one type of gate.
Note that capacitors return their stored energy to the circuit. They do not 'use
up' electrical energy by converting it to heat as a resistor does. The energy
stored by a capacitor is much smaller than the energy stored by a battery so
they cannot be used as a practical source of energy for most purposes.
Capacitive Reactance Xc
For example a 1µF capacitor has a reactance of 3.2k for a 50Hz signal, but
when the frequency is higher at 10kHz its reactance is only 16 .
53
Note that these equations are the opposite way round for resistors in series
and parallel.
Charging a capacitor
time constant is
in seconds (s)
time consta wh R = resistance Graphs showing the current and
nt = R × C ere: in ohms ( ) voltage for a capacitor charging
C = capacitance time constant = RC
in farads (F)
For example:
If R = 47k and C = 22µF, then the
time constant, RC = 47k × 22µF =
1.0s.
If R = 33k and C = 1µF, then the time
constant, RC = 33k × 1µF = 33ms.
After each time constant the current falls by 1/e (about 1/3). After 5 time
constants (5RC) the current has fallen to less than 1% of its initial value and
we can reasonably say that the capacitor is fully charged, but in fact the
capacitor takes for ever to charge fully!
The bottom graph shows how the voltage (V) increases as the capacitor
charges. At first the voltage changes rapidly because the current is large;
but as the current decreases, the charge builds up more slowly and the
voltage increases more slowly.
After 5 time constants (5RC) the capacitor is almost fully charged with its voltage
almost equal to the supply voltage. We can reasonably say that the capacitor is fully
56
charged after 5RC, although really charging continues for ever (or until the circuit is
changed).
Discharging a capacitor
At first the current is large because the voltage is large, so charge is lost
quickly and the voltage decreases rapidly. As charge is lost the voltage is
reduced making the current smaller so the rate of discharging becomes
progressively slower.
After 5 time constants (5RC) the voltage across the capacitor is almost zero and we
can reasonably say that the capacitor is fully discharged, although really discharging
continues for ever (or until the circuit is changed).
57
Uses of Capacitors
For successful capacitor coupling in an audio system the signals must pass
through with little or no distortion. This is achieved if the time constant (RC) is
larger than the time period (T) of the lowest frequency audio signals required
(typically 20Hz, T = 50ms).
Output when RC = T
When the time constant is equal to the time period you can see that the
capacitor has time to partly charge and discharge before the signal changes.
As a result there is significant distortion
of the signal as it passes through the
CR-coupling. Notice how the sudden
changes of the input signal pass
straight through the capacitor to the
output.
'555 timer' is specified. The 556 is a dual version of the 555 housed in a 14-
pin package, the two timers (A and B) share the same power supply pins. The
circuit diagrams on this page show a 555, but they could all be adapted to use
one half of a 556.
Low power versions of the 555 are made, such as the ICM7555, but these
should only be used when specified (to increase battery life) because their
maximum output current of about 20mA (with a 9V supply) is too low for many
standard 555 circuits. The ICM7555 has the same pin arrangement as a
standard 555.
The circuit symbol for a 555 (and 556) is a box with the pins arranged to suit
the circuit diagram: for example 555 pin 8 at the top for the +Vs supply, 555
pin 3 output on the right. Usually just the pin numbers are used and they are
not labeled with their function.
The 555 and 556 can be used with a supply voltage (Vs) in the range 4.5 to
15V (18V absolute maximum).
Standard 555 and 556 chips create a significant 'glitch' on the supply when
their output changes state. This is rarely a problem in simple circuits with no
other ICs, but in more complex circuits a smoothing capacitor (e.g. 100µF)
should be connected across the +Vs and 0V supply near the 555 or 556.
The input and output pin functions are described briefly below and there are
fuller explanations covering the various circuits:
Inputs of 555/556
Trigger input: when < 1/3 Vs ('active low') this makes the output high (+Vs). It
monitors the discharging of the timing capacitor in an astable circuit. It has a
high input impedance > 2M .
impedance > 10M .
* providing the trigger input is < 1/3 Vs (the trigger input overrides the threshold input).
Output of 555/556
The output of a standard 555 or 556 can sink and source up to 200mA. This is
more than most chips and it is sufficient to supply many output transducers
directly, including LEDs (with a resistor in series), low current lamps, piezo
transducers, loudspeakers (with a capacitor in series), relay coils (with diode
protection) and some motors (with diode protection). The output voltage does
not quite reach 0V and +Vs, especially if a large current is flowing.
The ability to both sink and source current means that two devices can be
connected to the output so that one is on when the output is low and the other
61
is on when the output is high. The top diagram shows two LEDs connected in
this way.
Loudspeakers
Piezo transducers may be connected directly to the output and do not require
a capacitor in series.
Like all ICs, the 555 and 556 must be protected from the brief high voltage
'spike' produced when an inductive load such as a relay coil is switched off.
The standard protection diode must be connected 'backwards' across the the
relay coil as shown in the diagram.
However, the 555 and 556 require an extra diode connected in series with
the coil to ensure that a small current cannot be fed back into the IC. Without
this extra diode monostable circuits may re-trigger themselves as the coil is
switched off! The coil current passes through the extra diode so it must be a
1N4001 or similar rectifier diode
capable of passing the current, a
signal diode such as a 1N4148 is
usually not suitable.
555 astable output, a square wave
(Tm and Ts may be different)
555/556 Astable
(R1 + 2R2) × C1
For a standard astable circuit Tm cannot be less than Ts, but this is not too
restricting because the output can both sink and source current. For example
an LED can be made to flash briefly with long gaps by connecting it (with its
resistor) between +Vs and the output. This way the LED is on during Ts, so
brief flashes are achieved with R1 larger than R2, making Ts short and Tm
long. If Tm must be less than Ts a diode can be added to the circuit as
explained under duty cycle
below. 555 astable frequencies
R2 = 10k R2 = 100k R2 = 1M
C1
R1 = 1k R1 = 10k R1 = 100k
Choosing R1, R2 and C1 0.001µF 68kHz 6.8kHz 680Hz
R1 and R2 should be in the 0.01µF 6.8kHz 680Hz 68Hz
range 1k to 1M . It is best to 0.1µF 680Hz 68Hz 6.8Hz
choose C1 first because 1µF 68Hz 6.8Hz 0.68Hz
capacitors are available in just
a few values. 10µF 6.8Hz 0.68Hz 0.068Hz
(41 per min.) (4 per min.)
Choose C1 to suit the
frequency range you require (use the table as a guide).
Choose R2 to give the frequency (f) you require. Assume that R1 is much
smaller than R2 (so that Tm and Ts are almost equal), then you can use:
0.7
R2 =
f × C1
Choose R1 to be about a tenth of R2 (1k min.) unless you want the
mark time Tm to be significantly longer than the space time Ts.
If you wish to use a variable resistor it is best to make it R2.
If R1 is variable it must have a fixed resistor of at least 1k in series
(this is not required for R2 if it is variable).
Astable operation
63
With the output high (+Vs) the capacitor C1 is charged by current flowing
through R1 and R2. The threshold and trigger inputs monitor the capacitor
voltage and when it reaches 2/3Vs (threshold voltage) the output becomes low
and the discharge pin is connected to 0V.
An astable can be used to provide the clock signal for circuits such as
counters.
A low frequency astable (< 10Hz) can be used to flash an LED on and off,
higher frequency flashes are too fast to be seen clearly. Driving a loudspeaker
or piezo transducer with a low frequency of less than 20Hz will produce a
series of 'clicks' (one for each low/high transition) and this can be used to
make a simple metronome.
Duty cycle
Tm + Ts R1 + 2R2
Tm R1
Duty cycle with diode = =
Tm + Ts R1 + R2
555/556 Monostable
The duration of the pulse is called the time period (T) and resistor R1 and
capacitor C1 determine this:
Why 1.1? The capacitor charges to 2/3 = 67% so it is a bit longer than the time constant
(R1 × C1) which is the time taken to charge to 63%.
Monostable operation
The timing period is triggered (started) when the trigger input (555 pin 2) is
less than 1/3 Vs, this makes the output high (+Vs) and the capacitor C1 starts
to charge through resistor R1. Once the time period has started further trigger
pulses are ignored.
The capacitor takes a short time to charge, briefly holding the input close to
0V when the circuit is switched on. A switch may be connected in parallel with
the capacitor if manual operation is also required.
Edge-triggering
The resistor between the trigger (555 pin 2) and +Vs ensures that the trigger
is normally high (+Vs).
67
When the input voltage is between 1/3 and 2/3 Vs the output remains in its
present state. This intermediate input region is a deadspace where there is no
response, a property called hysteresis, it is like backlash in a mechanical
linkage. This type of circuit is called a Schmitt trigger.
Counting Circuits
Binary numbers
69
Logic states
True False
Electronic circuits count in binary. This is the simplest possible
counting system because it uses just two digits, 0 and 1, 1 0
exactly like logic signals where 0 represents false and 1 High Low
represents true. The terms low and high are also used for 0
and 1 respectively as shown in the table. +Vs 0V
On Off
Counting one, two, three, four, five in binary: 1, 10, 11, 100,
101.
Binary numbers rapidly become very long as the count increases and this
makes them difficult for us to read at a glance. Fortunately it is rarely
necessary to read more than 4 binary digits at a time in counting circuits.
In a binary number each digit represents a multiple of two (1, 2, 4, 8, 16 etc), in the
same way that each digit in decimal represents a multiple of ten (1, 10, 100, 1000 etc).
Digit value: 128 64
32 16 8 4 2 1
Binary number: 1 0 1 1 0 1 1 0
Decimal value: 128 + 0 + 32 + 16 + 0 + 4 + 2 + 0 = 182
A block of 4 bits is called a nibble (half a byte!) and it can hold a maximum
number of 1111 = 15 in decimal. Many counting circuits work with blocks of 4
bits because this number of bits is required to count up to 9 in decimal. (The
maximum number with 3 bits is only 7).
4-bit numbers
Binary Decimal Hex
D C B A base 16
70 0000 0 0
0001 1 1
0010 2 2
The table on the right shows the 4-bit numbers and 0 0 1 1 3 3
their decimal values. 0100 4 4
0101 5 5
The labels A, B, C, D are widely used in electronics to 0 1 1 0 6 6
represent the four bits: 0111 7 7
1000 8 8
A = 1, the 'least significant bit' (LSB) 1001 9 9
B=2 1010 10 A
C=4 1011 11 B
D = 8, the 'most significant bit' (MSB) 1100 12 C
1101 13 D
Binary Coded Decimal, BCD 1110 14 E
1111 15 F
Binary Coded Decimal, BCD, is a special version of
4-bit binary where the count resets to zero (0000) after the ninth count (1001).
It is used by decade counters and is easily converted to display the decimal
digits 0-9 on a 7-segment display.
The animated block diagram shows a clock signal driving a 4-bit (0-15)
counter with LEDs connected to show the state of the clock and counter
outputs QA-QD (Q indicates an output).
The LED on the first output QA flashes at half the frequency of the clock LED.
In fact the frequency of each stage of the counter is half the frequency of the
previous stage. You can see this pattern too in the table above showing the 4-
bit numbers.
Notice how output QA changes state every time the clock input changes from
high to low (that is when the clock LED turns off), this is called the falling-
edge. If you watch the counting closely you can see that QB changes on the
falling-edge of QA, QC on the falling-edge of QB and so on.
You may be surprised to see the diagram drawn with the input on the right and signals flowing
from right to left, the opposite way to the usual convention in electronics! Drawing counter
circuits like this means that the outputs are in the correct binary order for us to read easily and
I think this is more helpful than rigidly sticking to the usual 'left to right' convention.
In most circuits the ripple delay is not a problem because it is far too short to
be seen on a display. However, a logic system connected to ripple counter
outputs will briefly see false counts, which may produce 'glitches' in the logic
system and may disrupt its operation. For example a ripple counter changing
from 0111 (7) to 1000 (8) will very briefly show 0110, 0100 and 0000 before
1000!
It may seem odd that ripple counters use the falling-edge, but in fact this makes it easy to link
counters because the most significant bit (MSB) of one counter can drive the clock input of
the next. This works because the next bit must change state when the previous bit changes
from high to low - the point at which a carry must occur to the next bit. Synchronous counters
usually have carry out and carry in pins for linking counters without introducing any ripple
delays.
Resetting a counter
Counters can be reset to zero before their maximum count by connecting one
(or more) of their outputs to their reset input,
using an AND gate to combine outputs if
necessary.
Presetting
Some counters can be preset by presenting a number to their inputs A-D and
activating a preset input to load the number into the counter. By making inputs
A-D all low you can also use this to reset the counter to zero.
Frequency division
Counters can be used to reduce the frequency of an input (clock) signal. Each
stage of a counter halves the frequency, so for a 4-bit (0-15) counter QA is 1/2,
QB is 1/4, QC is 1/8 and QD is 1/16 of the clock frequency. Division by numbers
that are not powers of 2 is possible by resetting counters.
Frequency division is one of the main purposes of counters with more than 4
bits and their outputs are usually labeled Q1, Q2 and so on. Qn is the nth
stage of the counter, representing 2n. For example Q4 is 24 = 16 (1/16 of clock
frequency) and Q12 is 212 = 4096 (1/4096 of clock frequency).
Decoders
The most popular type is a 1-of-10 decoder which contains a network of logic
gates to make one of its ten outputs Q0-9
become high (or low) in response to the BCD
(binary coded decimal) inputs A-D. For example
an input of binary 0101 (=5) will activate output
Q5.
Common Anode (CA or SA) with all the LED anodes connected
together. These need a display driver with outputs which become low
to light each segment, for example the 7447. Connect the common
anode to +Vs.
Common Cathode (CC or SC) with all the cathodes connected
together. These need a display driver with outputs which become high
to light each segment, for example the 4511. Connect the common
cathode to 0V.
Multiplexing
If there are many 7-segment display digits multiplexing is usually used. This
is a system of switching so that of all the decade counters share a single
display driver which is connected to all of the displays. The output of each
counter is connected in turn to the inputs of the display driver and at the same
time the common anode/cathode of the corresponding 7-segment display is
connected so that only one display lights at a time.The switching is done very
rapidly (typically 400 - 1000Hz) and the segment current is larger than normal
so the display appears continuous and of normal brightness. Multiplexing
requires ICs to do the switching, but the complete circuit has fewer ICs than
having one display driver for each display.
Linking Counters
conversion to decimal very easy: the first counts the units, the second counts
the tens, the third the hundreds and so on.
Some dual counter ICs are available with two separate counters on the same
IC, the two counters must be linked externally if required (there is no internal
link).
The way that counters are linked depends on the nature of the counter. The
diagrams below show the general arrangements for standard ripple and
synchronous counters but it is important to read the detailed information for
particular counters, consulting a datasheet if necessary.
The diagram below shows how to link standard ripple counters. Notice how
the highest output QD of each counter drives the clock (CK) input of the next
counter. This works because ripple counters have clock inputs that are 'active-
low' which means that the count advances as the clock input becomes low, on
the falling-edge.
Remember that with all ripple counters there will be a slight delay before the
later outputs respond to the clock signal, especially with a long counter chain.
This is not a problem in simple circuits driving displays, but it may cause
glitches in logic systems connected to the counter outputs.
The diagram below shows how to link standard synchronous counters. Notice
how all the clock (CK) inputs are linked, and carry out (CO) is used to feed
the carry in (CI) of the next counter. This ensures that the entire counter
chain is synchronous, with every output changing at the same time.
Carry in (CI) of the first counter should be made low or high to suit the
particular counter IC being used.
76