A Microcomputer-Based Data Acquisition System for Use in Undergraduate Laboratories Ray L. Johnson Hillsdale College, Hillsdale, MI 49242 One of the major developments in the physical sciences during the last decade has been the interfacing of digital computers with instruments. Automation allows more rapid data acquisition, better control of experimental variables, increased computational and data handling capabilities, and rapid retrieval of stored data. Several descriptions of the chemical applications of laboratory computers have appeared in THIS JOURNAL(1-10). These publications provide ample illustration of the desirability of introducing computers into the undergraduate chemistrv laboratorv. ~ a b o r a r o computer r~ sys&ms descrided in THIS JOURNAL or elsewhere mav usuallv be clnssified as minicomouter-based systems that are relatively sophisticated and expensive, or microprocessor-based systems that are considerably less expensive but lack the sophisticated data handling and display characteristics of a minicomouter. An ideal svstem for introducing undergraduates tt, computer-based data arquisition is a svstem that is readilv interfaced to existine laborarorv instriments and which may he programmed & a familiar language. I t should allow software control of the desired data reduction and display techniques and provide for data storage. In addition it should he portable, relatively inexpensive, reliable and able to withstand the rigors of use in a chemistry laboratory. This combination of features bas been reasonably approximated by the recent introduction of personal computers. These computers, originally designed for the home computer market, are receiving widespread use in business and educational institutions. Several small companies are also producing peripherals that allow the adaptation of these computers to a variety of applications. A laboratory computer system based upon the Commodore P E T 2001' is described below. Three applications of this system to the undergraduate analytical chemistry laboratory are also given.
a
Computer System The Commodore PET 2001 is a BASIC language computer that has 8K RAM, 14K ROM and a 6502 microprocessor. For purposes of interfacing, the P E T may be accessed from its IEEE-488 oort. a oarallel user oort. and a second cassette oort ( 1 1 ) . It has.a 9-k'memory-mapped CRT display that consists of 25 rows with 40 rhararrersearh. A charactrr cmsistsof an 8 X 8 dot matrix. A further description of this and other personal computers is given elsewhere (12, 13). Ordinary resolution for graphical d~splayof dam on a rermngular rooidinate system is 25 X 40, but resolution may be increased to 50 X 80 through the use of 1'Kl' graphics and program modification ( 1 4 ) . Since hoth of these degrees of resolution were found to be too coarse for the display o f experimental data as a smooth curve, the resolution was increased to 200 X 320 by the purchase of a K-1008P Visible Memory S ~ s t e m . ~ T hunit i s provides an additional 8K RAM which increases the memory of an 8K P E T to 15,359 bytes when i t is not being used in high resolution graphics mode. However, when high resolution graphics mode is being used the software required to support the system consumes a substantial portion of the memory, leaving only about 4,500 bytes availahlc for user programs." Interfacing was accomplished through the use of a I'K'I'SK'I' la.4 This cons& of an AIM-36 system, power supply, 784
Journal of Chemical Education
extension boards for the IEEE and parallel ports. a module for monitoring up to 16 voltage inputs and appropriate cables. The AIM-16 consists of an &bit, 100-ws conversion time, successive approximation analog-to-digital converter (ADC); a 16-channel analog multiplexer and appropriate timinxand control circuits. The ability m switch devices on or ot'f under computer control was accomplished through the use of a Crydom Dl210 photoisolated solid state relay.5 The relay was controlled by connecting it to the +5 V (pin B-2) of the P E T second cassette port and the CB2 (pin M) of the parallel user port (11). The CB2 may he switched between ground and +5 V under software control causine the relav t o switch on and off devices that are connected to-it. The hardware just described allows one to measure an analog voltage in the 0-5.12 V range and convert it to digital form (0-255 decimal) in response to a computer command, or as a function of time. The signal from instruments may usually be taken from internal or external chart recorder terminals and amplified to take advantage of the full range of the analogto-digital converter. The way data is treated, stored in memory, displayed in tabular or graphical form, transferred to cassette tape or disk, or sent to a printer then becomes primarily a software problem. BASIC programs have been written to control the acquisition and treatment of absorbance and pH data for the experiments described below. Recording a UV-vlslble Absorption Spectrum The instrument used for spectral measure'ments was a Beckman DBG spectrophotometer. The signal from the recorder terminals on the back of the spectrophotometer was amplified 50-fold before it entered the ADC. The digitized voltages were converted mathematically to absorbance readines and stored as suhscrinted variables. Fieure 1shows an exakple spectrum taken at'a scan rate of 50 nmlmin with absorhances recorded a t 3 nm intervals. Since the voltaees may be sampled much more rapidly than the rate a t which ;he spectrum is scanned, a 20-point real-time boxcar average was taken for each data point. This allows an improved signal to noise ratio. Fieure 2 shows a oaee of absorbance data disnlaved . . in tabular f o r k Several pages-may be required to display all data ooints. Fieure 3 shows the ootions that were written into the control pro&am. Other contrb~programs discussed herein have similar options. Fieures 4 and 5 show examoles of a typiral absorpt 'on spectr& dong with the a)mputerl'first and second derivarives. Ilerivative ralculations generally improve
' Commcdwe Business Machines, Inc. 3330 S&
CA 95050.
Blvd.. Santa Clara,
'Micro Technology Unlimited, P.O. Box 12106, Raleigh. NC 97605 .. ...
Because of this limitation the author recommends consideration of a 16K or 32K computer if one infends to purchase this particular Visible Memory system. 'Connecticut Microcomputer, Inc.. 150 Pocono Road. Brookfield. CT 06804. International Rectifier, 1521 Grand Avenue, El Segundo, CA 90245.
Figure 3. Options that may be selected in the control program for collectina absorbance data. Figure 1. Visible spectrum of Iris(l.10-phenanthroiine)iron(il).
tometer a "K" or "U" is entered to distinguish i t as a known or unknown solution. If it is a known, then the solution concentration is entered and the "return" key is pressed. If i t is an unknown, then it is not necessary to press "return." In either case a 200-point average reading of absorbance is taken for the solution. When all of the solutions have been read, the calibration curve based upon the known solutions is calculated and displayed, as shown in Figure 6. The slope and standard deviation are available upon request. The program also calculates the unknown concentrations and displays unknown absorhances, concentrations and error limits. Calibration curves may be saved on cassette tape for future reference. An interesting extension of this type of experiment is to carry out mnlticom~onentanalvses bv the standard techniaue involving the solution of sets of simultaneous equations (18).
Figure 2. One page of absorbance data for tris(l.10-phenanthroline)imn(ll).
the detectability of minor spectral features, such as shoulders, since they increase discrimination in favor of the sharp, as opposed to the broad, features of an absorption spectrum (15, 16). The enhancement of shoulders may be noted in the ultraviolet portion of the phenolphthalein spectrum. Random errors in the absorption curve are also magnified in the derivative curves and this effect increases with derivative order. The absorbance and derivative curves are also affected by the resolution (one part in 256) of the 8 bit ADC. The phenolphthalein spectrum was taken at a scan rate of 10 nmlmin usina a 100-~ointboxcar averaae. T i i s same type of data acqukition experiment may be extended LO the recording of infrared spectra with minor modifications to the control program. Data may then be scanned for maior and minor peaks to aid in comnound identification, or compared againstspectral data stored on disk. Recording and Use of Calibration Curves A useful auplication of comnuter-based data acquisition is any situation where several khown concentrations h e used t o prepare a calibration curve from which unknown concentrations mav be determined. A familiar examule is the use of Beer's Law in spectrophotometry. Linear absorbance versus concentration curves mav be DreDared r a ~ i d l vand unknowns determined with reasonable ak&acy by bapkical techniques, without the use of a computer. However, the computer-based application of numerical methods is preferable because i t allows manv re~licatesof both known and unknown solutions to be readily'processed and also allows rapid and accurate calculation of unknown concentrations and error estimates. If Beer's Law is obeyed, then a simple linear least-squares calculation may be carried out. If this law is not obeyed, then a non-linear curve fitting technique may be used. Figure 6 shows a plot of absorbance versus concentration from data taken in the determination of iron using 1,lO-phenanthroline (17). The control program for this experiment has been written so that when a solution is placed in the spectropho~
d
~
~
~
Figure 4. (A) Ultraviolet-visiblespectrum of phenolphthalein at pH = 9.(B) First derivative of spectral data
~
Figure 5. (A) Ultraviolet-visiblespectrumofphenolphthalein at pH = 9.[B) Second derivative of spectral data.
Volume 59
Number 9
September 1982
785
Figure 6.Beer's Law plot for the determination of iron(l1) using 1.10-phenarr
tholine. Recording Potentiometric Data The data necessary to plot titration curves may be readily acquired using a computer-based technique. The experiment illustrated is a pH titration hut the principles apply equally well to any potentiometric titration. A Sargent-Welch model C motor driven constant-flow buret was used t o deliver acid or base solutions a t a flow rate of 1 mllmin.6 The huret was turned on and off hv a solid state relav throueh the use of a POKE command. Tbe analog signal frbm thechart recorder terminals of a Heathmodel EU-200-30 pH meter was amplified fourfold before entering the ADC. For each data point a 20-point boxcar average of the digitized voltages was converted mathematically to a pH value by the control program. Since it is desirable to obtain several data points near the equivalence point, hut relatively few a t the extremes of a titration curve, the time (volume) between DH readines is altered by the control program as the titration proceeds. A real-time computation of the first derivative of pH versus millili~ersis cdrried out, and the time interval is selected on the tmqis of the magnitude of the derivati\fe.The time intervals are converted to