Using the Apple game port to measure pH

Using the Apple Came Port To. Measure pH. Edward Kelly. Marian College. Indianapolis. IN 46222. The Apple game port consists of a 5-V source, an elect...
1 downloads 0 Views 760KB Size
the computer bulletin board Using the Apple Came Port To Measure pH Edward Kelly Marian College Indianapolis. IN 46222 The Apple game port consists of a 5-V source, an electrical ground, three flag inouts or oushbuttans (PBO-2). four annunciators (ANo-3), and four g a k control inputs or paddles (GCO-3). Project SERAPHIM' has developed a numher of simple chemistry experiments using the game control inputs or paddles that are capable of measuring resistance. By using a suitable transducer (thermistor, phototransistor, or photoresistor), changes in temperature or light intensity can be measured. Since an electrical ootential is eenerated in -~~~~ manv chemistrv ~-~ - - ~ - eaoeriments. ~ ~ ~ ~.it~would he advantageous to use the game port to measure electrical potential. This article will describe a circuit that measures the electrical potential using the pushhuttan and annun ciatar connections a t the Apple game port. The annunciator sends a binary signal, either hieh (+5 V) or low (0V). The pushbuttan or ha;.. inn& looks i t the most sienifi. cant bit (MSH) of an incoming s i ~ n dand decides if it is high ( 7 5 VI or Iuw (0 \',.The remninmg bits f n m the signal are drrrarded. a

.

Pin Cormectlons between the ADC and the .

Journal of Chemical Education

most significant hits of the previous conversion. After the fourth falling edge of the I/O clock the sample-and-hold begins on the next analogue voltage input. The next three I10 clock pulses output the sixth, seventh, and eighth bits of the previous conversion. The eighth I/O clock pulse completes the sampling of the analogue voltage input and initiates the hold. The CS voltage is brought high, and the conversion of the analogue voltage to the digital voltage is initiated. The CS voltage must remain high until the conversion is completed (36 internal clock pulses). This is usually not a problem for a program written in BASIC. When the CS voltage is brought low, the new digital voltage is output as described above. The digital voltage is input to the computer through pushbutton two (PB2), bit by bit, starting with the most significant hit (MSB). Two annunciators are used; one (ANI) supplies the chip select (CS) voltage to pin 5 to activate the ADC. When this voltage is low (0 V), the ADC is activated. The second annunciator (AN2) supplies a voltaee tooin 7 of the ADC. which simulates an external 1.10 clock. Each time.this annunciator is turned on and off (simulating a dock pulse), a single hit is sent from output pin 6 of the ADC to PB2 of the Apple game port. The first value output by the ADC is the

- .

~

~~

.

A254

The circuit described in this paper was presented during a Chautauqua Short Course by Rex Berney2. I t consists of an analogue-to-digital converter (ADC) Texas Instruments TLC 548) connected to an Apple game port socket. The ADC samples and holds an analogue voltage, and on signal converts that analogue voltage to the corresponding digital voltage. While the analogue voltage sampling is taking place, the previous digital voltage is output on pin 6 of the ADC. It is important to realize that the voltage output by the ADC was measured at some earlier time. The table lists the pin connections between the ADC and the game port.

There are two control inputs for the ADC described in this article. The first is the chip select (CS) voltage. When this voltage is brought low, the most significant bit (MSB) of the previous conversion is output to pin 6 of the ADC. The second control is the I10 clock. After the CS voltage drops low, the first four negative edges of the I10 clock shift out the second, third, fourth, and fifth

~~~~~~~

~

~~~~

~~~~~

~

~~

~

'For a catalog, wrlte Project SERAPHIM. Department of Chemistry. University af WisconrinMadison. Madison. WI 53706. Chautauqua Short Course: "Advanced Corn puter Interfacing";Rex Berney. University of Dayton, April 1987.