Page 1 of 1

thermocouple data conversion question

Posted: Fri Jan 27, 2017 8:19 pm
by rccapps
I wanted to experiment with using a Type K thermocouple connected directly to GPIO pin(s) using an RC(resistor-capacitor) charging circuit as outlined in this article: https://learn.adafruit.com/basic-resist ... i?view=all

Instead of a photoresistor, I would use a thermocouple, of course. And I realize, too, as the article points out, that this is not as accurate as using an intermediary ADC (like MCP3008). But I'd just like to see how (in)accurate such a simplified circuit would be.

I haven't put the circuit together yet, but I don't anticipate any problems with data acquisition. But the RC time equation (obviously) involves the relationship of resistance, capacitance and time. And the reference charts for Type K thermocouple temperature conversion compare the temp to Volts, not Ohms.

And I'm not convinced the old standby V = IR would help here, because I don't think that I (current) is constant thru this circuit. If I'm wrong, I'd be happy to hear it - because then, whatever the current is, voltage and resistance would be proportional to one another. Then I could use an ice water bath for a 0 Celsius / 0 voltage reference point, and I could plot any other points based on the proportional rise. At worst, I'd probably need to take another reference reading (e.g. inside a pre-heated oven). But I'd like a simpler mathematical solution which would allow me to use the existing charts, if I could. Anybody?

Re: thermocouple data conversion question

Posted: Fri Jan 27, 2017 8:28 pm
by danjperron
The RC system is not precise at all since the trigger schmitt of the GPIO aren't.

Just buy a max6675 like this one
http://www.dx.com/p/keyestudio-max6675- ... IusYRsrJhE

There are so cheap and work very well using the SPI.
No need to do a conversion since it is build inside the I.C.

Re: thermocouple data conversion question

Posted: Fri Jan 27, 2017 10:29 pm
by DougieLawson
danjperron wrote: Just buy a max6675 like this one
http://www.dx.com/p/keyestudio-max6675- ... IusYRsrJhE
Except they're crap. They won't read below 0°C, the temp values fluctuate badly, the resolution is awful and the top of the range for the 10-bit ADC is low.

MAX31855 is a much better SPI type-K thermocouple amplifier as it has a better range, better resolution and because there's a secondary temperature sensor on the board there's no fluctuation.

I've been running two MAX6675s and two MAX31855 for a couple of months. One 6675 connected to a Raspberry, one connected to an Arduino Nano. One 31855 connected to a Raspberry, one connected to an Arduino Uno.

Re: thermocouple data conversion question

Posted: Tue Jan 31, 2017 2:51 pm
by bitbank
@DougieLawson,
If you don't mind sharing, I'm curious as to what purpose you're using these thermocouple+sensors.

Re: thermocouple data conversion question

Posted: Tue Jan 31, 2017 8:17 pm
by DougieLawson
bitbank wrote:@DougieLawson,
If you don't mind sharing, I'm curious as to what purpose you're using these thermocouple+sensors.
At the moment they're just being run experimentally. The fella who sent them to me hasn't told me the details of the project.

I did run an experiment that involved roasting dinner then cooking dessert to follow.

Image

If you want any of my code, just ask. I may put if on github anyway just for curiousity value.

Re: thermocouple data conversion question

Posted: Tue Jan 31, 2017 9:43 pm
by bitbank
Thanks for the details. For 99% of my projects, I'm more interested in writing my own code than using an existing solution. I like the challenge of figuring out how to get stuff working rather than just stacking lego blocks of code together. I'm having fun experimenting with I2c devices right now. I've written code to drive a SSD1306 OLED display, a PN532 NFC/RFID transceiver and am awaiting a SME280 temp/humid/pressure sensor to play with that. I'm also in the process of writing my own "squirrel cam" code to use the Raspi camera (as /dev/video0) with motion detection and image capture using my own software. As an experienced software developer (adult), I don't really need to spend time on these things, but I use them as lessons to teach my kids programming.