Newsgroups: comp.sys.apple2 Path: news.uiowa.edu!chi-news.cic.net!newsxfer2.itd.umich.edu!gatech!swrinde!elroy.jpl.nasa.gov!lll-winken.llnl.gov!fnnews.fnal.gov!nntp-server.caltech.edu!news.ridgecrest.ca.us!owens!croton From: Cyrus Roton Subject: Re: read temperature from i/o port In-Reply-To: <4hi4ds$5ej@acme.freenet.columbus.oh.us> X-Sender: croton@owens X-Nntp-Posting-Host: owens Content-Type: TEXT/PLAIN; charset=US-ASCII Message-ID: Sender: usenet@ridgecrest.ca.us (Ridgenet Usenet admin) Organization: RidgeNet - SLIP/PPP Internet, Ridgecrest, CA. (619) 371-3501 References: <4hgjnd$jls@cloner4.netcom.com> <4hi4ds$5ej@acme.freenet.columbus.oh.us> Mime-Version: 1.0 Date: Wed, 6 Mar 1996 16:37:55 GMT Lines: 39 On 5 Mar 1996, Dave Althoff wrote: > > A thermistor is a reisitor which has a variable resistance related to > ambient temperature. I've seen them at Radio Shack in the parts cards, > and those indicate what the resistance is at a particular temperature. > > The paddle ports on an Apple ][ are 150k ohm (or was it 150 ohm...I don't > recall off-hand). So that is the range of resistances you need to work > with. -------------- snip ----------------- You can connect a resistor to a paddle input and supply a voltage to the other end. Current flows through the resistor to charge a .022 mfd capacitor inside the apple2. When the paddle is read, the apple2 discharges the capacitor and resets a timmer. Then the cap is allowed to charge. When the charge reaches the trigger level (3.2 volts) the timmer is stopped and the count is read out. The lower the value of the resistor, the faster the charge and the lower the count. Also, the higher the voltage, the faster the charge. A resistance of about 120K with a 5 Volt supply will give a count of about 250. You can add an external capacitor across the paddle input (to ground) to increase the charging time (if needed) The formula is (charge) = (input volts) * (1 - exp(-t/RC)) So, you can use a supply voltage and external capitor as required to fit the resistance value of the thermister (or other resistive component). Probably, the best way to find the correct values woud be to try a variety of values and plot the "count" as a function of the variable resistance. Then compare the plot against the resistance curves for the thermister (probably not linear), and work out some conversion formula to use in your program to correlate "count" to temperature. Cyrus Roton croton@ridgecrest.ca.us Ridgecrest Apple User Group