PT-100

Status
Not open for further replies.

MisterBill2

Joined Jan 23, 2018
27,519
Bill,
I am fully aware of the limitations of the simulation,
The TS states his circuit does NOT WORK, I am trying to help him understand why .!
He is also aware he cannot have a zero Vout.

What is the point of your post?
The points of the post were that first, it is not a circuit issue, but rather somehow an implementation issue. That means that if the circuit as built does not work, that it is somehow not the same as the presented circuit,while if it does not function perfectly, there are a number of normal variations in real world construction that will certainly cause variations in performance. I admit that I did not directly state thatthe TS should check for errors in construction or failed components.

The comment about the second supply voltage was a means of allowing the output to be set to zero when the sensed temperature was zero. That was in response to the comment that a zero voltage output could not be achieved with the circuit and components used. It is a method that I have used in the past, although it was with PT RTD device interface circuits that were more complex. It was a common scheme at the time, it works well.
 

ericgibbs

Joined Jan 29, 2010
21,442
Bill,
The TS stated I have used the lm358 but it didn't work

By using a simulation

The LTSpice simulation I posted shows that that the circuit does work, if built correctly, this will give the TS confidence that the actual circuit is viable.

Also, it can highlight the detrimental effect of those large capacitors.

So please stop rubbishing simulations.

E
 

Thread Starter

warmachine

Joined Jul 24, 2021
35
Hi warm,
This is simulation using the PT100 formula.
Note: R6 and R3 are 3k3 in first simulation

E
View attachment 301674View attachment 301676
I have tried the same but OP of gain stage is kind of constant at different RTD values ( I check for 100 and 150 ohms )


Sketch
C-like:
float Volts; //voltage read by arduino

float tempC; //final temperature in degree celsius after calibration

float temp1; //temperatuere before calibration

float calibration; //calibration

float Rx; //Resistance of PT100

float C = 106.0; //Constant of straight line (Y = mx + C)

float slope = 48.61; // Slope of straight line (Y = mx + C)

float R0 = 100.0; //Resistance of minimum temperature to be measured (at 0 degree)

float alpha = 0.00385; // value of alpha from datasheet

int Vin = A0;

void setup() {

  Serial.begin(9600);

  pinMode(Vin, INPUT);

  analogReference(INTERNAL); // Taking internal reference 1.1V ADC of arduino

}


//loop function

void loop() {

  takeReading();

  delay(150);

}


void takeReading() {

  Serial.print("analog Reading: ");

  Serial.print(analogRead(Vin));

  Volts = (analogRead(Vin) / 1023.0) * 1.1; //converting bits of voltage into voltage

  Serial.print("  Volts : ");

  Serial.print(Volts);

  Rx = (Volts * slope) + C; //y=mx+c

  Serial.print("  resistance   : ");

  Serial.print(Rx);

  temp1 = (Rx / R0 - 1.0) / alpha; // from Rx = R0(1+alpha*X)

  calibration = 0.3 + (0.005 * temp1); //tolerance for class B PT100

  tempC = temp1 - calibration; // Final temperature in celsius

  Serial.print("  Temp  : ");

  Serial.println(tempC);


}
 

Attachments

Last edited by a moderator:

Thread Starter

warmachine

Joined Jul 24, 2021
35
The points of the post were that first, it is not a circuit issue, but rather somehow an implementation issue. That means that if the circuit as built does not work, that it is somehow not the same as the presented circuit,while if it does not function perfectly, there are a number of normal variations in real world construction that will certainly cause variations in performance. I admit that I did not directly state thatthe TS should check for errors in construction or failed components.

The comment about the second supply voltage was a means of allowing the output to be set to zero when the sensed temperature was zero. That was in response to the comment that a zero voltage output could not be achieved with the circuit and components used. It is a method that I have used in the past, although it was with PT RTD device interface circuits that were more complex. It was a common scheme at the time, it works well.
Hello MisterBill2,
Do you have any suggestions to improve the circuit or Code
as for now, I am playing with slope and C values for different voltage and resistance
 

Thread Starter

warmachine

Joined Jul 24, 2021
35
hi warm,
Your sketch works on my setup using a variable input resistor, over the range 0Vadc to 1.1Vadc..
What is the voltage range on the Vadc input on your circuit?
E
Hello ericgibbs,
hi warm,
Your sketch works on my setup using a variable input resistor, over the range 0Vadc to 1.1Vadc..
What is the voltage range on the Vadc input on your circuit?
E
Hello ericgibbs,
Circuit and Code perform well at your end?
if yes then i think ADC of my arduino may not working.
bcz Vadc range of my setup is 0-1.1V
 

ericgibbs

Joined Jan 29, 2010
21,442
Hi warm,
Using a multi-turn pot this my result from 0v to 1.1v
I have adjusted your constants to suit.
Check the resistance versus tempr, over the range 0C to 150C
Remove the .txt extension to run this sketch.
E
EG57_ 1105.png
 

Attachments

Thread Starter

warmachine

Joined Jul 24, 2021
35
Hi warm,
Using a multi-turn pot this my result from 0v to 1.1v
I have adjusted your constants to suit.
Check the resistance versus tempr, over the range 0C to 150C
Remove the .txt extension to run this sketch.
E
View attachment 301747

Hello ericgibbs,
right now i don't have Hardware but in simulation i got weird responce at 150 Ohn it is again shows 102 ohm or something
 

Attachments

MisterBill2

Joined Jan 23, 2018
27,519
Hello MisterBill2,
Do you have any suggestions to improve the circuit or Code
as for now, I am playing with slope and C values for different voltage and resistance
For using an actual Pt RTD device that has the our connections, +exe, + sense, -Sense, and -exe. The reason is that the connection wire resistance changes with temperature, but with the current excitation on it's own set of wires, that resistance change will have no effect on the voltage measures by using the SENse wires. The other change is to use a current regulator to provide a constant current through the PT resistance.That is how it is done in applications where the measurement must be accurate,
 

ericgibbs

Joined Jan 29, 2010
21,442
Hi warm.
Which simulator are you using?

Do you have a 10k or 5k potentiometer, if yes, then
Connected one end of the pot to the +3.3v on the UNO and the other end of the pot onto GND of the UNO.
The centre wire on the pot is connected to A0 on the UNO.
Adjust the pot to give a 0V on the A0 pin, the Arduino IDE Serial display should read approx 0 on the ADC count.
Slowly adjust the pot up +1v [remember the maximum ADC input will be +1.1v, when using the UNO internal Vref ] the Serial display should show a count of close to 1023

Post your results. [ copy from the IDE Serial listing]
Do you have a photo of the project that you could post?

When using LTSpice always post your asc file

If you suspect that UNO A0 ADC pin is damaged, change the pot wiring to A1 and also edit the int Vin = to A1

E
 

ericgibbs

Joined Jan 29, 2010
21,442
right now i don't have Hardware but in simulation i got weird responce at 150 Ohn it is again shows 102 ohm or something
Hi warm,
Checking the sim using your data at 150 Ohm, you are just over the ADC voltage limit when using the ADC internal Vref of +1.1V.
This is what I see at 150 Ohm, note the ADC input voltage, it is at the limit of +1.106v !
This is also shown in the IDE Serial listing.

E
EG57_ 1107.png
 

Attachments

Thread Starter

warmachine

Joined Jul 24, 2021
35
Hi warm.
Which simulator are you using?

Do you have a 10k or 5k potentiometer, if yes, then
Connected one end of the pot to the +3.3v on the UNO and the other end of the pot onto GND of the UNO.
The centre wire on the pot is connected to A0 on the UNO.
Adjust the pot to give a 0V on the A0 pin, the Arduino IDE Serial display should read approx 0 on the ADC count.
Slowly adjust the pot up +1v [remember the maximum ADC input will be +1.1v, when using the UNO internal Vref ] the Serial display should show a count of close to 1023

Post your results. [ copy from the IDE Serial listing]
Do you have a photo of the project that you could post?

When using LTSpice always post your asc file

If you suspect that UNO A0 ADC pin is damaged, change the pot wiring to A1 and also edit the int Vin = to A1

E
Hello ericgibbs,
Yes by simply connect pot to ADC it's working.
But in circuit I have attached earlier the OP of gain stage is not changing as I change the resistor value ( i.e 100 to 150 ohm ).
Please review my circuit.
https://forum.allaboutcircuits.com/attachments/untitled-1-pdf.301742/
 

MisterBill2

Joined Jan 23, 2018
27,519
What I do not see on the link circuit is a common connection, I only see the opamp output connection. Therealso needs to be a commonconnection between the micro and the analog portion. That might be the problem.
 

ericgibbs

Joined Jan 29, 2010
21,442
hi warm,
With your circuit 3k3 the gain is increased so Vout at 150 Ohm will be approx 3.9V, so when you use the ADC internal Vref at 1.1v you will have a problem.
If you must use the Vref = 1.1v you have use 10k's.
Also, due to powering the OPA with a single voltage you will have an offset voltage on Vadc input of between 0.2v and 0.4v which you have to correct for in the Sketch.
Then use the calibration constants to give a voltage span of 0V through 1.1V.

Do you follow that OK

Decide which Vref you are going to use?
Decide which resistors 3k3 or 10k
Measure the Vadc input at 100 Ohms

Post those values and I will post a new sketch.

E
EG57_ 1109.png
 

Thread Starter

warmachine

Joined Jul 24, 2021
35
hi warm,
With your circuit 3k3 the gain is increased so Vout at 150 Ohm will be approx 3.9V, so when you use the ADC internal Vref at 1.1v you will have a problem.
If you must use the Vref = 1.1v you have use 10k's.
Also, due to powering the OPA with a single voltage you will have an offset voltage on Vadc input of between 0.2v and 0.4v which you have to correct for in the Sketch.
Then use the calibration constants to give a voltage span of 0V through 1.1V.

Do you follow that OK

Decide which Vref you are going to use?
Decide which resistors 3k3 or 10k
Measure the Vadc input at 100 Ohms

Post those values and I will post a new sketch.

E
View attachment 301775
Hello ericgibbs,
I am using 10K & 1.1V Vref i have attached the OP for 100 and 150 ohm test case
 

Attachments

ericgibbs

Joined Jan 29, 2010
21,442
Hi warm,
Looking over your 150R test and the fact you are using LM358, with a single 5V supply, I don't see how you can measure +0.0475Volts at the ADC input, there is a problem with your simulator.??

Have you tried measuring the final OPA Vout when the ADC A0 is not connected?

E

EG57_ 1110.png
 

ericgibbs

Joined Jan 29, 2010
21,442
Hi warm,
This is the 150R circuit using LM358, it works OK.
E

Note: as I had said before any Vout to the ADC over +1.1V will always give 1023 ADC counts, due to using the Internal Vref of 1.1v


EG57_ 1111.png
 
Status
Not open for further replies.
Top