Need Help with K-Type Thermocouple Interface on Atmega1280 MCU

Thread Starter

moheddinebouajilavrx@gmai

Joined Apr 9, 2024
3
Hello everyone,

I'm currently working on a project where I need to interface a K-type thermocouple with an Atmega1280 MCU. However, I'm encountering some difficulties in amplifying the signal of the thermocouple to make it readable by the MCU.

I understand that the conventional solution would be to use a dedicated thermocouple amplifier like the MAX6675. However, due to project constraints, I'm unable to utilize off-the-shelf components like the MAX6675, as I'm aiming to design a custom PCB for this application.

I'm seeking guidance on how to effectively amplify the signal of the K-type thermocouple using discrete components that are compatible with the Atmega1280 MCU. Any insights, schematics, or recommendations for components that could help me achieve this would be greatly appreciated.

Thank you in advance for your assistance.
 

Irving

Joined Jan 30, 2016
4,088
I replied in anther thread - you should only have 1 thread per query.

Based on your message above, is this homework/coursework? If so it should be in the Homework Help forum, and we cannot provide solutions, only critique/guidance to your own work/research.

If this isn't homework, please explain what the project constraints are and why. As I said in my other reply, doing this with an analogue approach is painful and difficult and isn't a real world solution.
 

KeithWalker

Joined Jul 10, 2017
3,197
You didn't mention the temperature range you need the amplifier for. This is the input circuit of the soldering station I designed. It is an amplifier for a K-type thermocouple. The gain is adjustable. I am using it for measuring temperatures up to 400 degrees C. The gain is set with R3 to give 3V out at 300 degrees and the output is fairly linear for the range I am using which is from 200 to 400 degrees. The range could be lowered by increasing the value of the resistor R2. R1 is for open circuit thermocouple protection and can be omitted if not required. There is no cold junction compensation in the circuit. The output was calibrated for a stable room temperature of 20 degrees C.
You are welcome to use and modify this circuit in any way you wish.

TC input.jpg
 
Last edited:

Reloadron

Joined Jan 15, 2015
7,581
Just make sure you consider CJC (Cold Junction Compensation) in whatever you design or come up with. No clue why you can't use a simple solution like the MAX6675 which is a discreet component? There are off the shelf turn key solutions available at reasonable cost. Another option is the AD8495. Would this be a school work assignment? Another chip is the LT1025 which is a good choice considering an amplifier with CJC. If you are not aware of CJC and why it's necessary I suggest you read up on the subject.

Ron
 

Irving

Joined Jan 30, 2016
4,088
Just make sure you consider CJC (Cold Junction Compensation) in whatever you design or come up with. No clue why you can't use a simple solution like the MAX6675 which is a discreet component? There are off the shelf turn key solutions available at reasonable cost. Another option is the AD8495. Would this be a school work assignment? Another chip is the LT1025 which is a good choice considering an amplifier with CJC. If you are not aware of CJC and why it's necessary I suggest you read up on the subject.

Ron
Mods have moved this to Homework Help because clearly that's why there is a limitation on doing it the 'easy' way. My suggestion in his other thread was the MAX31855 which has 14bit v 12bit resolution of the MAX6675.
 

Reloadron

Joined Jan 15, 2015
7,581
Mods have moved this to Homework Help because clearly that's why there is a limitation on doing it the 'easy' way. My suggestion in his other thread was the MAX31855 which has 14bit v 12bit resolution of the MAX6675.
Thanks Irving. I saw mention of another thread but never saw the thread. Yes, I totally agree it's someone's homework. I doubt he can use anything new and what would normally be a viable solution today. Memories of circuits long ago come to mind.

Ron
 

panic mode

Joined Oct 10, 2011
2,919
i would just say to not use good old LM358 for this because it will drive you mad as ambient temperature changes.
for application like this you need OpAmp type that has zero drift. also you ill want all resistors to be metal film, trimpot also need to be cermet.
if you do not believe me, connect carbon resistor to a multimeter than direct hot air at it. do the same with metal film resistor. you are welcome.
 

KeithWalker

Joined Jul 10, 2017
3,197
The choice of simplicity over hi-tech depends on the demands of the application. In this thread, no mention has been made of requirements for temperature range, accuracy, resolution or stability. For the circuit that I posted, the LM138 was a very good choice for the application I used it for.
 

Irving

Joined Jan 30, 2016
4,088
@KeithWalker Your point, and solution, is perfectly valid if price or parts box was in criteria but from info here and other thread that wasn't obvious.

Having said that, I'd counter the simplicity v hi-tech argument with the fact that the MAX 8 pin chips require only 6 connections, no supporting components, no trimming, integral cold junction compensation, minimal software configuration, and direct access to temperature 0-1000C or -270 to +2800C without messing with ADC scaling etc - now that is simplicity!
 

Ian0

Joined Aug 7, 2020
10,293
The measurement range isn't specified. The accuracy is only as good as the cold-junction compensation, which would be done with a thermistor or temperature sensor IC. If the measurement range is within the capabilities of that thermistor or IC , then the thermocouple is pointless!
 

KeithWalker

Joined Jul 10, 2017
3,197
@KeithWalker Your point, and solution, is perfectly valid if price or parts box was in criteria but from info here and other thread that wasn't obvious.

Having said that, I'd counter the simplicity v hi-tech argument with the fact that the MAX 8 pin chips require only 6 connections, no supporting components, no trimming, integral cold junction compensation, minimal software configuration, and direct access to temperature 0-1000C or -270 to +2800C without messing with ADC scaling etc - now that is simplicity!
You make a good point, but the TS is asking for an amplifier to interface to an ATMEGA1280.
 

KeithWalker

Joined Jul 10, 2017
3,197
To all of the above,
The TS asked us a question. He didn't ask for alternative ways to measure temperature or how to achieve maximum accuracy, resolution or stability.
For an answer, I suggest that he looks up and reads: "Simplified Thermocouple Analog Solutions - Microchip Technology"
 

Irving

Joined Jan 30, 2016
4,088
You make a good point, but the TS is asking for an amplifier to interface to an ATMEGA1280.
Agreed, but part of the role of the knowledgable folk on forums like these is to educate newbies in the art of the possible. Just because that's what he asked for doesn't mean that's the right answer. Based on his info here, and on the other thread, its clear he has little in depth idea of what's needed.
 

panic mode

Joined Oct 10, 2011
2,919
i was testing LM358B in a circuit just like that. the B variant is newer and improved spec version.

the goal was to see if low cost standard OpAmp could perform satisfactory and replace some of precision OpAmps. I did not think it would work but it was worth a shot to test it out. if it could work, it could lead to savings due to volume.
the circuit was built and calibrated and it worked great on the bench. for a moment my hopes went up...

but when exposed to temperature changes in was an utter failure. with gain 200-300 even slight ambient temperature change resulted in significant output drift (and even reversal) which was totally unacceptable. it would revert once the temperature is restored but this was clearly not job for LM358. precision opamp with zero drift, low offset was needed. for this job the OPA2186 was found to be pin compatible but far superior and reasonably low cost (only 5x more expensive).
 

Irving

Joined Jan 30, 2016
4,088
Part of the issue for contributors to these forums is to decide whether the TS is asking the right question. If this had started out with "For my coursework I have to design an amplifier to connect a K-type......" we would clearly advise on that and on the key aspects of drift/noise/offset/scaling/etc/etc., without giving all the answers. "I've read that k-type TC need an amplifier to connect to an ADC in a MCU, can you help?" suggests a similar discussion but with more input on the requirement it would be clear that an amplifier might not be the right approach.

But the TS' opening statement was "I'm currently working on a project where I need to interface a K-type thermocouple with an Atmega1280 MCU" followed by the amplifier point. Therefore a non-analog solution is an option and is clearly the right approach until the later qualification was given.

reasonably low cost (only 5x more expensive).
Mouser quote LM358 in PDIP8 at $0.45 or $0.37 in SOIC8, and the OPA2186 is $1.66 but only in SOIC8. The MAX31855 is $7.35, so considerably more expensive, but I'd argue so much easier and effective, even for hobby use.
 
Top