FIGURE 1. BASIC CIRCUIT FOR DC AND LOW FREQUENCY
SIGNALS. NOTE THAT R2 CAN BE ELIMINATED IF THE
SUBSEQUENT CIRCUIT HAS A SIMILAR RESISTANCE
TO GROUND.
Test
Frequency
100,090 Hz
10,008 Hz
4,000 Hz
1,003 Hz
100 Hz
Original
Measurement
2.9036 volts
1.5964 volts
0.9098 volts
0.2903 volts
0.0301 volts
Percent
Difference
+0.01% (~ 13 bits)
+0.07% (~ 10 bits)
+0.07% (~ 10 bits)
0.0%
0.0%
(+/-1 digital error)
capacitor C1 has two effects. It blocks DC and creates
pulses at each edge of the digital input. The diode shorts
the negative pulses to ground, which leaves a short positive pulse of about 2 uS for each rising edge of the input.
These high-frequency pulses are filtered and averaged by the RC network of R1 and C2 to create a DC signal. Resistor R2 is used to load C2. It should be a high
value of about 1 to 10 MΩ, so that there is little reduction
of the output voltage. It is required, however, because
there is no way to remove a DC voltage on C2 once it’s
there. If you want a peak-hold circuit, eliminate R2. The
resistor R2 can also be eliminated if your subsequent circuit, which connects to the output, has a similar load to
ground. Note that Figure 1 is a starting point that seems
to work well for input frequencies of 1 KHz to 100 KHz.
You may want to experiment with different values for your
particular application.
How Well Does it Work?
TABLE 1. THE REPEATABILITY OF THE OUTPUT
VOLTAGE IS VERY GOOD.
DC and Low Frequency
Converter
In the DC and low frequency converter (see Figure
1), the first circuit converts a series of repetitive digital
pulses (typically a square wave) into a DC signal. By
changing the digital frequency, the DC signal can be
changed, which allows low frequency AC signals to be
created. For the circuit shown, the maximum useable
frequency is about 10 Hz, though you could probably
modify the circuit to get up to 60 Hz. This is basically a
frequency-to-voltage converter.
The operation of the circuit is straightforward. The
GRAPH 1. THE OUTPUT VOLTAGE HAS A NON-LINEAR
RESPONSE RELATIVE TO THE INPUT FREQUENCY. THIS
MAKES OUTPUTTING A SPECIFIC VOLTAGE TRICKY.
F
o
r
E
l
e
c
t
r
o
n
i
c
s
NUTS & VOLTS
E
v
e
r
y
t
h
i
n
g
62
I measured the DC output with a 1 MΩ oscilloscope
probe in place of R2, and was able to get out about 0.0
volts to + 3.0 volts. I say “about” 0.0 volts because that
value is asymptotic. You can never get there if there is any
digital signal coming in. I went down to 10 Hz and was
able to measure 0.0027 volts with my 5. 5 digit voltmeter.
At 100,000 Hz (my highest test frequency), I measured
2.9036 volts, though you might get more voltage with a
higher frequency. This is about 60% of the 5 volt operating voltage. Assuming that 0.0027 is the smallest step
possible, then there are 1,075 of these steps in 2.9036
volts. This corresponds to a D/A with 10 bits of resolution. I tried ceramic, mica, and polyester capacitors and I
didn’t see any significant difference.
I measured the noise with an oscilloscope. At 100 KHz,
the noise was about 4 mV peak-to-peak (P-P). The P-P noise
at 10 Hz was about 8 mV. (Please note that I discounted
60 Hz power-supply noise that was also present. Also,
because the noise is AC and must eventually sum to
zero, the DC voltage measured with the meter can be
less than the AC noise. The DC meter reads a value over
time, so the AC noise tends to zero itself out.) With 4 mV
of noise and a 2.9036-volt signal, the signal-to-noise ratio
(S/N) is 726. This is a conservative measurement because
proper noise measurement should be RMS (
Root-Mean-Square) not P-P. Converting P-P noise to RMS is complex
and is beyond the scope of this article. But an RMS value is
always less than a P-P value. So, let’s estimate the S/N ratio
as 1,000. This corresponds to 60 dB or about 10 bits.
A crucial requirement of any conversion circuit is its
repeatability. As shown in Table 1, the repeatability is very
good. It should be noted that these tests used an inexpensive RC (Resistor/Capacitor) oscillator, rather than a uC
with a crystal oscillator. So, some of the repeatability
SEPTEMBER 2005