6309114.pdf

(327 KB) Pobierz
05di.qxd
design ideas
EDITED BY BRAD THOMPSON
AND FRAN GRANVILLE
READERS SOLVE DESIGN PROBLEMS
Op amp can source or sink current
DIs Inside
76 Simple digital filter
cleans up noisy data
78 Single switch selects
one of three signals
80 Low-cost audio filter
suppresses noise and hum
82 Microprocessor’s single-
interrupt input processes
multiple external interrupts
What are your design problems
and solutions? Publish them here
and receive $150! Send your
Design Ideas to edndesignideas@
reedbusiness.com.
Alfredo H Saab and Steve Logan,
Maxim Integrated Products Inc, Sunnyvale, CA
When you design for electronics
applications, such as sensor or
amplifier bias supplies or special wave-
form generators, a controlled constant-
current source or sink circuit can serve
as a useful building block. These cir-
cuits exhibit high dynamic-output
impedance and deliver relatively large
currents within an allowed range of
compliance voltage. You can imple-
ment a constant-current circuit with an
op amp and a discrete external transis-
tor, but you can also design a bipolar
version of a current source or sink
around a single op amp and a few resis-
tors ( Figure 1 ). The constant-current
sink circuits in Figure 1a through Fig-
ure 1c offer various compromises
between precision, dynamic imped-
ance, and compliance range.
The circuit in Figure 1d describes a
bipolar current source with a simpler
feedback configuration than that of the
usual Howland-current pump, which
requires positive feedback and presents
variable input impedance. Figure 1e
shows a constant-current source. All of
these circuits exhibit excellent linear-
ity of output current with respect to
input voltage.
The output from the circuit in Fig-
ure 1a includes an uncertainty due to
the op amp’s quiescent current, which
adds to the calculated output current.
For example, in most applications, you
can neglect the MAX4162 op amp’s
quiescent current of approximately 25
V+
OUTPUT
CURRENT
(SINK)
OUTPUT
CURRENT
(SINK)
INPUT
VOLTAGE
INPUT
VOLTAGE
_
_
_
V+
V+
V+
MAX4162
MAX4162
MAX4162
+
V
+
V
OUTPUT
CURRENT
(SINK)
+
V
A. The circuit in Figure 1b behaves
similarly, but its quiescent current sub-
tracts from the ideal output-current
value. The circuit in Figure 1c provides
a current sink with no quiescent-cur-
rent error, and the circuit in Figure 1d
presents a bipolar output—that is, it
sinks or sources current—depending on
the polarity of the input voltage. Its per-
formance depends on close matching
for the resistor pairs R 1 and R 2 and R 3
and R 4 and good tracking of the posi-
tive- and negative-power-supply volt-
ages. Any difference between the
absolute values of the supply voltages
appears as an offset current at 0V input
voltage. To achieve insensitivity to
power-supply-voltage variations, the
current-source circuit in Figure 1e
requires close matching of resistor pairs
R 2 and R 3 and R 4 and R 5 .
You can use the following equations
to calculate output currents for the cir-
INPUT
VOLTAGE
100
100
100
(a)
(b)
(c)
R 1
100
V+
V+
R 3
49.9k
R 2
49.9k
INPUT
VOLTAGE
R 1
100
_
_
INPUT
VOLTAGE
V+
R 4
49.9k
V+
MAX4162
MAX4162
V
V
+
OUTPUT CURRENT
(BIPOLAR DEPENDS
ON INPUT-VOLTAGE
SIGNAL)
+
R 4
49.9k
R 3
49.9k
R 5
49.9k
OUTPUT
CURRENT
(SOURCE)
R 2
100
V
(d)
(e)
Figure 1 This compendium of constant-current circuits includes current sinks
(a, b, and c), a bipolar sink or source (d), and a current source (e).
MARCH 2, 2006 | EDN 75
659318728.089.png 659318728.100.png 659318728.111.png 659318728.122.png 659318728.001.png 659318728.012.png 659318728.023.png 659318728.034.png 659318728.044.png 659318728.045.png 659318728.046.png 659318728.047.png 659318728.048.png 659318728.049.png 659318728.050.png 659318728.051.png 659318728.052.png 659318728.053.png 659318728.054.png 659318728.055.png 659318728.056.png 659318728.057.png 659318728.058.png 659318728.059.png 659318728.060.png 659318728.061.png 659318728.062.png 659318728.063.png 659318728.064.png 659318728.065.png 659318728.066.png 659318728.067.png 659318728.068.png
 
design ideas
in these examples. In Figure 1a ,
I OUT
es—that is, R 3
. It also assumes that R 4
R 4 , R 1
R 2 , and V
is much
ance). The graphs show a high nomi-
nal output current of 5 mA to better
display the higher end of the current-
amplitude range. Depending on your
application, you can optimize each cir-
cuit’s dynamic impedance and current
range through a judicious choice of op
amps and resistor values. EDN
V IN /R LOAD
25
A; in Figure
greater than R 1 .
For a fixed value of output current in
each of the five circuits in Figure 1 , the
graphs of Figure 2 show the circuits’
dynamic impedance and range of use-
ful output voltage (current compli-
1b ,I OUT
V IN /R LOAD
25
A; in Fig-
ure 1c , I OUT
V IN /R LOAD ; in Figure
1d , I OUT
2
V IN /R LOAD ; and, in Fig-
V IN /R LOAD. The equation
for circuit 1d assumes perfect match-
5.002
5.002
5.001
5.001
V IN = 500 mV, AND
R DYNAMIC = 10 M
OUTPUT
CURRENT
(mA)
.
OUTPUT
CURRENT
(mA)
V IN = 500 mV, V+ = 10V, AND
R DYNAMIC = 80 M
.
5
5
4.999
4.999
4.998
4.998
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
OUTPUT VOLTAGE (V)
(a)
(b)
OUTPUT VOLTAGE (V)
5.002
5.1
5.001
5.05
OUTPUT
CURRENT
(mA)
V IN = 500 mV
R DYNAMIC = 72 M.
OUTPUT
CURRENT
(mA)
V IN = 250 mV, V+ = 5V, AND
R DYNAMIC = 170 k.
5
5
4.999
4.95
4.998
1
2
3
4
5
6
7
8
9
10
4.9
5
4
3
2
1
0
1
2
3
4
5
OUTPUT VOLTAGE (V)
OUTPUT VOLTAGE (V)
(c)
(d)
5.1
5.05
V IN = 500 mV, V+ = 10V, AND
R DYNAMIC = 278 k.
OUTPUT
CURRENT
(mA)
5
Figure 2 These graphs show output current versus output-
voltage characteristics for the circuits in Figure 1. Note
that for b and c, the dynamic-output-impedance character-
istic closely resembles that of an ideal current source:
4.95
4.9
0
1
2
3
4
5
6
V OUT /
V IN
.
(e)
OUTPUT VOLTAGE (V)
Simple digital filter
cleans up noisy data
tor) lowpass filter between the sensor
and the analog-to-digital-conversion
stage. However, this approach is not
always ideal or practical. For example,
a long time constant of minutes would
require very large values for R and C.
Figure 1 shows an analog RC lowpass
filter and its design equations. As an
alternative, you can clean up noisy sig-
nals that remain within the ADC’s lin-
Richard Rice, Oconomowoc, WI
Many systems use an ADC to
sample analog data that tem-
perature and pressure sensors produce.
Sometimes, system noise or other fac-
tors cause the otherwise slowly fluctu-
ating data to “jump around.” To reduce
higher frequency noise, designers often
install an analog RC (resistor-capaci-
76 EDN | MARCH 2, 2006
cuits in Figure 1 . Note that R LOAD
100
V
ure 1e , I OUT
659318728.069.png
design ideas
ear range by using the digital equivalent
of an analog RC lowpass filter. The fil-
ter’s software comprises only two lines
of C code: LP OUT
ples/sec and a desired time constant of
30 sec, the constant K would equal
6000 samples. Applying a step change
to the routine’s input requires 6000
samples to reach approximately 63% of
its final value at the output.
The lowpass accumulator, LP ACC ,
can grow large for large time constants
and large input values. It can grow as
large as K times the largest possible
LP IN value. Under these conditions,
you need to make sure that LP ACC does
not overflow, and you may need to
specify a larger data type to contain
LP ACC . To avoid a long settling time
during start-up, before the start of the
sampling loop, you can initialize
LP ACC to a value of K times the current
input value.
You can extend the basic filter con-
cept presented to accommodate high-
er order filters with greater high-fre-
INPUT
R
OUTPUT
LP ACC /K, where the
output value of the filter is LP ACC divid-
ed by a constant, and LP ACC
LP ACC
C
LP OUT , where you add
the difference between input and out-
put to update LP ACC . You specify all
variables as integers.
Each time the analog-to-digital con-
version acquires a new input sample,
LP IN , the software produces an output
value, LP OUT , which comprises a low-
pass-filtered version of the input sam-
ples. Calculate the value of the con-
stant, K, based on the sampling rate of
the system and the desired time con-
stant for the filter as follows: K
LP IN
T),
WHERE T IS THE TIME CONSTANT
IN SECONDS, AND F IS THE
CUTOFF
C, AND F=1/(2
3-dB FREQUENCY.
Figure 1 In some circumstances,
a classic RC lowpass filter does
an adequate job of removing
noise from signals.
quency rejection by executing multiple
filter code segments in sequence. Also,
you can use an array of variables for
LP ACC and an array of values of the con-
stant K to filter signals that multiple
data channels acquire. EDN
1, and SPS is the
system’s sampling rate. For example, for
a system-sampling rate of 200 sam-
SPS, where K
Single switch selects
one of three signals
nents from the CD4000 CMOS-logic
series, along with a general-purpose
NPN transistor. The total cost of the
components doesn’t exceed $1. Only
one of circuit’s three outputs, CH 1 , CH 2 ,
or CH 3 , goes low at any given time, and
you can use these outputs to control ana-
log switches, relays, or the gates of JFET
switches. As long as you apply power, the
Felix Matro, JL Audio Corp, Phoenix, AZ
This Design Idea shows how you
can use a single-pole momentary-
contact switch to select one of three sig-
nal sources by scrolling through three
output states. The circuit in Figure 1
comprises commonly available compo-
V CC
15V
13
12
IC 2D
11
8
9
CD4011BCM
6
10
IC 2C
4
IC 2B
5
CD4011BCM
CD4011BCM
1
2
14
1
2
14
R 2
4.75k
1%
R 1
1M
1%
IC 2A
3
IC 4A
3
7
CD4011BCM
7
9
16
7
R 5
100k
1%
IC 1B
CD4093B
IC 1A
CD4093B
10
SET V DD
15
6
5
SET
1
R 3
47.5k
1%
J
IC 3A
CD4027B
Q
J
IC 3B
CD4027B
Q
14
5
4
11
C
1
2
K
K
6
V CC
3 13
14
3
2
6
B
CLK
Q
CLK
Q
4
IC 4B
CH 1
5
GND
RESET V SS
RESET
C 1
0.1
F
Q 1
2N3904
R 4
47.5k
1%
C 2
0.1
7
12
8
4
CD4011BCM
8
9
F
10
IC 4C
CH 2
CD4011BCM
S 1
IC 4D
CD4011BCM
11
CH 3
NOTE : S 1 IS AN SPST NORMALLY OPEN PUSHBUTTON SWITCH.
Figure 1 A handful of active and passive components form a one-of-three selector switch. Press switch S 1 once to
advance to the next channel and twice more to revert to Channel 1.
78 EDN | MARCH 2, 2006
T=R
T
E
13
12
659318728.070.png 659318728.071.png 659318728.072.png 659318728.073.png 659318728.074.png 659318728.075.png 659318728.076.png 659318728.077.png 659318728.078.png 659318728.079.png 659318728.080.png 659318728.081.png 659318728.082.png 659318728.083.png 659318728.084.png 659318728.085.png 659318728.086.png 659318728.087.png 659318728.088.png 659318728.090.png 659318728.091.png 659318728.092.png 659318728.093.png 659318728.094.png 659318728.095.png 659318728.096.png 659318728.097.png 659318728.098.png 659318728.099.png 659318728.101.png 659318728.102.png 659318728.103.png 659318728.104.png 659318728.105.png 659318728.106.png 659318728.107.png 659318728.108.png 659318728.109.png 659318728.110.png 659318728.112.png 659318728.113.png 659318728.114.png 659318728.115.png 659318728.116.png 659318728.117.png 659318728.118.png 659318728.119.png 659318728.120.png 659318728.121.png 659318728.123.png 659318728.124.png 659318728.125.png 659318728.126.png 659318728.127.png 659318728.128.png 659318728.129.png 659318728.130.png 659318728.131.png
design ideas
selected output does not change, mak-
ing the circuit a good choice for appli-
cations requiring nonvolatile operation.
Quiescent-current consumption aver-
ages only about 15
A at room temper-
R 5 ,C 2 ,IC 1A , AND
NORMALLY OPEN
MOMENTARY-CONTACT
SWITCH S 1 CONSTITUTE
A DEBOUNCED SWITCH
THAT PROVIDES CLOCK
PULSES FOR BOTH SEC-
TIONS OF THE COUNTER.
count to the 01 state. Components R 5 ,
C 2 , IC 1A , and normally open momen-
tary-contact switch S 1 constitute a
debounced switch that provides clock
pulses for both sections of the counter,
IC 3 . When a user pushes S 1 , the count-
er advances to the 10 state, and a sub-
sequent push advances the counter to
the 11 state. A third push restarts the
cycle. To summarize, IC 4B decodes the
counter’s 01 state and pulls CH 1 low,
IC 4C decodes the counter’s 10 state and
pulls CH 2 low, and IC 4D decodes the
counter’s 11 state and pulls CH 3 low.
The layout of the circuit should be non-
critical, but use a low-leakage capacitor
for C 1 . Connect unused logic inputs to
ground or V CC as appropriate. EDN
C, a low value even for battery-
powered applications.
The heart of the circuit comprises a
dual JK flip-flop, IC 3 , that’s configured
as a 2-bit ripple counter. Without addi-
tional circuitry, the counter would allow
selection of four signal sources. Upon
initial application of power, a reset cir-
cuit comprising R 1 , C 1 , and IC 1B always
sets the CH 1 ou tput to a logic-low level.
When the Q outputs of IC 3 , pins 2 and
14, both go to logic zeros, the feedback
chain comprising IC 2A , IC 2B , IC 2C , and
IC 4A pulls Q 1 ’s base to a logic-high level,
which in turn pulls one input of IC 1B to
a logic low. This action causes the count-
er to skip the 00 state and advances the
Low-cost audio filter
suppresses noise and hum
sonable performance, but observe
input polarity for signals with a dc com-
ponent. For a modest increase in cost
and assembly time, you can enhance fil-
ter performance and reproducibility by
selecting the values of these capacitors
to meet a 10% or better tolerance. For
best results, use nonpolarized film-
dielectric capacitors for C 1 through C 6 .
For noncritical applications, you can
relax the tolerances for the remaining
capacitors and use off-the-shelf induc-
tors for 22-mH L 1 , 0.68-mH L 2 , and 3.9-
Richard M Kurzrok, RMK Consultants, Queens Village, NY
The low-cost composite passive
filter in this Design Idea requires
no dc power and can enhance the per-
formance of audio equipment and
instrumentation by rejecting power-
supply hum and spurious pickup from
AM, FM, and low-band VHF trans-
missions ( Figure 1 ). The composite fil-
ter comprises a cascade of three simple
filters: a T-section highpass filter to
reject power-source hum and two
the prototype, wire all components to
a section of perforated breadboard stock
supported by metal spacers that mount
inside a die-cast aluminum enclosure.
This method of shielded construction
has proved its worth in other laborato-
ry-accessory applications ( Reference
1 ). Table 2 lists the filter’s measured
insertion loss over a range of 40 Hz to
200 MHz.
Low-cost polarized electrolytic ca-
pacitors C 1
H L 3 .
Redesigning the filter to match the
600
-
section lowpass filters to reject spurious
RF signals. As a starting point, the
three filter sections present a lossless
0.01-dB Chebyshev response at a 50
impedance that you find in clas-
sic audio circuits would increase the
through C 6
provide rea-
impedance level, but you can scale the
components’ values to meet other
impedance requirements.
Table 1 lists the components the pro-
totype filter uses. With the exception
of inductor L 3 , all the components are
standard values that are available off
the shelf. Switch S 1 provides a bypass
mode that permits rapid frequency-
response measurements without con-
nection and disconnection of the pro-
totype’s BNC connectors. To construct
TAB LE 1 COMPONENTS IN THE PROTOTYPE FILTER
Reference
designators
Values
Description
C 1 , C 2 , C 4 , C 5
10
F
50V electrolytic capacitor,
20% tolerance
C 3 , C 6
4.7
F
50V electrolytic capacitor,
20% tolerance
C 7 , C 9
0.15
F
Polypropylene capacitor,
2% tolerance
C 8 , C 10
0.033
F
Polypropylene capacitor,
2% tolerance
C 11 , C 12
0.001
F
Polypropylene capacitor,
2% tolerance
L 1
22 mH
Inductor,
5% tolerance
L 2
0.68 mH
Inductor,
10% tolerance
L 3
3.85
H
Inductor, 27 turns of AWG #28 magnet wire hand-wound
on T37-2 mixture (Carbonyl E) toroidal core
S 1
NA
DPDT panel-mounted toggle switch
J 1 , J 2
NA
50
BNC panel jack
NA
NA
Hammond 1590H-BK die-cast aluminum enclosure
80 EDN | MARCH 2, 2006
ature, 25
659318728.132.png 659318728.002.png
design ideas
INPUT
IMPEDANCE
OUTPUT
IMPEDANCE
50
S 1
J 1
C 1
10 F
C 3
4.7 F
C 4
10 F
C 6
4.7 F
L 2
0.68 mH
L 3
3.85
J 2
H
C 2
10
F
L 1
22 mH
C 5
10
F
C 7
0.15
C 8
0.033
C 9
0.15
C 10
0.033
C 11
0.001
C 12
0.001
F
F
F
F
F
F
HIGHPASS FILTER
20-kHz LOWPASS FILTER
4-MHz LOWPASS FILTER
NOTES :
BOTH GROUNDS CONNECT TO CHASSIS.
WHEN S 1 IS IN THE UP POSITION, IT BYPASSES THE FILTER; WHEN IT IS IN THE DOWN POSITION, IT INSERTS THE FILTER.
Figure 1 A highpass filter and two lowpass filters help reduce or eliminate low-frequency hum and high-frequency noise
from audio signals.
inductors’ values by an order of mag-
nitude, which would increase the
inductors’ dimensions and costs. An
alternative design approach could use
cascaded active-RC filters, which
would pave the way for their inclusion
into completely integrated composite-
audio filters. EDN
TAB LE 2 FILTER INSERTION LOSS
Frequency
Insertion loss
Frequency
Insertion loss
(kHz)
(dB)
(MHz)
(dB)
0.04
45.2
0.1
42.3
0.07
35.4
0.3
60
0.1
29.4
0.5
60
0.2
17.3
1
55.5
0.3
10.9
2
52.2
0.5
5.5
3
51.1
1
2.7
4
56.2
REFERENCE
Kurzrok, Richard M, “Simple Lab-
Built Test Accessories for RF, IF,
Baseband, and Audio,” High Frequen-
cy Electronics , May 2003, pg 60.
2
2
5
60
1
5
1.9
10
46.5
10
2.1
25
44
15
2.7
50
40.5
20
4.5
100
39.5
30
11.7
150
45
50
24.5
200
44
Microprocessor’s single-interrupt input
processes multiple external interrupts
Abel Raynus, Armatron International Inc, Malden, MA
Nitron family of flash-memory micro-
controllers, such as the MC68HC-
908QT and QY, offer only one IRQ
input pin. You can use one-time-pro-
grammable versions of the family,
such as the MC68HC705KJ1 or MC-
68HC705J1A, that offer five exter-
nal-interrupt inputs but omit some of
the family’s valuable functions, such
as flash memory, built-in analog-to-
digital conversion, and an advanced
instruction set. You could also select
a larger microcontroller, such as the
MC68HC908JL3, from the same
product family to gain eight external-
interrupt inputs at the expense of sig-
On the lower end of the per-
formance spectrum, many
widely available and inexpensive
microcontrollers pay for their small
pc-board footprints by omitting func-
tions. For example, most low-end
processors provide only one external-
interrupt input pin and only one
address vector in memory for the serv-
ice routine that processes external
IRQs (interrupt requests). However, a
project occasionally requires that sev-
eral interrupt-service programs must
process multiple external interrupts
from various sources. Cost and inven-
tory constraints may make it undesir-
able to choose another microcon-
troller whose only advantage is the
availability of a few more interrupt
pins.
For example, Freescale Semicon-
ductor’s (www.freescale.com) popular
82 EDN | MARCH 2, 2006
50
659318728.003.png 659318728.004.png 659318728.005.png 659318728.006.png 659318728.007.png 659318728.008.png 659318728.009.png 659318728.010.png 659318728.011.png 659318728.013.png 659318728.014.png 659318728.015.png 659318728.016.png 659318728.017.png 659318728.018.png 659318728.019.png 659318728.020.png 659318728.021.png 659318728.022.png 659318728.024.png 659318728.025.png 659318728.026.png 659318728.027.png 659318728.028.png 659318728.029.png 659318728.030.png 659318728.031.png 659318728.032.png 659318728.033.png 659318728.035.png 659318728.036.png 659318728.037.png 659318728.038.png 659318728.039.png 659318728.040.png 659318728.041.png 659318728.042.png 659318728.043.png
Zgłoś jeśli naruszono regulamin