rPi 3 w/thermistor

Hi, I am trying to use a 2 lead thermistror (not a temp/humidity sensor) with RPi 3B+. Is it possible to wire this without a breadboad?

I cannot find any instructibles or any rpi python code examples anywhere. What I did so far is connect the ground to one lead, vcc to the other lead using a Y union and put an inline 1-K ohm rewsitor to a third lead as signal [GPIO 23). Is there any code magic that can read the digital signal and convert it to tempature?

Thanks in advance

--- Synchronet 3.17c-Win32 NewsLink 1.112 Alleycat! BBS - telnet://alleycat.synchro.net

Reply to
Gregg Somes
Loading thread data ...

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.

Googling

raspberry pi using a thermistor to measure temperature

gave a few hits such as ...

formatting link

formatting link

Happy reading.

Jim

Reply to
Jim Jackson

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

Reply to
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.

Reply to
Richard Owlett

Low to high threshold is probably more temperature dependent than the thermistor!

A better bet is to construct an RC oscillator with the thermistor as part of the R and measure frequency, but this is not a simple thing - you need a fair few components

The best bet is to buy this:

formatting link

I2C interface ..

--
You can get much farther with a kind word and a gun than you can with a  
kind word alone. 
 Click to see the full signature
Reply to
The Natural Philosopher

Pi's don't have any analog to digital convertors. The simplest solution is most likely to be a 1-Wire temperature sensor:

formatting link

Plenty of code out there to work with them (and many of the other

1-Wire devices).
--
Cheers 
Dave.
Reply to
Dave Liquorice

One wire? BULL! I quote the referenced pdf "... one data line (and ground)". And as a PRACTICAL point you need another wire to power the device. That makes it a *THREE* wire device.

Reply to
Richard Owlett

Yebbut there is only one DATA wire. :-)

You are probably not old enough/in te wrong country to have listened to the exploits of Larry the Lamb and Dennis the Dachsund in Toytown, on the radio.

There was a character called IIRC the Inventor who complained 'the trouble with this wireless is that it involves such a lot of WIRE!!!"

formatting link

--
Microsoft : the best reason to go to Linux that ever existed.
Reply to
The Natural Philosopher

On a sunny day (Thu, 27 Feb 2020 09:08:45 -0400) it happened "Gregg Somes" wrote in :

First question is what do you want to measure if it is temperature below / above some point MAYBE, but thermistors are highly non-linear, so you want to either measure voltage across your resistor and then calculate the resistance / and then whatever that represents

AFAIK raspi has no analog input, so you need what is called an analog to digital converter (board?).

The GPIO as _digital_ input sees a 'logic zero' below some voltage and a 'logic one' above some voltage. Th exact voltage can vary, also depends on temperature and production spread, but is somewhere between 0 and 3.3 V

So UNLESS you want o measure a dead cold versus a red hot thermistor is not of much use.

An external ADC (analog to digital converter) also will need a stable external reference voltage I have done all sort of things with temperature sensors using Microchip PICs as ADC.. connected to serial port... but that needs some electronics and programming knowledge,

formatting link

Of course there are other ways, for the fun .. I wrote a program that converts a digital clock display read by a camera to time as text, you could use it to read a multimeter :-) Anyways to interface and ADC to GPIO takes some electronics knowledge and some programming knowledge, preferably C,

But maybe there exists a board 'HAT?'for that?

Reply to
Jan Panteltje

On a sunny day (27 Feb 2020 15:12:58 +0000 (GMT)) it happened Theo wrote in :

Cool!

Reply to
Jan Panteltje

Of course there dies, Or rather an 12c interface board which is handier since you can mount it where you want to measure temps..

--
?it should be clear by now to everyone that activist environmentalism  
(or environmental activism) is becoming a general ideology about humans,  
 Click to see the full signature
Reply to
The Natural Philosopher

ty

eadboad?

ROFL

o

I was in college by time it ended. But on the wrong side of the Pond.

!!!"

ansmitted

Reply to
Richard Owlett

They|some can be 'parasitically' powered from the data line's pull up ...

so one wire ... and a ground that is everywhere - ish :-)

Avpx

--
'You've got the loudest silences I ever did hear from anyone who wasn't 
dead!'  
 Click to see the full signature
Reply to
Nick Norman

Yeah. BUT the spec sheet shows it as a three terminal device.

Reply to
Richard Owlett

- as in DS18B20, parasitic temperature chip, most easily used as a 3-pin TO-92 package...

--
Mark J 
From RISCOS 5.27 on a BeagleBoard-xM and Raspberry Pi2B 
 Click to see the full signature
Reply to
Mark J

On Fri, 28 Feb 2020 11:39:05 GMT, Jan Panteltje declaimed the following:

Presuming common CMOS thresholds of 30 and 70%: 2.31V is HIGH. What the circuit does between those thresholds is indeterminate (I'd hope it holds the last valid state until the far threshold is crossed).

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

# A fairly presumptuous presumption.

2.31V

No, it is perfectly possible to have the output between '0' and '1'. At hear all digital circuits are in fact analogue, just as all analogue circuits at the quantum level are in fact digital :-)

It does not.

--
"Anyone who believes that the laws of physics are mere social  
conventions is invited to try transgressing those conventions from the  
 Click to see the full signature
Reply to
The Natural Philosopher

that is exactly what does NOT happen. the logic sate will flip at some in-determinant point between the two thresholds. The thresholds are simply points at which the state is guaranteed.

--
This restaurant was advertising breakfast any time. So I ordered 
french toast in the renaissance. 
 Click to see the full signature
Reply to
Alister

This is mostly true, but not when the device specifies a schmitt trigger input, when indeed the output is held until the second threshold is reached.

--
W J G
Reply to
Folderol

far

And even when it has flipped it can flip back again if the signal remains between the thresholds. Hence the requirement for pull up/down resistors.

--
Cheers 
Dave.
Reply to
Dave Liquorice

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.