[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read temperature from i/o



John_L._Graham@adbbs.antioch.edu (John L. Graham) wrote:
>Ahah! You came to the right place! Do I hear Erick's fingers tapping away?

[changing from Lurk to Lurch mode...]
You rang?

I'll agree with John's comments and add the following thoughts.

A couple of approaches can be used to measure temperature.  Ranging
from simple and inexpensive (within $5) to more complex and costly 
($10-?).

A thermistor is cheap, readily available, doesn't place too many
demands on the user (construction techniques), and very simple to
interface to the game port.  The results can be obtained just like
you would for a joystick/paddle but your program must "scale" and
calibrate the readings so they make sense.

More accurate readings would require a solid-state temperature
sensitive sensor (looks like a small transistor) and a circuit
to drive it.  Such a circuit could output the result in one of
several different ways (each method has its merits but also
may imply additional circuitry or fancy programming).  For example,
the output could be voltage that is proportional to changes in
temperature.  In this case, an Analog-to-Digital (ADC,A-to-D,etc.)
converter could convert the voltage values into binary values that
are easy for the computer to work with -- simplifies programming.
There are ADC circuits for the Apple II game port;  Vernier Software
offers a kit for this.  Another approach would be to output the
results as digital pulses whose frequency varies with changes in
temperature.  The digital pulses could be feed into one of the
game port switches but the programming to poll/sample the switch input
could get tricky since you need to know the exact time (cycle counting)
for your code.  One method involves counting the number of incoming
pulses for a certain number of iterations through your loop and then
using this information to calculate the equivalent frequency and relate
this to temperature.

Sorry if this sounds more complex than it really is.  If you would like
references (e.g., books), let me know and I'll repost some of my KFest
notes.

Erick