AC Circuits

advertisement
PHYSC 3322
Experiment 1.6
13 February, 2016
Computer Interfacing & Data Acquisition
Purpose
This experiment will introduce you to the basic principles of computer interfacing and
data acquisition. In particular, you will learn the RS-232 serial interface and use it to
measure time-varying voltage and current in a RC circuit.
Equipment
HP 54603B oscilloscope, HP 34401A multimeter, DC power supply, and HP interface
software (BenchLink Suite and I/O libraries).
Background
In many experiments, one needs to either monitor a signal over a long period of time or
measure a quantity, such as voltage and current, which may vary with time very fast.
In these cases, one may use a computer to control the experiment and take data. Many
experimental instruments are now equipped with a digital output that can be
connected directly to a computer. The connection between an instrument and a
computer requires specific interfaces for “handshaking” and data transmission. These
interfaces are either serial or parallel in nature. In the serial interface, digital signals
(bits) are transmitted one after the other along a single electric wire. In the parallel
interface, however, N bits are transmitted simultaneously along N electric wires. RS232 (serial) and IEEE-488 (parallel) are two most commonly used interfaces in research
laboratories.
In this experiment, we focus on the use of the RS-232 serial interface. Signals sent
through RS-232 represent characters by a series of logic bits (1s and 0s). The RS-232
standard defines a voltage between +3 and +15 volts as logic 0 and voltage between –3
and –15 volts as logic 1. Because of the large voltage range, signals can be transmitted
through RS-232 over a long distance up to 100 feet. The logic bits are transmitted
through RS-232 at a particular frequency, which is known as the baud rate in units of
bits per second. In most cases, characters are represented by the ASCII code (American
Figure 1 Pinout of a standard RS-232 connector.
1
PHYSC 3322
Experiment 1.6
13 February, 2016
Standard Code for Information Interchange). This code represents each character by a
7-bit binary number. Whenever data are not being transmitted, the RS-232 line is in the
logic 1 state; this is the idle state. When data are transmitted, each 7-bit character is
proceeded by a start bit (logic 0) and followed by an optional parity bit and 1 or 2 stop
bits (logic 1). The parity may be either even or odd and is determined by the number of
logic 1 bits in the transmitted character. The parity bit serves to validate the data word.
The standard connector used in the RS-232 connections is the 25-pin subminiature D
connector. Figure 1 shows the pinout of the DB25 serial connector. While the
connector has 25 pins, only a small number of pins are actually used for serial
communication. In many applications, only 4 pins (2, 3, 7, and 20) are required.
Because data transmitted by one device on pin 2 should be received by another device
on pin 3, it is often necessary for RS-232 cables to cross the wires for pins 2 and 3.
Procedure
Select a capacitor (C=4.4 F) and a resistor (R=3k) to form a RC circuit as shown in Figure 2.
Determine the value of each component using the Elenco multimeter and calculate the time
constant of the circuit. Construct the 555 timer circuit shown in Figure 3 on your breadboard
with R1=1k, R2=1M, and C1=0.1 F. The 555 timer integrated circuit provides a signal, which
alternates between 0 and 5V at a frequency given by
f 
1
.
ln 2R1  2R2 C 1
(1)
Use the oscilloscope to display the waveform of the output voltage of the 555 timer and
the voltage across the capacitor. Sketch these waveforms on your notebook and
indicate the time scales. Verify that the measured frequency of the signal agrees with
that given by Eq. (1).
R
A
555
C
V
Figure 2. The RC circuit .
Figure 3. The 555 timer circuit.
Connect the HP 34401A multimeter to a computer with a RS-232 cable. The multimeter
has only one serial interface port but the computer may have several serial ports. Make
sure that the RS-232 cable is connected to the COM2 serial interface port of the
computer. Refer to the HP 34401A Multimeter User’s Guide, p. 162-165, to configure
the remote interface of the multimeter. Select even parity, 7 bits, 9600 baud rate, and
SCPI programming language. Start the interfacing program by clicking the BenchMeter
icon. Select File |New Project from the Menu Bar, type a project name and set Project
Type to be HP 34401A Multimeter. Select Project Window under Tool Bar. Select
2
PHYSC 3322
Experiment 1.6
13 February, 2016
Category: Function and set Function: DC Voltage, Range: Auto, Resolution Details:
Digits-4 Fast, Autozero On, and Instrument Display Off. Change Category to
Acquisition and set Trigger Source: Software, 00h00m0.01s; Completion Criteria:
Readings, 512; and Multiple Readings/Trigger: 512.
Now the computer is ready to take data. First use the multimeter to measure the
output voltage of the 555 timer. Click the Run icon and select the Strip Chart icon to
display your data. When the measurement is done, you may display the data in
various ways by selecting the View menu. Compare the waveform displayed on the
Strip Chart with that on the oscilloscope. If you are satisfied with your data, you can
save the data into a PRN file by selecting File | Export Data, enter a file name, and set
the file type as *.PRN. Repeat the above procedure to measure the voltage across the
capacitor and save the data in a different PRN file. To measure the current passing
through the RC circuit, you need to (1) connect the multimeter in series with the resistor
and the capacitor, (2) switch the input leads of the multimeter for the current
measurement, and (3) set Function: DC Current. Make sure that all the other settings
in Function and Acquisition remain the same as those for the voltage measurements.
If you cannot finish the three voltage and current measurements in one class period,
you may save all the project information in a PRJ file by selecting File | Save Project.
This file can be reopened next time when you start BenchMeter.
Questions
Plot the output voltage of the 555 timer, the voltage across the capacitor, and the
current passing through the RC circuit as a function of time. The time stamps in your
data files are not correct and you need to generate your own time axis. Assuming that
all the data points are taken at an equal time interval, you can obtain the time axis by
measuring the period of the output signal of the 555 timer using an oscilloscope.
Explain the shapes of the voltage and current waveforms.
Measure the rising time of the voltage across the capacitor using an oscilloscope and
compare it with the time constant of the RC circuit.
3
Download