Data Acquisition in the Chemistry Laboratory Using LabVIEW Software

Several techniques developed at Calvin College for computer data acquisition using the LabVIEW® 3.0 soft- ware package find use across our curriculum ...
6 downloads 0 Views 108KB Size
Information • Textbooks • Media • Resources

edited by

computer bulletin board

Russell H. Batt Kenyon College Gambier, OH 43022

Data Acquisition in the Chemistry Laboratory Using LabVIEW Software Mark A. Muyskens,* Samuel V. Glass, Thomas W. Wietsma, and Terry M. Gray Department of Chemistry and Biochemistry, Calvin College, Grand Rapids, MI 49546

Several techniques developed at Calvin College for computer data acquisition using the LabVIEW® 3.0 software package find use across our curriculum from general chemistry laboratory to physical chemistry, instrumental analysis, and undergraduate research. LabVIEW (National Instruments) is a complete programming language based entirely on a graphical user interface. A program (called a virtual instrument or VI) is created using graphical constructs equivalent to for-loops, do-whileloops, case structures, and subroutines (called sub-VIs). The flow of data through the VI is controlled by connecting “wires” between objects in a diagram somewhat like a flow chart. The user interface or “front panel” is created from a flexible set of predefined graphical displays and control features. Based on our experience with character-based programming languages such as FORTRAN, the feature of LabVIEW that most impresses us is the ease and flexibility of creating graphical displays for input and output. All of the data acquisition examples described here have some hardware and software features in common. In general, the process contains the following features: a sensor produces an analog voltage that is converted to digital, a LabVIEW sub-VI reads the voltage as a function of time, the main VI processes the data (for example, it may calculate temperature or absorbance from the readings), displays the data in real time as it is gathered, stores it to disk, and provides access to the data upon completion of the acquisition. The essential difference from one technique to the next is the sensor and processing of the data. For digital conversion we use a 4-1/2 digit multimeter (Keithley 175A/1753A) equipped with a GPIB interface and a GPIB interface card (National Instruments NB-GPIB) in a Macintosh computer (IIci or Centris 650). One laboratory contains ten stations usually serving two students per station. The sub-VI common to all of the examples acquires a voltage reading and records the time when it was acquired. Figure 1 shows the diagram for this sub-VI called DVM/Time. All of the icons in this diagram are standard LabVIEW functions. A sequence structure controls the order of events. First, in frame 0, a trigger is sent to the digital voltmeter (DVM). In frame 1, the time is recorded in milliseconds. In frame 2, the voltage is acquired from the DVM, and finally in frame 3, the string value of the voltage is converted to numeric form. The VI subtracts the start time to give elapsed time since start, and divides by 1000 to convert to seconds. A do-while loop that contains the DVM/Time sub-VI and a LabVIEW function to govern the loop execution rate (usually one per second) will accumulate voltage as a function of time into *Corresponding author.

1112

an array. With this hardware and sub-VI in common, we now describe several data acquisition/computer interfacing applications and how they are implemented in our curriculum. Gas Chromatography We introduce our general chemistry honors students to the concepts of gas chromatography by having them construct a simple apparatus adapted from an article in this Journal (1) to separate selected alkanes, usually pentane and hexane, where natural gas is used as the carrier gas and powdered detergent as the stationary phase. As the analyte hydrocarbons emerge from the column, they increase the brightness of the flame produced by igniting the effluent of the column. To record light intensity, we send the output of a solar cell (Edmund Scientific, Stock Number N37,336) directly to the DVM, a more straightforward approach than the photodiode circuit described in ref 1. The progress of the developing chromatogram is monitored on the VI front panel with a stripchart display as well as several digital displays showing time and voltage. The user terminates the data acquisition once sufficient data have been collected.

Figure 1. Diagram for the sub-VI that acquires a voltage reading and records the time when it was acquired. The two inputs to this VI are a GPIB address for the digital voltmeter (DVM) and the start time. The “film” frames represent a sequence structure. Frame 0 is shown in the context of the “wired” diagram and the other frames in the sequence are shown below. See text for a description of the individual frames. The output from the VI is a pair of numbers corresponding to voltage and elapsed time.

Journal of Chemical Education • Vol. 73 No. 12 December 1996

Information • Textbooks • Media • Resources

Scrolling the computer window reveals an x–y plot of the data complete with cursors that can be placed on the curve to extract characteristic points such as the retention time and peak width (see Fig. 2a). With the exception of the detector, we use the GC technique essentially as it is described in ref 1, while allowing a fair amount of latitude for students to explore how various parameters affect the performance of the student-built GCs. Calorimetry Computer acquisition of calorimetry data requires a temperature sensor that produces a signal that can be converted to a voltage which is then digitized. We use

an integrated circuit temperature sensor (National Semiconductor, LM35CA), which produces a voltage that is linear with temperature (10.0 mV/°C). The details of the sensor are given in a separate paper (2). Using a VI that is essentially the same as the GC VI, except now the sensor voltage reading is multiplied by 100 to give units of °C, we collect temperature data as a function of time. A stripchart on the screen monitors the progress of collecting the calorimetry curve, and when the student terminates the acquisition, an x–y plot is displayed elsewhere in the front panel with cursors for determining characteristic points, such as maximum and minimum temperature (see Fig. 2b). We use this VI for heat of neutralization acid–base calorimetry in first-year chemistry and for heat capacity and bomb calorimetry measurements in physical chemistry. Titrations and Other Volume-Dependent Experiments

(a)

Several applications such as pH titrations and conductivity experiments rely on a manually controlled peristaltic pump to deliver solution at a constant rate. We send the voltage output from a pH meter or a conductivity meter to the DVM and use the system as described above for the GC experiment including the GC VI. Students perform volume and pH conversions on the data, in this case outside of LabVIEW using a spreadsheet program, where time is related to the titrant volume by the pump flow rate, and voltage is related to the pH by a linear calibration determined by recording pH and voltage several times during a titration. Figure 2c shows a weak acid titration curve obtained using this system. Using conductivity measurements as a function of added electrolyte volume, students determine Ka (or K sp) for strong and weak electrolytes. We also do a novel conductivity titration of the reaction between barium hydroxide and sulfuric acid, which has negligible conductivity at the endpoint.

(b)

Spectrometry for Real-Time Kinetics

(c)

Figure 2. Examples of experimental data obtained using LabVIEW. (a) Separation of pentane (first peak) and hexane (second peak) using the student-built GC described in the text. (b) A calorimetry curve for the neutralization reaction of sodium hydroxide and hydrochloric acid. (c) A weak acid titration curve for mandelic acid. The pump flow rate is approximately 1 mL/min. Data acquisition rate is 1 Hz for panel a and b, and 0.5 Hz for panel c.

A somewhat more sophisticated application is a LabVIEW VI that reads voltages directly from the phototube of a Spectronic 20® (Milton Roy). We send the output voltage (0–1 V) directly to the DVM from the connector plug at the bottom of the instrument. This strategy is much simpler than others reported earlier (3, 4) because it requires no modifications to the instrument. In order to convert a phototube reading to absorbance or percent transmission, the VI needs voltages corresponding to zero and 100% transmission from the blank. Around the basic data-acquisition structure from VIs described above we added a sequence structure to guide the student to acquire these values. The VI, front panel shown in Figure 3, displays an analog meter that mimics the actual instrument but also shows digital results and stores these to disk. In general chemistry, we use this system to record the catalyzed decomposition of methyl orange by monitoring absorbance at 575 nm using a procedure adapted from Marcus, Sienko, and Plane (5). This system offers an excellent example of how the raw signal from a sensor often requires post-acquisition processing by the instrument to obtain useful information like absorbance. To highlight this process in our instrumental analysis course, we have the students start with the Spectronic 20 VI modified by stripping away all of the data processing and display except for obtaining the raw voltage reading. After students spend a lab

Vol. 73 No. 12 December 1996 • Journal of Chemical Education

1113

Information • Textbooks • Media • Resources

Spectroscopy

(a)

(b)

Figure 3. Front panel of the Spectronic 20 VI, which actually takes up two full computer screens. (a) Portion of panel used when collecting data; counter-clockwise from top left are user controls, a stripchart display of the current data acquisition, an x–y graph display of the previous data set, and digital displays as well as an analog display mimicking the Spec 20. (b) Portion of panel displaying analysis of a data set, including a linear-least-squares fit to the logarithm of absorbance (the “white line” fit does not show in these graphics). The panel portions are selected by sliding the scroll-bar at screen bottom.

period of introduction to programming with LabVIEW, primarily by working in the LabVIEW Tutorial Manual, they build on this VI by wiring LabVIEW icons to calculate absorbance and percent transmission, adding a variety of displays and demonstrating that their VI functions properly.

1114

The most complex VI involves both data acquisition and control of a monochromator (Acton Research SpectroPro 275) for emission spectroscopy. The output from the photomultiplier tube (1P28) is sent directly to the DVM.1 The VI controls the monochromator by sending commands via the computer’s serial port using standard LabVIEW functions. In this case, the control communication is completely independent of the GPIB interface board. The VI relies on the accuracy of the scan rate and data acquisition rate and calculates the wavelength based on elapsed time. We use this VI to record the atomic hydrogen emission spectrum in physical chemistry and to investigate the characteristics of monochromators in the instrumental analysis course. The emphasis in all of these techniques is to use the simplest, most straightforward approach possible in terms of the chosen sensor and the interface to the DVM/ GPIB system. One hope that has been realized in the implementation of this approach is that students who had experience using these data acquisition techniques would be inspired to incorporate them into some of the more open-ended labs of other courses or in undergraduate research projects. This certainly has occurred in honors general chemistry lab, biochemistry lab, project-style labs in physical chemistry, and several research projects involving fluorescence studies ranging from protein folding to dye fluorescence. While the focus of this article has been on data-acquisition techniques that find wide use in our curriculum, we use LabVIEW in several other applications, for example, investigation of Fourier transforms using the digital signal processing functions of LabVIEW and data acquisition with feedback control for a simple HeNe laser beam tracker. Acknowledgments Support for the computer data-acquisition systems came from NSF-ILI 9251350 and the Calvin CollegeHoward Hughes Medical Institute grant. Note 1. The DVM input impedance of 10 MΩ is the load resistance for the PMT.

Literature Cited 1. 2. 3. 4. 5.

Fox, J. N.; Shaner, R. A. J. Chem. Educ. 1990, 67, 695. Muyskens, M. A. J. Chem. Educ. in press. Vitz, E. J. Chem. Educ. 1994, 71, 879. Nagel, E. H. J. Chem. Educ. 1990, 67, A75. Marcus, S.; Sienko, M. J.; Plane, R. A. Experimental General Chemistry; McGraw–Hill: New York, 1988.

Journal of Chemical Education • Vol. 73 No. 12 December 1996