sampling smal DC 0-40mV with Atmega8

Go To Last Post
24 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello; I have searched for a thread for this unsuccessfully but not found, but it should be there somewhere I guess.

 

Here is the issue;

 

What I want to do is measure a K-thermocouple, and sample for table lookup for temperature; the rang is 0-40mV somewhat (reaching owentemp of approx 1000C)

 

First thought was; well should probably use an op-amp; but then I realize that the op-amp wants +Vcc and -Vcc; and I want to work with single rail.

 

(Then I thought I could get away with a "rail-splitter" (got one Ti 2426) but new think Im no better of, since the ground will be difficult to handle, since "psedogroud" cannot

 be connected to AD, since ADground is same (connected internal) as MCUs).

 

So thankful if you have a thinking or reference to how this should (is usually) be done.

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You can get 5V K-thermocouple amplifiers. See if I can find one I was playing with a while ago.

 

edit I think it was one of the TI (old Burr Brown) INA series (125 or 133), I'm pretty sure Maxim has some too.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Mon. Jan 6, 2020 - 09:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can use e.g. TL072 opamp for using it as an single rail circuit.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I would use one of the thermocouple amps, as it takes into consideration the cold junction.

IIRC there is an app note on AVRs and thermocouples as well.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As Jim & John have said, use a thermocouple amp chip - as that includes the cold-junction compensation, etc.

 

Analog Devices is another manufacturer to look at; eg, as shown here:

 

https://www.electronicwings.com/avr-atmega/thermocouple-interfacing-with-atmega16-32  

 

https://www.analog.com/en/products/ad595.html

 

EDIT

 

That particular one is Not Recommended for New Designs (NRND) - but you get the idea.

 

Microchip are also in the game; eg,

 

https://www.microchip.com/wwwproducts/en/MCP9600

 

 

The likes of Sparkfun & Adafruit have a selection of breakout boards for these things - they tend to come with tutorials, examples, etc; eg,

 

https://learn.sparkfun.com/tutorials/max31855k-thermocouple-breakout-hookup-guide

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Mon. Jan 6, 2020 - 10:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Many thanks !

Now only the rest remains; to make a choice (and rest of requirements).

 

Jim;  I had a look at (Im no good at finding...), following as the possible place for ATMEL/MChip AVR appnotes:

 

https://www.microchip.com/wwwcat...

 

the closest/best I found was 682 Single Supply Opamps (will spend some time there), not dedicated for themoC.

 

Also checked the TL072 opamp ; seem Ok but no DIP capsule....?

 

will also have a search for ready made modules ....  (type arduino i guess)

 

oh, and accuracy; somewhere 0.5-1% at top value for the deduced temperature should suffice, but precision is more important

 

(out of step with posts, thanks awneil, will check )

Last Edited: Mon. Jan 6, 2020 - 10:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some of the AVRs have ADCs that have differential inputs with low-voltage ranges.   With one of these you won't need an op-amp to buffer the signal.   But if you do, the common LF358 can run on 5 volts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ahh; LF is a low input LM ?

 

or will LM actually also work, reading spec (again) I find that yes single end should be possible ?  V2-V1 = 40V

sensitivity then 3or7mV... 3mV would work but 7 would loose a bit too much low temp, or do I read Vos (maximum at 25) right .

Last Edited: Mon. Jan 6, 2020 - 11:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://learn.adafruit.com/therm...

 

The link above is a tutorial for a type k thermocouple interface you may find helpful.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also checked the TL072 opamp ; seem Ok but no DIP capsule....?

 

The Texas Instruments TL07xx op-amp comes in many packages, including 8 and 16 pin DIPs.

The TL071 has offset voltage adjustment pins, the TL072 and TL074 doesn't have those pins, but gives one more op-amps / package. 

 

TI Data Sheet: Here.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For thermocouples, no doubt a thermocouple optimized chip is exactly what you need!  If you insist on using an opamp, instead of the decent TL072, there are now many single supply chopper-stabilized amps that are amazingly cheap and have microvolt (or better) offset.  Sadly, they have low bandwidth, but I doubt your temperature is gonna swing around at 8 KHz.  The progress of opamp specs with falling prices is pretty amazing. 

 

A friend of mine uses 50MHz opamps & never gives it a second glance (the equiv of ho-hum, let me pick up some beer & a 2Tb drive while I'm at the speedymart).  I say why are you usng such expensive parts & he says something like they are only 25 cents.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

Indeed, Kartman's link is for a chip that does exactly what the  OP needs. There are really TWO issues here, neither of which is trivial:

 

1. The voltages are low. Few op-amps, even rail-rail ones, really work well with single supply and such low input common-mode voltages. And, those that do still have temperature drifts that can really corrupt the signal at low temperatures (say below 100C). Chopper-stabilized amps can do the stability job and, designed for the task, can handle the common-mode range of the input. But, it still takes care to do a reasonable design.

 

2. COLD JUNCTION. Let me repeat that! COLD JUNCTION. The voltage generated depends on the temperature difference between the warm end of the thermocouple and the cold end. The standard thermocouple tables are based on a cold end temperature of 0C. Anything warmer results in a measurement error. Again, if the measured temperature is below 100C or so, this can be quite significant. In fact, in a typical situation, the error will be on the order of 25C for any warm end temperature. 

 

A thermocouple interface IC, no matter who makes it, will solve both problems. It is a non-trivial exercise to solve both problems with general purpose op-amps and support circuitry. 

 

My recommendation: use a properly designed thermocouple interface IC. Does not make much difference who makes it. What does make a difference, a big difference, is that it is designed for that purpose with proper cold junction compensation.

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want top performance, you also need to take into account parasitic thermocouples on your board, wiring, connectors, etc.  For example, solder to other metals needs to to be carefully balanced out (or you will be making other thermocouples).  Even temperature gradients on your board/enclosure can have small effects.  These other factors may not be your first consideration, just getting something up and running will  be enough of a task.  

 

appendix A has some good tips

Thermocouple voltages are generated whenever dissimilar materials are joined. This includes the leads of IC packages, which may be kovar in TO-5 cans, alloy 42 or copper in dual-in-line packages, and a variety of other materials in plating finishes and solders. The net effect of these thermocouples is “zero” if all are at exactly the same temperature, but temperature gradients exist within IC packages and across PC boards whenever power is dissipated. For this reason, extreme care must be used to ensure that no temperature gradients exist in the vicinity of the thermocouple terminations, the cold junction compensator

 

https://www.analog.com/media/en/technical-documentation/application-notes/an28f.pdf

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Jan 7, 2020 - 07:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK! lots of good inputs.

 

I will "take the easy way out" and skip the learning curve for more intricate analogue design (while some day I would like to get there...)

 

so Ill take a ready solution to get somewhere.

 

As said, the absolute reading is not all that critical, especially in the below 100C range (where I get the cold end becomes more important),

but I guess if I go for a ready made that will come as well.

 

Also found this one while surfing

 

https://www.maximintegrated.com/...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's breakout boards like this one:

https://www.sparkfun.com/product...

 

or this one:

 

https://www.amazon.com/SainSmart...℃/dp/B00PVTH4MW

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Right, thanks!

 

this one though will do (that one is a bit overkill)

 

https://www.aliexpress.com/item/...

 

although, it is AliX and not ama, but guess both are from PRC anyway so.....  :)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You did read that it is not going to make your 1000C level, right????

Looks very interesting, to bad it only does 0-800. would be a lot more interesting if it could do a -100 too.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ahh OK, I only looked at the module; the 6675 is specified for 1200, so I hope it will cope with that, Im going to use another element which is capable of 1000+.

 

Though I have one question left to check; Jim (ka7 :)  above mentioned metal-metal that could mess up things. Some of the elements come with a yellow

plug attached, Q is whether its better to remove the plug and get the leads direct to the module screws..

 

Negative; well what kind of application would go from +1000 to -1000 :)

Last Edited: Thu. Jan 9, 2020 - 01:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If it goes to -1000, there's a strong possibility your sensor or your electronics have failed... :)

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You only need three things to implement accurate TC measurements:

 

1) A good chopper stabilized/zero drift op-amp, maybe spend as much as a dollar on it 8)

2) Cold junction temperature sensor, LM50 or LM60 for example, many options here

3) Charge pump to supply V- to the op-amp (two diodes and two capacitors)

 

Optional, a nice external voltage reference to eliminate the headache of using Avr internal references

 

MCU resources used: 2 analog inputs and one digital output

 

Mount the cold junction sensor "thermally close" to the TC terminal block

 

"Software" can give you linearization and compatibility with any/all thermocouple types

 

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or if that is not the case, possibly I should look up from my screen and have a look at the wonderful alian world I hve been tranlocated to .... :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, thanks ! though I think for the time I will test the 6675 ready made and see what that gives.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Again Tom ;

 

You mention "eliminate the headache of using Avr internal references"

I do think I could have a problem with that in another project, where I switch single reads between to channels, and

see that I have "overhearing" from one to the other but not the other way round.... Will describe more in another  thread.