Palm-Based Data Acquisition Solutions for the Undergraduate

Chemical data acquisition is moving in the direction of wireless, paperless technology. A major stumbling block to the widespread implementation of th...
2 downloads 9 Views 106KB Size
In the Laboratory edited by

Topics in Chemical Instrumentation

David Treichel Nebraska Wesleyan University Lincoln, NE 68504

Palm-Based Data Acquisition Solutions for the Undergraduate Chemistry Laboratory Susan Hudgins, Yu Qin, Eric Bakker, and Curtis Shannon* Department of Chemistry, Auburn University, Auburn, AL 36849-5312; *[email protected]

Chemical data acquisition is moving in the direction of wireless, paperless technology. A major stumbling block to the widespread implementation of this approach in undergraduate chemical laboratories, however, is the fact that each student is ideally required to have a computer/data logging device. In the past, one elegant solution has been the use of network-based approaches such as MeasureNet (1). A more common approach is the use of small hand-held devices such as programmable calculators for data collection. For example, Texas Instruments’ Calculator-Based Laboratory (CBL) has introduced experiments compatible with Texas Instruments graphing calculators to the laboratory (2), and some peripheral instruments have even been developed for use with these calculators (3). Although programmable calculators provide a less costly alternative to personal computers, their use outside the laboratory is relatively limited, especially for students in non-technical disciplines. We propose that an effective solution to this problem, with respect both to cost and practicality, is the use of handheld personal computers (HPCs) such as the Palm and Visor devices. It should be noted that several commercial units combining electrochemical measuring capability using an HPC have recently become available,1 but are relatively expensive. HPCs are significantly more compact and economical than laptop computers and their wide range of uses outside the laboratory make them practical for students regardless of curriculum or major. In addition, the current generation of desktop synchronization software is highly evolved, making HPCs much easier to synchronize with a desktop computer for data analysis than programmable calculators. There are several commercially available data acquisition systems for interfacing a HPC to laboratory instruments. We identified one such system, the Meld Data Acquisition System, compatible with Palm III and Palm V handhelds,2 OS version 3 or later to suit our needs. This system is a small (50  70  17 mm), inexpensive ($68) product that is capable of measuring up to four channels of voltage data simultaneously. The interface module includes a 12-bit analog-to-digital converter board with four voltage input channels, a LM34 temperature sensor, and a battery holder for the two AAA batteries necessary to operate the hardware. The interface is easily connected to the Palm device through either the HotSync cradle that comes with every new unit, or an inexpensive cable that can be purchased at any electronics store. This system offers possibilities for voltage data collection that include, but are not limited to, temperature readings, digital chart recorder applications from most instruments, and potentiometric pH and ion analysis including basic titration experiments. Unfortunately, the generic

nature of the Meld system makes it inflexible for scientific data collection purposes, as it will simply acquire a continuous stream of data onto the handheld computer. Many of the relevant applications require modifications to the data acquisition code in order to include an interactive user interface, the possibility of discrete data acquisition and of simple data manipulation, such as data averaging. This paper describes how handheld personal computers can be easily adapted to and conveniently used for typical data acquisition applications in the undergraduate chemical laboratory. The approach is presented here for potentiometric pH and K analysis as an example, and includes the application to pH titration experiments. It is anticipated that the example described herein will encourage the widespread flexible use of such handheld devices in the chemical laboratory. Materials and Methods

Hardware The Meld Data Acquisition System module is designed with a fixed voltage input range from 0 to 2.048 V, giving a resolution of 0.5 mV at 12 bits. Since most of the experiments we perform involve bipolar data, a modification to the original interface was required. We modified the Meld input as shown in Figure 1. A 10 k resistor is placed in series with a silicon diode (the 1N4001) between the sensor power (ca. 2.5 V) and common terminals. In this circuit, the diode is forward biased with a forward voltage drop of about 0.7 V. This creates a convenient voltage reference (Channel 3) to which the signal at Channels 0–2 can be referenced, and

Sens Pwr Freq

10 kΩ

Com Ch3 Ch2 Ch1

1N4001

Vin

Ch0 Com

+Vs

Figure 1. Circuit diagram illustrating how bipolar data are collected using a Si diode in series with a resistor. The inputs of the A/D board used in these experiments are shown on the left side of the figure.

JChemEd.chem.wisc.edu • Vol. 80 No. 11 November 2003 • Journal of Chemical Education

1303

In the Laboratory

effectively offsets the input, allowing voltages in the range of approximately 0.7 to approximately 1.3 V to be measured. For the configuration shown in Figure 1, Vin = Channel 0– Channel 3.

Software The MeldVI software package included with the Meld System contains a multichannel digital voltmeter and a data logger, both with open source codes that can be modified for different applications. For data collection, four input channels, channels 0, 1, 2, and 3, are available for use. The Meld menu allows the user to selectively disable any unnecessary input channels. The digital voltmeter displays the input channels selected on the Palm screen and takes continuous voltage readings. However, this program does not save each data point, only those points specified by the user. The data logger program is a slight variation on the digital voltmeter. This program allows the user to specify the destination of the data readings, either to a Notepad file or a spreadsheet-compatible Palm file. The program will also display the input channels and the continuous readings similar to the voltmeter. The data logger can save points from every second up to several minute intervals. As noted earlier, two channels are used to record bipolar data. The virtual ground of approximately 0.5 is read into Channel 3. If the user is taking measurements from Channel 0 of the interface, the value from Channel 3 must be subtracted from Channel 0 in the software in order to show the actual voltage input. The applications are written in HotPaw Basic, a form of the Basic computer language specifically designed for the Palm OS.3 To modify any source code or to create new programs for the Palm, the HotPaw Basic program must be purchased and downloaded for a nominal cost from the above Web site. This program will appear as an icon called “YBasic” on the Palm main menu screen, and all new or modified programs are executed through this program. Potentiometry All chemicals were purchased from Fluka (Ronkonkoma, NY) in Selectophore or puriss. p.a. quality. For pH measurements, a silver/silver chloride reference electrode with 1 M LiOAc as bridge electrolyte (Mettler-Toledo, Wilmington, MA) and a pH responsive glass electrode (Mettler-Toledo) were used. The indicator and reference electrodes were connected to the Palm system via a High Z Interface Module (World Precision Instruments, Sarasota, FL; http:// www.wpi.com/; accessed Jul 2003). The sample solution, containing 10 mM boric acid, and 10 mM citric acid was dropwise titrated with 0.1 M KOH. The pH glass electrode was calibrated by using pH 4, pH 7, pH 10 standard buffer solutions. In the acetic acid–NaOH titration experiment, the unknown concentration of acetic acid solution was titrated with 0.100 M standard NaOH solution. The pH of the solution was monitored by the glass pH electrode that was connected to the Palm. To measure the calibration curve of potassium ion in the sample, a potassium-selective electrode was fabricated according to established procedures (4). A commercially available Philips electrode body (Glasblaserei Moeller, Zurich, Switzerland) was used to make the indicator electrode. The electrode consisted of a Ag/AgCl wire in contact with a 0.01 M 1304

KCl inner filling solution, which was placed behind a potassium sensing membrane. This membrane was prepared by solvent casting, by weighing out 10 mmol/kg valinomycin (Fluka), 5 mmol/kg lipophilic ion-exchanger (sodium tetrakis[3,5-bis(trifluoromethyl)phenyl]borate, NaTFPB) together with poly(vinyl chloride) (PVC, high molecular weight) and the plasticizer bis(2-ethyl hexyl)sebacate (DOS) (1:2 by weight) to give a total mass of 140 mg, and dissolving the mixture in 1.5 mL of tetrahydrofuran (THF) and pouring it into a glass ring (2.2 cm i.d.) affixed with rubber bands onto a microscope glass slide. The solvent THF was allowed to evaporate overnight to form the parent membrane. A 6 mm (i.d.) disk was cut with a cork borer and mounted into the electrode body. After conditioning the indicator electrode in 0.01 M KCl overnight, the electrode was connected to the Palm system as described above for the pH electrode. Aliquots of a 1 M KCl stock solution were added to a pure water sample to obtain a calibration curve. Hazards Sodium hydroxide and acetic acid solutions are corrosive and must be handled with care. Valinomycin is an antibiotic, and should not be ingested. Results and Discussion In this work, it was decided to adapt the Meld hardware and software package, a commercially available Palm-based data acquisition system, to potentiometric measurements. Here, the potential between two electrodes (the so-called indicator and reference electrodes) in a galvanic cell is measured under zero current conditions. In ideal cases, the Nernst equation can then be used to describe the relationship between the activity aI(aq) of an ion I in the sample solution and the potential (EMF) of the cell: EMF  K  s log aI(aq)

(1)

Where K is a constant and s is the electrode slope (typically 0.0592 V for the measurement of monovalent ions at 25 °C). A calibration curve can be constructed for the determination of an unknown activity by measuring the EMF at various known activities and graphing the results (EMF against the logarithm of the activity). The most common application of potentiometry is pH measurement with glass electrodes. Moreover, through the development of polymer membranebased electrodes that selectively respond to many different ions (5) at sometimes extremely low concentrations down to low parts per trillion levels (6), potentiometry (ion-selective electrodes) has widespread applications in clinical and environmental monitoring. Because of the simple instrumental setup for effective use of potentiometric measurements it is one of the classical analytical experiments in undergraduate chemistry laboratories (7). Several hardware and software modifications were necessary to adapt the commercially available Palm-based data acquisition system to potentiometry. Potentiometric voltage data normally require a very high input impedance of at least 1011  to ensure accurate readings. While it was found that the direct connection of the pH and reference electrodes to the data acquisition system gave functional voltage readings, it is known that this may introduce errors, the extent of which

Journal of Chemical Education • Vol. 80 No. 11 November 2003 • JChemEd.chem.wisc.edu

In the Laboratory 0.325 0.323

emf / V

depend on the resistance of the ISE measuring cell (8). Normally, one may connect the chart recorder output of a commercial pH meter directly to the Palm-based data acquisition system. In this work, however, a battery operated high Z interface module was utilized for signal conditioning, which is portable and well suited for quiet potentiometric data analysis. This interface functions as a reliable voltage follower, and has a high input impedance and low output impedance. Potentiometric data from pH or ion-selective electrodes are bipolar data with a voltage range of typically at most ± 0.5 V. The unmodifed Meld system offers unipolar voltage acquisition only. As suggested by the developer of the Meld system and discussed earlier, a diode was connected to the virtual ground of the interface. The potentiometric voltage data were acquired by connecting the signal from the indicator electrode (pH or potassium electrode) to channel 0 of the module, and the one from the reference electrode to the offset diode connected to the virtual ground. This simple procedure proved to be effective for the acquisition of bipolar voltage data. Initial testing of the Meld data acquisition system was performed with a potassium-selective electrode. The indicator and reference electrodes were immersed in a pure water

0.321 0.319 0.317 0

10

20

30

40

50

60

70

Time / s Figure 2. EMF-time trace of the potassium-selective electrode in 10 M KCl solution illustrating the voltage resolution of the 12 bit data acquisition system.

solution. The voltage data were continuously acquired as a data stream onto the Palm while increasing the potassium concentration in the sample by adding aliquots from a KCl stock solution. A portion of the acquired data stream (voltage as a function of time) for one potassium concentration is shown in Figure 2. Discrete voltage steps, about 0.5 mV apart, are indicative of the performance of the 12 bit data acquisition system used here. A 0.5 mV resolution corresponds to a pH

Text Box 1. Data Acquisition Program Source Code Used in This Laboratory Exercise # titration.bas

# open serial port

dim a(10) for i = 0 to 9 a(i) = 0 next i

sub openport open “com1:”,19200 as #5 else er1z z = fn wait(0.05) end sub # read adc input sub adcread(cmdz,nbz,caz) put #5,cmdz timo = timer sz = 0 while sz < nbz sz = fn serial(5) if timer - timo > 3 then gosub er2z wend vz = 0 for iz = 1 to nbz vz = vz*256 + get$(#5,0) next iz adcread = vz*caz end sub sub er1z print “Serial port is unavailable” end end sub sub er2z close #5 print “Lost contact with module” end end sub # close port sub closeport close #5 end end sub

p$ =inputbox(“file name”) open new “memo”, p$ as #4 while (1) n$ = inputbox(“Enter volume (mL)”) draw -1 form btn 60,80,40,12, “OK”,1 draw “click OK to collect data”,60,100 x = asc(input$(1)) :’ wait for button draw -1 v$ = “scroll down to quit” draw v$,10,130,0 gosub openport for i = 0 to 9 gosub adcread(16+0,2,0.0005) a(i) =adcread next i v$ = str$(a(0)+10.000001) v$ = mid$(v$,2,6) y =(a(0) + a(1) + a(2)+ a(3)+ a(4)+ a(5)+ a(6)+ a(7)+ a(8)+ a(9))/10 y$ = str$(y+10.000001) y$ = mid$(y$,2,6) draw v$,10,25+j*20,2 print #4,n$,”,”,y$ wend end

JChemEd.chem.wisc.edu • Vol. 80 No. 11 November 2003 • Journal of Chemical Education

1305

In the Laboratory 0.6

0.0 0.5

emf / V

emf / V

-0.1

0.4

-0.2

-0.3 0.3

-0.4

-5

-4

-3

-2

-1

0

log aK ⴙ

0.010

0.015

0.020

0.025

0.030

Amount NaOH / mol

Figure 3. Calibration curve for the potassium sensor generated using the voltage averaging software discussed in the text. The curve is linear with a positive slope of 54 mV, which is in good agreement the Nernst equation (eq 1).

Figure 4. Titration of acetic acid with NaOH as monitored with a pH responsive glass electrode connected to the Palm data acquisition system operated with the source code shown in Text Box 1.

or pK = 0.01, which is sufficient for most benchtop analysis applications. This nominal resolution can be improved by averaging sequentially acquired data. Sample averaging is especially important if the voltage noise or drift is larger than the nominal resolution of the A/D board. As shown in Figure 2, this seems to be the case here. The proper acquisition of potentiometric voltage data requires the acquisition of discrete voltage values (one per concentration, or one per titrant volume), and the capability of some data averaging. We modified the source code of the Meld digital voltmeter program, as shown in Text Box 1. This program was written in view of a potentiometric pH titration analysis, and can be easily modified to suit other needs. The code initially prompts the student to enter the volume of titrant added to the solution. For recording calibration curves, the volume can be replaced by concentration data. It then instructs the acquisition module to take ten consecutive voltage readings, average them, and record that average in a file. The output file is written to the Palm Notepad and consists of two columns of data, the voltage and the volume, respectively, delimited by a comma. Later, a student can link the Palm to a desktop computer to analyze and graph the results. This process is accomplished by exporting the Notepad file to a text file and opening it in a spreadsheet program. This program will normally guide the user to convert the data to commadelimited form, and will place the data into two columns. The data are then ready to be manipulated into graphs or charts, as desired. A calibration curve for the same potassium-selective electrode used to acquire the data shown in Figure 2 was used with the modified data acquisition software. The data were imported into a spreadsheet program and plotted as a calibration curve. The results are shown in Figure 3. The curve is linear, as expected from the Nernst equation (eq 1), and could now be used to determine the potassium activity of an unknown sample. The same software was also used to monitor discrete pH values in a universal buffer solution by means of a commer-

cial pH electrode. The buffer consisted of a boric acid/citric acid mixture, and the pH values were continuously increased by adding NaOH. The pH reading of the buffer solution was first taken with a commercial pH meter, finding a pH of 2.75. We began taking voltages with the Palm system by titrating the solution with NaOH and taking voltage data until the values stabilized at every point. Then we recorded voltages of buffer solutions with known pH values of 4, 7, and 10 to convert the voltage data to pH values. The resulting electrode slope was 57 mV per pH unit change. We found the pH range of this experiment to be from 2.6 to 12.1 (data not shown), which falls in the expected range. For our fourth experiment, we titrated acetic acid with sodium hydroxide. After entering each volume of titrant, the corresponding average voltage readings (EMF) were taken. We continued to take readings until the titrant neutralized the acid. We transferred the data into a spreadsheet, making sure to adjust the EMF values to account for the diode offset of 0.7 volts. We graphed the total EMF against the moles of titrant (NaOH) added, and obtained the corresponding titration curve (Figure 4).

1306

Conclusions The use of Palm handhelds in the laboratory provides an accessible, portable research tool that is applicable to a wide range of experiments. Our study shows just one application, potentiometry, but the hardware and software can be easily modified for other experiments that involve voltage data. Because all components of the system are battery operated, remote sensing experiments also become possible, which could have applications in environmental monitoring. This technology, combined with the multiple functions of HPCs, both in the lab and in everyday use, provides an interesting and useful tool for chemistry students in the laboratory. Although not tested by us, the Meld data acquisition system used here does not appear to be compatible with PocketPC versions of handheld computers, and is not guaranteed to work with every handheld computer on the market. None-

Journal of Chemical Education • Vol. 80 No. 11 November 2003 • JChemEd.chem.wisc.edu

In the Laboratory

theless, it should be possible to adapt the open source software to other platforms or measuring applications as needed. Further development of a wider range of applications in a more sophisticated and cross-compatible programming environment is currently in progress in our laboratories. Acknowledgments We would like to thank the Office of the Vice President for Research at Auburn University for support of this project. Y. Q and E. B. gratefully acknowledge financial support from the National Institutes of Health (GM59716 and GM58589) and the Petroleum Research Fund (administered by the American Chemical Society) for their research. C. S. would like to acknowledge the financial support of the Department of Energy (DE-FG02-02-ER45963) and the Petroleum Research Fund (administered by the American Chemical Society). Notes 1. For examples of HPCs with these features, see the following URLs: http://www.palmsens.com/; http://www.omniwww.com/; http:// www.dataget.com/; http://www.versid.com/; http://www.datastick.com/; http://www.volant-systems.com/ (accessed Jul 2003).

2. See this World Wide Web site: http://www.execpc.com/ ~fdeck/meld/ (accessed Jul 2003). 3. See this World Wide Web site: http://www.rahul.net/rhn/ hotpaw/ (accessed Jul 2003).

Literature Cited 1. Sprague, E. D.; Voorhees, R.; McKenzie, P.; Alexander, J. J.; Padolik, P. J. Chem. Educ. 1998, 75, 859. 2. Hickman, A. B.; Helburn, R. S.; Delinger, W. G. J. Chem. Educ. 2000, 77, 255. 3. Sales, C. L.; Ragan, N. M.; Murphy, M. K. J. Chem. Educ. 2001, 78, 694. 4. Bakker, E. J. Electrochem. Soc. 1996, 143, L83. 5. Bühlmann, P.; Pretsch, E.; Bakker, E. Chem. Rev. 1998, 98, 1593. 6. Ceresa, A.; Bakker, E.; Hattendorf, B.; Günther, D.; Pretsch, E. Anal. Chem. 2001, 72, 343. 7. Ramaley, L.; Wedge, P. J.; Crain, S. M. J. Chem. Educ. 1994, 71, 164. 8. For a discussion of this instrumental issue, see: Skoog, D. A., Holler, F. J., and Nieman, T. A. Principles of Instrumental Analysis, 5th edition; Harcourt Brace College Publishers: Philadelphia, PA, 1998; Chapter 23.

JChemEd.chem.wisc.edu • Vol. 80 No. 11 November 2003 • Journal of Chemical Education

1307