TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: THEO
from: RICHARD OWLETT
date: 2020-02-27 10:35:00
subject: Re: rPi 3 w/thermistor

On 02/27/2020 09:12 AM, Theo wrote:
> Jim Jackson  wrote:
>> The setup you describe provides a variable analog voltage output. Non of
>> the raspberry pi have the capability to directly read an analog voltage,
>> you need an add-on Analog-to-Digital-Converter (ADC) either as a "hat",
>> breakout board, or chip in a breadboard.
>
> You don't need an ADC, you can do it via timing a capacitor.
>
> Wire up something like this:
>
> GPIO0 -=thermistor=-----+---||----- GND
>              R           |    C
>                        GPIO1
>
> Set GPIO0 low, wait a while.
> Now set GPIO0 high and start timing
> When GPIO1 goes from 0 to 1, stop the clock
>
> If you know the time, capacitance C, the GPIO output high voltage, and the
> low-to-high threshold voltage for GPIO inputs, you can solve the capacitor
> charging equation to find R.
>
> Putting the midpoint into a comparator with a more precise threshold would
> help with accuracy over using GPIO1 directly.  Using its reference voltage
> as GPIO0 divided exactly in half via a potential divider would make the
> system independent of I/O voltage variations.
>
> Theo
>

IIRC Thermistors can be quite non-linear. Check the datasheet for the
thermistor you are using. Over your specific temperature range it may be
linear enough.

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.