TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: JIM JACKSON
from: THEO
date: 2020-02-27 15:12:00
subject: Re: rPi 3 w/thermistor

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

--- 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™.