Download EPE 2002-07 - Parent Directory

Transcript
vary VR2 until the output is 0V. The circuit
is then ready to be tested with gases.
Testing is straightforward as long as you
are careful. Ethanol (alcohol) is probably
the best to use as it is readily available!
Soak a piece of cotton wool in some alcohol (e.g. vodka) and place it close to the
sensor. The output of the circuit should
change as indicated in Fig.9.11. The output
for our test circuit reached about 3·5V. The
reaction time is about 10 seconds.
You can repeat the tests with other gases
such as butane. Note that this circuit is not
calibrated. Also note that the output will be
negative if you have the sensor and compensator the wrong way round!
Lab 9.2 A-D Converter Demonstration
Circuit
It is beyond the scope of these articles to
provide complete circuits for ADCs, partly
because there are so many available! Here,
we will show how to control a common
ADC at low speed so that the binary output
can be observed for different input
voltages.
The complete circuit is shown in Fig.9.12
and it uses a readily available National
Semiconductor ADC0804 8-bit ADC (IC2).
The ADC has three control inputs, chip select
(CS), write (WR) and read (RD), together
with two analogue inputs, Vin(+) and Vin(-).
The final input is for a reference voltage and
is denoted as Vref/2.
The binary output goes from 00000000
at Vin(-) to 11111111 at Vref. For example,
if Vin(-) is 0V and the voltage at Vref/2 is
2·0V then the 00000000 is equivalent to
0·0V and 11111111 equivalent to 4·0V.
In our demonstration circuit, the reference
voltage is set at half the supply by potential
divider R2 and R3; this makes 11111111
equal to 5V. Chip select (CS) is set low to
permanently enable the device and Read
(RD) set low to enable the outputs (D0 to
D7). Control of the ADC is via the Write
input (WR) which is active low and is
derived from a low frequency squarewave
oscillator (IC1) operating at about 200Hz.
The internal operation of the ADC is
controlled by an internal high speed oscillator operating at a frequency set by resistor R4 and capacitor C3. This means that
each conversion takes place over about
100ms but at 200 samples per second.
The input voltage to be converted to digital output is provided by VR1 and the binary output is displayed on l.e.d.s D1 to D8,
which are buffered by resistors R5 to R12.
(An l.e.d. array was used in the test model,
but individual l.e.d.s. can be used instead.)
Construct the circuit in Fig.9.12 and vary
potentiometer VR1. You should see the l.e.d.s
changing in a binary manner. The accompanying photograph shows a binary value of
01011111 which is equal to 95 in decimal
(least significant bit is at the top of the array).
Using the signal generator from Part 8,
you could input a low frequency sinewave
and watch the binary values changing. You
can also vary the value of Vref/2 and show
that the range can be changed.
A full datasheet for the ADC0804 can be
found at the National Semiconductor web
site (www.natsemi.com).
Lab 9.3 Illustration of Aliasing – Time
Domain
We can illustrate aliasing very easily
using the Picoscope and the sinewave
534
Ω
µ
Ω
Fig.9.12. A-to-D converter demonstration circuit.
Breadboard assembly for the circuit in Fig.9.12.
Fig.9.13. Picoscope display of a
sinewave at 1kHz.
Fig.9.14. Picoscope display at 4kHz,
beginning to show a small amount of
aliasing.
should see something like that in
Fig.9.15. It does not look much like a
pure 10kHz sinewave! It is the sampling
rate fixed inside the Picoscope software
that causes this.
generator from Part 8 (Fig.8.11). Connect
the generator to the Picoscope input and set
the frequency to about 1kHz. The
Picoscope display should be similar to that
in Fig.9.13, showing that the signal is
almost correctly displayed.
Now increase the
signal to 4kHz; again
the almost correct
waveform should be
displayed, but with a
small amount of
aliasing just beginning
to
appear
(Fig.9.14). Increase
the input frequency
further until it is Fig.9.15. Picoscope display at 10kHz, dramatically showing
about 10kHz – you how aliasing has disrupted the signal quality.
Everyday Practical Electronics, July 2002