5
\$\begingroup\$

I want to simulate a temperature PT100 sensor using arduino. What I did till now is on that draw that I attach here. The components were determined by experiments so I guess if there can be some calculations maybe it will improve.

I have a device that reads a PT 100 sensor and if instead the sensor (2 wires model) I wire my device I am able to simulate different temperatures and also I am able to make some sort of calibrations means for example at pwm 163 I get 100 degrees on the device.

My problem is that at some point in time that temperature varies without touching anything. Also there were cases like from a day to another to measure some different temperatures with same setup.

Any idea or hint will be much appreciated

Thanks enter image description here

\$\endgroup\$
8
  • 1
    \$\begingroup\$ Why did you put C21 and C22 directly at the output pin of the controller? This is only bringing load to the ouput. The low pass always needs a resistor in front of the capacitor. \$\endgroup\$
    – jusaca
    Commented May 17, 2019 at 11:02
  • \$\begingroup\$ I just noticed that adding those capacitors decreased variation of temperature. For example without them, with same value of pwm the temp was not constant...was oscilating... \$\endgroup\$
    – lucian_v
    Commented May 17, 2019 at 11:27
  • \$\begingroup\$ Than the cut of frequency of your low pass is not small enough. Remove C21 and C22, increase R30 and C24. What frequency do you use for the PWM? \$\endgroup\$
    – jusaca
    Commented May 17, 2019 at 12:20
  • \$\begingroup\$ You may then also want to introduce a buffer + current limiting resistor to drive the LED. \$\endgroup\$ Commented May 17, 2019 at 12:22
  • 1
    \$\begingroup\$ Do you really need to simulate any arbitrary resistance? I would start with switching in a few resistors with FETs to achieve a few calibration points. \$\endgroup\$
    – sstobbe
    Commented May 17, 2019 at 16:20

3 Answers 3

2
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. A modified circuit for simulation. Note that Q1 is the opto-isolator transistor but has its base connected through as the CircuitLab simulator doesn't have an opto-isolator.

How it works:

  • The PWM turns D1 fully on or off.
  • Q1 turns hard on or off. In general opto-isolators do not do analog transmission well. Much more reliable results are obtained with digital transmission.
  • R3 is set at 250 Ω which is about 400°C on a Pt100. With Q1 turned off you should get a reading of 400.
  • With Q1 on all the time (PWM = 100% duty) R2 will be in parallel with R3 and, neglecting the voltage drop across Q1, the parallel combination of R2 || R3 will be 94 Ω which is a little below 0°C.
  • C1 smooths out the ripple due to the PWM. Bigger is smoother. Higher frequency is smoother.

enter image description here

Figure 2. The simulation result for the values shown in Figure 1.

You can play with the CircuitLab simulation by editing my post and "edit the above schematic". Don't save your changes!

\$\endgroup\$
7
  • \$\begingroup\$ thanks a lot. I will try this asap \$\endgroup\$
    – lucian_v
    Commented May 17, 2019 at 17:14
  • \$\begingroup\$ Please unaccept the answer until you have satisfied yourself that this works. That way you will encourage other (better) answers. \$\endgroup\$
    – Transistor
    Commented May 17, 2019 at 17:16
  • \$\begingroup\$ btw - what should I increase or decrease for have a smaller range of temp? I mean instead 0 - 400 degrees to have 0 - 150 degrees ? Only R3? \$\endgroup\$
    – lucian_v
    Commented May 19, 2019 at 6:01
  • 1
    \$\begingroup\$ R3 sets the maximum resistance. R3 || R2 sets the minimum resistance but watch out for the effect of the voltage drop on Q1. You'll have to experiment. \$\endgroup\$
    – Transistor
    Commented May 19, 2019 at 8:07
  • 1
    \$\begingroup\$ Yes wire resistance will be added to the Pt100 resistance. You can calculate this if you know the wire diameter and length. You can then work out the resultant temperature error from formula, tables or graph. Industrial applications use 3 or 4-wire measurement to eliminate measurement errors. It's not clear why you're doing all of this. The standard way is to use a resistor test box with a rotary switch to switch between fixed resistors for each calibration point. \$\endgroup\$
    – Transistor
    Commented May 20, 2019 at 6:14
2
\$\begingroup\$

Somewhat ironically, your circuit may be sensitive to temperature.

If you look into the EL817's datasheet (the optocoupler's), page 4, figure 3, you'd see a graph of the optocoupler's Current Transfer Ratio (CTR) varying with temperature, and somewhat dramatically at that.

Your circuit relies on the CTR being constant.

\$\endgroup\$
1
  • \$\begingroup\$ Very good point :) is that happen you have some suggestion for a circuit like CTR being constant ? \$\endgroup\$
    – lucian_v
    Commented May 17, 2019 at 12:18
1
\$\begingroup\$

The simplest way would be to use a potentiometer to simulate it.

Look up the datasheet of your PT100 and look at the resistance of the sensor at different temperatures. Then you just simply adjust the potentiometer to those resistances. Easy!

If you want to have the simulation controlled by the Arduino, you can always use a digital pot.

Control a digital potentiometer with Arduino

\$\endgroup\$
6
  • 1
    \$\begingroup\$ I know is working with a pot but the idea is to control that with a code :) \$\endgroup\$
    – lucian_v
    Commented May 17, 2019 at 11:26
  • \$\begingroup\$ Than use a digital pot and control it with the arduino \$\endgroup\$
    – MCG
    Commented May 17, 2019 at 11:48
  • \$\begingroup\$ Digital pots does not support 20mA and get very hot or burn...I tried that way also. Beside that I need to be completely isolated from the device that reads pt100. \$\endgroup\$
    – lucian_v
    Commented May 17, 2019 at 12:13
  • 1
    \$\begingroup\$ Why would you need 20mA? \$\endgroup\$
    – MCG
    Commented May 17, 2019 at 12:51
  • \$\begingroup\$ I don t need, I just noticed when try digital pot that it getting burned at some point...and measured the current through it \$\endgroup\$
    – lucian_v
    Commented May 21, 2019 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.