RTD temperature Reading
Moderator: Benj
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
RTD temperature Reading
I've found a nice video about the RTD ,it's in two parts please take a look. He used (0°C -150°C)but i think this will be the same with my (0°C - 600°C) with a few changes in numbers and a flowchat can be created with LCD to read temperature from 0°C to around 600°C but the RTD here must be a 3 - wire type.
Part1: https://m.youtube.com/watch?v=J8eS_6PC9 ... LL&index=1
Part2: https://m.youtube.com/watch?v=AXsYHyBuY ... LL&index=2
Part1: https://m.youtube.com/watch?v=J8eS_6PC9 ... LL&index=1
Part2: https://m.youtube.com/watch?v=AXsYHyBuY ... LL&index=2
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RTD temperature Reading
Yes they are very good videos.
In this case you can use the 2,3,or 4 wire versions as only two wires are used.
Not necessarily true.
In this case you can use the 2,3,or 4 wire versions as only two wires are used.
Martin
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
As I was reading, they say a 4- wire is even more accurate and stable but if you say no difference i think we can look at the flowchat and we put this out of the way too ,am very sure people are in their windows waiting for the flowchat and see how things are done this will be good for all of us .Am still looking around for a good RTD datasheet that we can use with a higher Temp range fit for a cake cooker.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RTD temperature Reading
I'm sure you will find it fun creating a flowchart from scratch.
There is enough information in the videos for you to succeed.
Just like a toothless budgie.
If the flowchart does not work as expected , then I would go through it with you.
There is enough information in the videos for you to succeed.
Just like a toothless budgie.
If the flowchart does not work as expected , then I would go through it with you.
Martin
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: RTD temperature Reading
Hi Booth!
Yes, it would be nice with a component in FC8 for the PT100. I have also been search in the web. What I found is the amplifier
Max31865, seem to be good. Honest, I am not able to create a component for this or how I could use the SPI component in FC
To read the max31865.
Have a look here: https://learn.adafruit.com/adafruit-max ... duino-code
Talig, have created a project with the Max31865 by using the spi, but doesn`t work.
viewtopic.php?f=76&t=21640
I dare, (Wish) maybe you could create one a component Martin. If you not have any component I can sent some to you
Br Jorgen
Yes, it would be nice with a component in FC8 for the PT100. I have also been search in the web. What I found is the amplifier
Max31865, seem to be good. Honest, I am not able to create a component for this or how I could use the SPI component in FC
To read the max31865.
Have a look here: https://learn.adafruit.com/adafruit-max ... duino-code
Talig, have created a project with the Max31865 by using the spi, but doesn`t work.
viewtopic.php?f=76&t=21640
I dare, (Wish) maybe you could create one a component Martin. If you not have any component I can sent some to you
Br Jorgen
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
I have converted the code in the video to flowcode which measures Temperature fro 0°C to 150°C, in that when I order for my RTD to measure at least up to 500°C, I will just change some numbers as shown in datasheet for a range of 0°C to around 450 or 500°C. Please take a look at the code and suggest some changes or ways to do it better or even other ways of doing it as that can help people understand this topic well and how things are done in flowchat.
- Attachments
-
- RTDpt100.fcfx
- (19.34 KiB) Downloaded 190 times
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
RTD table with 1° Celsius Increments.
- Attachments
-
- RTDpt100 Temperature Vs Resistance table.pdf
- (88.83 KiB) Downloaded 180 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RTD temperature Reading
I believe the best bet is to wait until you get the hardware,
as you will need to measure two different temperatures to get the slope value.
Then calculation can be derived from that.
We can then go over calculations within flowchart once you have completed voltage measurements.
Finally we can convert Arduino code found here. ie In to a flowchart.
Edit: Re reading your post looks like you have done that.
So when I get a change will go though your flowchart to see if I can see any issues.
as you will need to measure two different temperatures to get the slope value.
Then calculation can be derived from that.
We can then go over calculations within flowchart once you have completed voltage measurements.
Finally we can convert Arduino code found here. ie
Code: Select all
#include <LiquidCrystal.h>
//Variable decleared
float Volts; //voltage read by arduino
float tempC; //final temperature in degree celsius after calibration
float tempF; //final temperature in degree fahrenhiet after calibration
float temp1; //temperatuere before calibration
float calibration; //calibration
float Rx; //Resistance of PT100
// variables that required to convert voltage into resistance
float C = 106.852; //Constant of straight line (Y = mx + C)
float slope = 48.31; // Slope of straight line (Y = mx + C)
// variables that required to convert resistance into temperatures
float R0 = 100.0; //Resistance of minimum temperature to be measured (at 0 degree)
float alpha = 0.00385; // value of alpha from datasheet
//pin assign ment for sensor
int Vin = A0;
//pin assignment for LCD
const int rs = 7, en = 6, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
Timer t; // Define Timer object
//Setup function
void setup() {
Serial.begin(9600); // Set Baudrate at 9600
lcd.begin(16, 2); //Start LCD
pinMode(Vin,INPUT); // Make Vin (A0) pin as input
t.every(100,takeReading); // Take reading of sensor in every 100ms
analogReference(INTERNAL); // Taking internal reference 1.1V ADC of arduino
}
//loop function
void loop() {
t.update(); // Update Timer
}
void takeReading(){
// Bits to Voltage
Volts = (analogRead(Vin)/1023.0)*1.1; //converting bits of voltage into voltage
lcd.setCursor(0, 0);
lcd.print("V:");
lcd.setCursor(4,0);
lcd.print(Volts);
// Converting voltage to resistance
Rx = Volts*slope+C; //y=mx+c
lcd.setCursor(9,0);
lcd.print("R:");
lcd.setCursor(11,0);
lcd.print(Rx);
// Converting resistnace to temperature
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
// conversion of celsius to fehrenheit
tempF = tempC*1.8+32; //Final temperature in fehrenheit
//Serial.println(Volts);
// Serial.println(Rx);
lcd.setCursor(0,1);
lcd.print(tempC);
lcd.setCursor(5,1);
lcd.print((char)223);
lcd.setCursor(6,1);
lcd.print("C");
lcd.setCursor(7,1);
lcd.print(tempF);
lcd.setCursor(13,1);
lcd.print((char)223);
lcd.setCursor(14,1);
lcd.print("F");
Serial.println(tempC);
delay(1000);
}
Edit: Re reading your post looks like you have done that.
So when I get a change will go though your flowchart to see if I can see any issues.
Last edited by medelec35 on Tue Sep 01, 2020 1:11 am, edited 1 time in total.
Reason: Added text at the end.
Reason: Added text at the end.
Martin
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
Thanks Medelec35 that will be great if you go through it and see if there issues but, what happened to our thumbs Ups? Anyways take all your time.Thanks for the good work.
Last edited by Derrihj on Sun Sep 13, 2020 12:10 am, edited 1 time in total.
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
These are my designs am going to use to test this RTD thing. The Amplifier circuit and the control circuit which is also the digital timer with 5 buttons that is DOWN, SELECT, RESET, ENTER and UP button respectively from the left.Now i have to order for the pt100 coz, can't get that here or from my little old store in my workshop problem with Africa here looking for components to use is another thing but am trying.
- Attachments
-
- IMG_20200910_040517_112.jpg (94.82 KiB) Viewed 8464 times
-
- IMG_20200910_040622_761.jpg (84.97 KiB) Viewed 8464 times
-
- IMG_20200910_035839_471.jpg (101.35 KiB) Viewed 8464 times
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
And here is my control board.please don't lough I will get there haha am trying, but I think this will test the code for pt100 came up with these very fast, if there any mistakes will see that when am practically testing.
- Attachments
-
- IMG_20200910_041117_692.jpg (181.75 KiB) Viewed 8463 times
-
- IMG_20200910_041022_852.jpg (232.38 KiB) Viewed 8463 times
Last edited by Derrihj on Sat Sep 12, 2020 10:42 am, edited 1 time in total.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RTD temperature Reading
Nicely designed PCB.
Looks very neat.
What PCB design package did you use?
Looks very neat.
What PCB design package did you use?
Martin
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
Hi Martin i use EASY EDA well as the name clearly shows it's very easy to use, like i said, for PCBs that am going to make at home I don't use a schematic i just go direct for PCB unless am going to send PCB design to China for a professional look and incase of a double sided PCB that is when i draw the schematic.
- Attachments
-
- IMG_20200910_164729_733.jpg (81.62 KiB) Viewed 8429 times
-
- IMG_20200910_121607_534.jpg (90.04 KiB) Viewed 8440 times
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
One at a time then we will test, just finished the siginal amplifier.
- Attachments
-
- IMG_20200911_155515_488.jpg (82.67 KiB) Viewed 8392 times
-
- IMG_20200911_155501_732.jpg (82.4 KiB) Viewed 8392 times
-
- IMG_20200911_155439_057.jpg (87.4 KiB) Viewed 8392 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
RTD temperature Reading
No it's not.
When you changed the reference voltage to 110, that is for simulation purposes only.
Nothing will change on the hardware.
There are two ways of getting the reference voltage.
First is to Change the Vref option to Vref+ Pin.
Then you need a fixed 1.1 volts applied to the external Vref+ external pin (RA3)
You can do that with 2 E24 resistors forming a potential divider.
E.g. 3K9 between +5V and RA3.
1K1 resistor between RA3 & GND.
The second method is to choose Microcontrollers with an internal Vref of 1.1V
The one you're currently using does not have that option.
For example ATMEGA328p.
Other microcontrollers like 12F1822, 16F1823, 16F1824,16F1825, 16F1828 & 16F1829 and the later 16F188XX etc.
Have a Fixed internal voltage reference of:
1.024V which changes 10 Bit ADC resolution to 1.024/1024 = 1mV
2.048V which changes 10 Bit ADC resolution to 2.048/1024 = 2mV
& 4.096V which changes 10 Bit ADC resolution to 4.096/1024 = 4mV
If posted about that here.
Martin
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
Thanks Medelec35, you see, that is the beauty of always asking, now how about PIC18F47K40 coz it's the one am using in my digital timer and RTD temp control and it's the one am going to order because of its size in storage.does it have this internal ref or I have to go the hard way?
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RTD temperature Reading
Yes it does.
To check open the datasheet and search for FVR
The fixed voltages are as above.
You will need to select FVR for the VRef option.
Then you will need to add a C code clock at the start.
If you look at page 544 & 545 of the datasheet, it shows the value of FVRCON register to set Vref to 1.024V.
You need to look at:
Bits 1:0 – ADFVR[1:0] ADC FVR Buffer Gain Selection bit
Its showing a value of 01 for 1.024V
So you can use
Code: Select all
FVRCON = 1;
Martin
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
That means only FVRCON = 1; in C component,should the Vref voltage be changed also if yes to what now from 500 or we leave it at 500? Should i also change the Vref option to FVR for this to work? Edit: and how about the Temperature Indicator Module at the beginning of page 546 is it a point of interest in this project do we need to set up things there too for may be the ADC?
Last edited by Derrihj on Tue Sep 15, 2020 12:58 am, edited 3 times in total.
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
And is there a way we can move this knowledge starting at the 1.1v internal reference that is starting with your reply ("No it not") to the RTD post so that people don't miss out this useful info? So that it gives way for part2 of the thermistor Calc.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
The control board is almost done, am saying almost because you cannot get a pic18f47k40 here in Uganda which is the main target for this project test, same thing for the pt100.
- Attachments
-
- IMG_20200919_102134_332.jpg (87.9 KiB) Viewed 8235 times
-
- IMG_20200919_102149_510.jpg (85.4 KiB) Viewed 8235 times
-
- IMG_20200919_103732_483.jpg (83.18 KiB) Viewed 8235 times
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
More i added the two Blinky leds to give a feel of a second, tick-tack and also to indicate a few on-goings coz most of it is indicated on the LCD.The buttons are DOWN, SELECT, RESET, ENTER and UP buttons from your left hand.
- Attachments
-
- IMG_20200919_101842_655.jpg (92.25 KiB) Viewed 8235 times
-
- IMG_20200919_102016_141.jpg (150.15 KiB) Viewed 8235 times
-
- IMG_20200919_102038_562.jpg (154.76 KiB) Viewed 8235 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: RTD temperature Reading
Looks very good.
If going in to enclosure, would the LCD would be better if its the tallest object?
Powered up yet and showing something on the display?
If going in to enclosure, would the LCD would be better if its the tallest object?
Powered up yet and showing something on the display?
Martin
-
- Posts: 348
- Joined: Mon Jul 09, 2018 12:43 pm
- Has thanked: 67 times
- Been thanked: 33 times
- Contact:
Re: RTD temperature Reading
For enclosure, that LCD is removable and can be put on a LCD bessel mounted on the box cover then run connector wires from the LCD in the bessel to the lcd female header on the control board.
- Attachments
-
- IMG_20200919_153902_622.jpg (70.72 KiB) Viewed 8222 times
-
- IMG_20200919_153913_732.jpg (71.6 KiB) Viewed 8222 times