measure the temperature through a J-type thermocouple - Page 1
Forum section: electronics / general

author: BlogRahul
author_rank: Regular Contributor
timestamp: April 05, 2022, 03:55:53 pm
content: I watched one youtube video many months back where he was measuring temperature through a J-type thermocouple by making a voltage divider connection. He was using Raspberry PI, ADS1115 with inbuilt amplfier and voltage dividerI am searching that video on youtube I tried a lot searching but I don't find video nowI don't understand why he used voltage divider, if we want to divide voltage we just use resistor's,any idea why there was vlotage divider to measure the temperature ?

author: Kleinstein
author_rank: Super Contributor
timestamp: April 05, 2022, 05:16:39 pm
content: A voltage divider alone does not make much sense.With a thermocouple one needs to measurent the rather small thermovoltage (e.g. mV range) and need to take the cold juntion temperature into account.For the cold junction temperature there are 2 main options:a) have an analog temperature sensor for the cold junction temperature, scale it to the sensitivity of the TC and subtract from the thermovoltage in the analog domain. The scale down from the sensor may use a divider, e.g. some 1:50 to go from some -2 mV for a diode to around 40 µV/K for a type K thermocouple.The offset for the absolute temperaturte is usually easier to subtract digitally.b) measure the cold junction temperature separately (e.g. sep. ADC channel or ADC, or a digital sensor) and than scale and subtract in software.

author: Siwastaja
author_rank: Super Contributor
timestamp: April 05, 2022, 05:27:05 pm
content: I don't understand your question about voltage divider, but to get you in the right track on thermocouple basics:* Thermocouples do not and can not measure temperature. They measure temperaturedifference, between the two "ends" (junctions). Hence, they always need another type of actual temperature sensor, which is placed as near as possible to the "cold junction" (which is a weird name since it can be either hotter or cooler than the another junction).* Thermocouples simply generate a smallvoltage, based on said voltage difference. So thermocouple circuit is nothing but a voltmeter. Plus the reference thermometer of any type. Plus calculation, usually digital nowadays.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 05, 2022, 05:33:39 pm
content: This.And the "tricky" part is just that the voltages are very low, so you need significant gain and appropriate measures for limiting noise issues.If you're not comfortable designing such a conditioning circuit yourself, there are integrated solutions out there that work just fine, such as the MAX31855.You can read this too:https://www.ti.com/lit/an/sbaa274/sbaa274.pdf

author: benSTmax
author_rank: Regular Contributor
timestamp: April 05, 2022, 07:34:33 pm
content: If you want to play with different types of thermocouples, you can try out this Mikroe Clickhttps://www.mikroe.com/thermo-k-clickI used a few Clicks for a small project a couple of years ago. It uses the MCP9600 which allows you to use different thermocouples by just changing a settings register inside the chip. Pretty neat solution

author: BlogRahul
author_rank: Regular Contributor
timestamp: April 06, 2022, 08:56:06 am
content: I had code from youtube link, In this code the ADC value is being converted into temprature valueCode:# Simple demo of reading the difference between channel 1 and 0 on an ADS1x15 ADC.# Author: Tony DiCola# License: Public Domainimport time# Import the ADS1x15 module.import Adafruit_ADS1x15# Create an ADS1115 ADC (16-bit) instance.adc = Adafruit_ADS1x15.ADS1115()# Or create an ADS1015 ADC (12-bit) instance.#adc = Adafruit_ADS1x15.ADS1015()# Note you can change the I2C address from its default (0x48), and/or the I2C# bus by passing in these optional parameters:#adc = Adafruit_ADS1x15.ADS1015(address=0x49, busnum=1)# Choose a gain of 1 for reading voltages from 0 to 4.09V.# Or pick a different gain to change the range of voltages that are read:# - 2/3 = +/-6.144V# - 1 = +/-4.096V# - 2 = +/-2.048V# - 4 = +/-1.024V# - 8 = +/-0.512V# - 16 = +/-0.256V# See table 3 in the ADS1015/ADS1115 datasheet for more info on gain.GAIN = 1print('Press Ctrl-C to quit...')while True:# Read the difference between channel 0 and 1 (i.e. channel 0 minus channel 1).# Note you can change the differential value to the following:# - 0 = Channel 0 minus channel 1# - 1 = Channel 0 minus channel 3# - 2 = Channel 1 minus channel 3# - 3 = Channel 2 minus channel 3value = adc.read_adc_difference(0, gain=GAIN)# Note you can also pass an optional data_rate parameter above, see# simpletest.py and the read_adc function for more information.# Value will be a signed 12 or 16 bit integer value (depending on the ADC# precision, ADS1015 = 12-bit or ADS1115 = 16-bit).print('Channel 0 minus 1: {0}'.format(value))temp = (((value/8)/8.33))# Pause for half a second.time.sleep(0.5)I don't uunderstand this formula in the codeCode:temp = (((value/8)/8.33))Does anyone understand what's going on ?

author: eutectique
author_rank: Frequent Contributor
timestamp: April 06, 2022, 09:50:51 am
content: Quote from: BlogRahul on April 06, 2022, 08:56:06 amAre you suretempstands fortemperatureand nottemporary? I've seen too many times when a variable is namedtemportmpjust out of lack of imagination.

author: BlogRahul
author_rank: Regular Contributor
timestamp: April 06, 2022, 09:58:38 am
content: Quote from: eutectique on April 06, 2022, 09:50:51 amtemp is the variable name that store value and I think it would be temprature value because of conversion

author: peter-h
author_rank: Super Contributor
timestamp: April 06, 2022, 12:02:58 pm
content: Remember that there is a trick with CJC (cold junction compensation):You have to measure the CJC temperature and then backward-linearise that to the correspondingthermocouple voltage, then measure the thermocouple voltage itself, subtract the CJC voltage, and linearise the result forwards to get the resulting temperature. Cheap instruments don't bother with the first step.

author: BlogRahul
author_rank: Regular Contributor
timestamp: April 06, 2022, 10:24:02 pm
content: This line in the code is mystery for me. I don't undesrand calculation for tempratureCode:temp = (((value/8)/8.33))

author: jpanhalt
author_rank: Super Contributor
timestamp: April 06, 2022, 10:57:18 pm
content: As suggested in post#5, there are ready made sensors that provide digital temperature via SPI or I2C interfaces. The two from Maxin (MAX31855 and MAX31856) are less than $10 each and have onboard temperature measurement and cold junction compensation. Development boards are less than $20 (US). No math is involved except to convert the data to what you need. That is, the MAX31856 provides the temperature in 2's complement, which is an easy conversion.Here's a link to the MAX31856 datasheet:https://datasheets.maximintegrated.com/en/ds/MAX31856.pdf

author: tepalia02
author_rank: Regular Contributor
timestamp: April 16, 2022, 01:47:08 am
content: Not what you're looking for. But this one will help you regarding thermocouple interfacing with Raspberry Pi.

author: bson
author_rank: Unknown
timestamp: April 16, 2022, 02:14:28 am
content: Or, if all you need is a digital thermometer rather than a precision instrument...https://www.analog.com/en/products/adt7310.htmlIts error is almost all offset, so if you're willing to zero it yourself you can get much better accuracy than the specified ±0.5˚C. Its SPI interface is very DMA friendly in that it can be set to continuous readout - just clock it 16 0's and you get 16 bits of temperature back while in that mode.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 16, 2022, 02:27:21 am
content: Getting better than +/-0.5°C with a thermocouple is challenging, so I doubt accuracy is the OP's concern here. But the part you mention is good up to 150°C - with thermocouples, you can measure temperatures of several hundreds of °C. I'm assuming this is what the OP's after. But who knows.

author: paf
author_rank: Regular Contributor
timestamp: April 16, 2022, 07:29:24 am
content: Thermocouples are cheap, robust and can measure temperatures up to several hundreds of , as has been said.But, first it is better to know what is the RANGE of temperatures you want/need to measure. There may be other methods or sensors.If you really want/need a thermocouple, read about what a thermocouple really is and how it works.I once saw a "homework" proposal, for students new to electronics that comprised measuring temperature in the -5 ... 30 °C range with a thermocouple. According to the proposal, all the students needed was a resolution of 1 microVolt, done with an Arduino, in order to get the right temperature resolution.

author: dtsystems
author_rank: Contributor
timestamp: April 18, 2022, 01:57:28 am
content: I use DS18B20 modules for this.They are great and do the job perfectly.