rccapps
Posts: 4
Joined: Wed May 30, 2012 5:32 am

thermocouple data conversion question

Fri Jan 27, 2017 8:19 pm

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?

danjperron
Posts: 3503
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: thermocouple data conversion question

Fri Jan 27, 2017 8:28 pm

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.

User avatar
DougieLawson
Posts: 39126
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: thermocouple data conversion question

Fri Jan 27, 2017 10:29 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
bitbank
Posts: 253
Joined: Sat Nov 07, 2015 8:01 am
Location: Sarasota, Florida
Contact: Website

Re: thermocouple data conversion question

Tue Jan 31, 2017 2:51 pm

@DougieLawson,
If you don't mind sharing, I'm curious as to what purpose you're using these thermocouple+sensors.
The fastest code is none at all :)

User avatar
DougieLawson
Posts: 39126
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: thermocouple data conversion question

Tue Jan 31, 2017 8:17 pm

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.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
bitbank
Posts: 253
Joined: Sat Nov 07, 2015 8:01 am
Location: Sarasota, Florida
Contact: Website

Re: thermocouple data conversion question

Tue Jan 31, 2017 9:43 pm

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.
The fastest code is none at all :)

Return to “Automation, sensing and robotics”