Assistance needed for Arduino Uno R3 - Thermocouple Simulator

I am looking to try and build a "Type K Thermocouple" simulator. The range I need to test is approx 26 - 900 degrees C. - So I need to be able to output a variable 0mV to 37mV from my Uno.
I've been trying to get to that very small output using a PWN pin and scaling down, but no luck.
At this point I'm assuming I cannot get that resolution with the Arduino. Does anyone have any suggestions?

brin

What you need is a high resolution D to A feature and the Arduino Uno lacks that. The MCP4725 is a popular 12 bit DAC module for use with an Arduino, A Google of "MCP4725 Arduino" should get you started.

Keep in mind what is known as CJC (Cold Junction Compensation) depending on how you plan to go about this. You would do well finding an old L&N 8690 milli-volt pot. Again, depending on your goal keep in mind if you need CJC.

Ron

What you need is a high resolution D to A feature and the Arduino Uno lacks that. The MCP4725 is a popular 12 bit DAC module for use with an Arduino, A Google of "MCP4725 Arduino" should get you started.

0mV to 37mV

The smallest voltage a 12-bit DAC can output is 0.00122 V (1.22mV), however , since you don't need the full scale
output of 5V, you can scale it down using voltage dividers . Since 0 to 50mV would be more than enough, and
50mV is 1/100th of the 5V full scale, you could use a voltage divider of a 100k and 1k to divide the DAC output
by 100. That change the smallest output value to 0.00122/100= 0.0000122 V (12.2uV).

I've been trying to get to that very small output using a PWN pin and scaling down, but no luck.

The should be possible depending on how much resolution you need...

How much resolution do you need? Do you know the input impedance of the amplifier?

But first - [u]PWM[/u] is NOT analog. It can "simulate" analog to control the speed of a motor or to control the apparent brightness of an LED and it CAN be filtered to true analog with a [u]low-pass filter[/u].

Normally, there are a couple of issues with a simple R-C low-pass filter but you've got a couple of things in your favor...

The series resistor in the filter can introduce a voltage drop depending on the impedance of whatever you're connecting to. But, you'll need a [u]voltage divider[/u] anyway and the "top" resistor can be your filter resistor.

The voltage divider resistance should be low relative to the amplifier's input impedance or the input impedance will mess-up your voltage divider calculations. If the amplifier has a known resistance to ground on the input, that can be used for the "bottom" resistor in the voltage divider.

And, the low-pass filter slows-down any changes in the analog voltage. But that's OK since temperature doesn't change that fast anyway.

Arduino PWM has 8-bit resolution. That's 256 analog "steps". So for example, if your full voltage range (0-37mV) represents a 256 degree range (I don't know, that's just a made-up number) you'd have 1-degree resolution.

Bear in mind that the mV output from a thermocouple is not linear ( so you’ll need a table to look at ) and the mV output is dependant upon the difference between the hot and cold junction temperatures - so you may need to know the temperature of the device you are injecting your signal into to calculate temperature simulated .

Thermocouples are low impedance devices , using resistor dividers creates a higher impedance source - you need to check this doesn’t affect the device to which you inject a signal ( probably unlikely - but you need to check).

If you are calibrating devices , then you need some traceable measurements to know the accuracy and stability of your device . ( you could for example use a multimeter to measure your created voltage)

K-type thermocouple table
The problem I see is that a K-type thermocouple has a negative range up to -6mV.
If you omit the negative range, and use only the positive range , then it is 0.000V to 33..275mV
0.033V/4095=8.0586e-6 V (8.05uV)

So each count would be 8.05uV IF you COMPRESS THE FULL SCALE TO 0.033V/5.00V = 1/151th of 5V
This means you would need a divide by 151 voltage divider on the DAC output:

divide by 151 voltage divider
Vo = Vin* R2/(R1+R2)
Let Vo = 0.033mV = 0.000033V = 0.000033
Let Vin = 5.00V
Let R2 = 1000 ohms
then,
0.000033V = 5.00* 1000/(R1+1000)

0.000033V **5.00 1000 5.00 * 1000
------------ = ------ * ** ------------ = ------------

** 1 1 ****(R1+1000) **(R1+1000)

0.000033V 5.00 * 1000
**----------- = ** ------------
** 1 **(R1+1000)

Cross Multiply

0.000033__(R1+1000) = 5.001000__

0.000033__R1 + 10000.000033 __ = 1000*5.00

0.000033__*R1 + 0.033 = 5000__

0.000033__*R1 = 5000-__0.033

4,999.967
R1 = ------------
0.000033

**R1 = **151,514,151 ohms

Proof:
Vo = Vin* R2/(R1+R2)

Let Vo = 0.033mV = 0.000033V = 0.000033
Let Vin = 5.00V
Let R1 = 151514151
Let R2 = 1000 ohms
Vo = 5.00* 1000/(151514151**+1000)**
** = 5000/(151,515,151)
** Vo = 0.000033 V (0.033mV) (maximum K-type thermocouple voltage)

If I read the table correctly, 0.000 degrees = 0.397mV (0.397mV = 0.000397
0.000397/8.0586e-6 V = 49 DAC counts

So, given a voltage divider | where R1 = 151514151 ohms , 1 % , R2 = 1000 ohms , 1%,
and a DAC output of 49 counts (5V/4095= 0.001221/per count)
0.001221 V * 49=0.059829 V
0.059829/151 = 3.9621893926529688119092092602026e-4 V = 0.0003962189 V (~0.000397V = 0.397mV)

Actually I think someone already did all the work.

Thinking about the DAC couldn't we just use a DAC with a low Vref? The 12 bit dac I mentioned uses VCC as the Reference so if I give it a Vcc of 3.3 volts I get 3.3 / 4096 = 0.000805 so about 805 uV steps. Would that work? That assumes a stable reference.

Ron

Thanks for all your responses.
Time to play :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.