No video

MAX31865 - Pt100 RTD module

  Рет қаралды 26,242

Curious Scientist

Curious Scientist

Күн бұрын

Пікірлер: 109
@parthmaheshwari3673
@parthmaheshwari3673 Жыл бұрын
Fantastic video, explanation, and details. This helped me figure out that I was missing the dummy bytes in Line 115-116 for my firmware design. An explanation of why we need to use the dummy bytes (with reference to the SPI single-byte read diagram from the datasheet) would be an additional important detail, without which developing the firmware wouldn't be possible. Nevertheless, I was stuck on this for days and your video/code gave me the insight into the root cause. Thank you so much!
@CuriousScientist
@CuriousScientist Жыл бұрын
Thanks! That's why most of the time I try to write my own code instead of using libraries so I can understand the behaviour of the devices. It takes a bit more time, and I usually have to read the datasheet 10-20 times to fully understand it, but after that, I really know what I am doing. I am glad to hear that my in-depth explanation helped you to fix your firmware!
@parthmaheshwari3673
@parthmaheshwari3673 Жыл бұрын
@@CuriousScientist Ah yes same here. I work with MATLAB/Simulink to design firmware so need to know the datasheet very well. Takes a lot of understanding and background knowledge but it's so worth it. In my free time I'm currently trying to design firmware to program a OLED display for a personal project. Do you have any plans to make a similar video explaining the details of OLED registers? Might be of interest to embedded developers who don't want to or cannot use libraries as it is something that's a missing resource. If you are ever looking for ideas for videos, another thing could be picking a sensor and explaining its datasheet in detail. Address registers, data registers, timing diagrams, MSB/LSB, etc. I was planning to do this for an I2C and a SPI sensor. I think it would be much appreciated by the embedded community as the heavy usage of libraries has resulted in all the details being ignored. Would love to know your thoughts too!
@CuriousScientist
@CuriousScientist Жыл бұрын
I have several videos where I wrote "raw code" for certain sensors just by following their datasheet. Mostly temperature sensors, but I have my own code for the HX711 module as well. Also, I think it is safe to say that I have developed the so far best Arduino library for the ADS1256 24-bit AD converter. I made a dedicated page for it on my website, and I have tons of videos on this specific AD converter. I even developed my own PCB for this AD converter. My library and videos on this device cover all the topics you mentioned: timing diagrams, registers, MSB/LSB...etc. Maybe a similar project I have done is based on the TCD1304 linear CCD. But that is not a published code, but it is a step-by-step tutorial on how to write a code. It is also written for STM32 HAL instead of Arduino. On the other hand, I am probably not the best person to develop libraries. I am not a software developer, I just do these things out of my own interest and for my own fun. I have so many other topics where I am much more experienced and knowledgeable, so I would rather spend time with those things. OLED registers are pretty far from my area of expertise.
@parthmaheshwari3673
@parthmaheshwari3673 Жыл бұрын
@@CuriousScientist Thanks for your thoughts! I look forward to checking the videos and resources out that you mentioned, and for your future videos too. Thank you for your services and providing knowledge to all that are interested :)
@markhannibal5434
@markhannibal5434 2 жыл бұрын
Very well explained . Thank you for taking the time to create this video.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Thanks! I am glad that you liked my explanation.
@qzorn4440
@qzorn4440 2 жыл бұрын
very well explained, i have a similar device however it uses modbus rtu rs485 serial communication 😊 thank you
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Thank you, I am glad that you liked my explanation.
@t.l.b6940
@t.l.b6940 4 ай бұрын
thank god i found this , i was going mad , great explenation.
@CuriousScientist
@CuriousScientist 4 ай бұрын
I'm glad to hear that it helped you!
@avadhitrivedi8037
@avadhitrivedi8037 7 ай бұрын
very nice explanation. Thanks a lot ,it really helped.
@CuriousScientist
@CuriousScientist 7 ай бұрын
Thanks! Glad to hear it!
@isidoromaich7226
@isidoromaich7226 3 жыл бұрын
Can you make this thing that I need, the way I need it? Wait, it will be even better if you can build it and send it to me, I can give you a thumbs up, thanks. LOL Now, seriously, excellent video, thanks for the insight on platinum-based thermometers.
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Haha, some requests are ridiculous sometimes. Anyway, Pt100 sensors are really interesting and it's nice to know how they differ from the other type of thermometers.
@emilrudnicki7607
@emilrudnicki7607 2 жыл бұрын
19:11 you need to switch CS high because max wont set config reg to start the conversion, then switch it back to begin reading process
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hey, thank you very much! Now it makes sense.
@gilangardiansyah3711
@gilangardiansyah3711 3 жыл бұрын
I beg you to help me, why is the temperature reading always -242? the connection between the RTD and the max31865 module is just plugged in or soldered?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
I don't know how many more KZbin accounts you will use for asking the same question. Now I assembled the same circuit again, used the same code and I am getting proper temperatures. Did you follow the schematics and the code properly? As I said earlier, if you get -242, it means that the Rt (resistance) was zero. Which also means that something might have gone wrong in the readRegister function. I suspect that there's no communication between the module and the Arduino, so it receives zeroes.
@moazmousad2938
@moazmousad2938 7 ай бұрын
Does the sensor need calibration or just programming ?
@CuriousScientist
@CuriousScientist 7 ай бұрын
If you accept the factory calibration, then just use my code, and that's all. It is good enough for everyday use.
@ekosusanto8556
@ekosusanto8556 7 ай бұрын
very well explained, I have a similar device but I want to make a sensor with copper and nickel, can you explain which parts I should change? This is for my school assignment
@CuriousScientist
@CuriousScientist 7 ай бұрын
Thanks! Sorry, I won't solve your school assignment for you. Also, what do you mean by making a sensor with Cu and Ni? If you are referring to a thermocouple, then it's an entirely different principle as this RTD thermometer.
@ekosusanto8556
@ekosusanto8556 7 ай бұрын
@@CuriousScientist sorry, I didn't mean it like that, and thank you for your reply, so should I use the thermocouple principle? not RTDs?
@CuriousScientist
@CuriousScientist 7 ай бұрын
Well, you still haven't explained how and where the Cu and Ni come into the picture. So I can only repeat what I said before. I am not a wizard, I can not figure things out without the necessary information.
@ekosusanto8556
@ekosusanto8556 7 ай бұрын
@@CuriousScientist I plan to make a temperature sensor with CU and NI, because it is very easy to get at my place, and I plan to use the RTD principle, but after I studied the resistance of CU and NI it is very small than platinum, so can I use the RTD principle to That?
@CuriousScientist
@CuriousScientist 7 ай бұрын
No, you can not use RTD. At least not in an easy way. Why don't you just buy a thermocouple? They are dirt cheap. Or if you must go with the two wires, since they are dissimilar metals, they will act as a thermocouple and you can use them as thermocouples. However, you will need to calibrate it somehow. I am not sure if you can find a lookup table for them. Type T thermocouple is close to it, but it is not the same. It is not pure Cu and pure Ni. It is Cu and Cu+Ni (constantan).
@sanjaybatra6593
@sanjaybatra6593 2 жыл бұрын
My Question is : Suppose you have connected TWO MAX31865 Chip and ONE LCD 16X2 , to ATMEGA328P. These devices can share few common ATMEGA328 pins like MISO, MOSI, CS, SCK etc etc 1. MAX31865 pins (10, 11, 12, 13 ) 2. MAX31865 pins (10, 11, 12, 13 ) ???? 3. MISO/rs=12, MOSI/en=11, d4=5, d5=4, d6=3, d7=2; How do we will allocate pins to different devices ??
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hi! You just need to follow the rules of SPI. MISO, MOSI, SCK is shared and each chip has its own CS (chip select) pin. Then you just select one of the chips by reaching out to it via its CS pin. The LCD cannot use these pins as typically they are sold with a presoldered i2c board. The 16x2 LCD would use the SDA (A4) and SCL (A5) on an Arduino Uno/Nano.
@sanjaybatra6593
@sanjaybatra6593 2 жыл бұрын
@@CuriousScientist thanx for quick and fast response. what I understand is : MISO, MOSI, SCK can be common to multiple devices but each device has its own CS pin to make device active when required. we can also use multiplexer ?
@CuriousScientist
@CuriousScientist 2 жыл бұрын
@@sanjaybatra6593 Yes, MISO, MOSI and SCK is shared between multiple SPI devices and the active device (as the name suggests) is selected by the chip select (CS) pin. There is no need for multiplexing SPI pins.
@ezz6928
@ezz6928 Жыл бұрын
first of all thank you so much for this incredible work you're doing! I would really appreciate if you could take a look at this problem: I have the same components but I use a different board: Board: NUCLEO-F767ZZI + MAX31865 + PT100 (4 wires) here is the code I wrote based on your video: #include "mbed.h" #include #include #include SPI spi(PB_5, PB_4, PB_3,PA_4); DigitalOut cs(PA_4); double resistance; uint8_t reg1, reg2; // reg1 holds MSB, reg2 holds LSB for RTD uint16_t fullreg; // fullreg holds the combined reg1 and reg2 double temperature; // Variables and parameters for the R - T conversion double Z1, Z2, Z3, Z4, Rt; double RTDa = 3.9083e-3; double RTDb = -5.775e-7; double rpoly = 0; int main() { while (true) { //spi.lock(); spi.format(8, 1); spi.frequency(1000000); cs = 0; spi.write(0x80); // 80h = 128 - config register spi.write(0xA0); // B0h = 10100000bias ON, 1-shot, start 1-shot, rest are 0 cs = 1; cs = 0; spi.write(1); // we want to read the first register reg1 = spi.write(0xFF); // dummy data: read part 1 of the first register reg2 = spi.write(0xFF); // dummy data: read part 2 of the first register cs = 1; // combinate reg1 and reg2 fullreg = reg1; // read MSB fullreg = 1; // shift D0 out resistance = fullreg; // pass the value to the resistance cs = 0; spi.write(0x80); // 80h = 128 spi.write(144); // 144 = 10010000 //spi.unlock(); cs = 1; printf("Temp=%f ", resistance); } } At first I only want to read the RTD resistance (ADC CODE) measured by MAX31865. However, I’m getting a value of 27300, where it should be around 8900 based on table 9 (source: MAX31865 datasheet). Which means my temperature values after the conversion will surely be false as well. do you have any ideas about this? best regards, ezz
@ezz6928
@ezz6928 Жыл бұрын
I just solved the problem by changing this line " spi.write(144);" to " spi.write(160);" 160 = 10100000, which matches my 4-wire config but did you actually use 144 and not 176 = 10110000?
@CuriousScientist
@CuriousScientist Жыл бұрын
@@ezz6928 Yeah, I guess it is very useful if you use the code according to your configuration. :) I clearly explained the value of that register @18:30 . If you have 2/4-wire config, D4 must be 0.
@eng1897
@eng1897 3 жыл бұрын
thank you so much ,, excuse me I have a question do RTD need special wire?? or just wire ordinary??
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi and you are welcome! I don't exactly understand the question. The specific Pt100 probe I used came with the wire as well. But if you have a Pt100 probe somewhere laying around without any cables, technically you can use any wires. Thank to the method how the module measures the resistance change of the Pt100 probe, the resistance of the wires are cancelled out. Nevertheless, I recommend using some good quality wires, just to be sure.
@rodrigodebenavente8870
@rodrigodebenavente8870 2 жыл бұрын
Hi. I made it work. However, after the first set of measurements, the device sends random symbols. I'm looking at it through the serial monitor and I can't figure out where the problem is. By the way, I used the same code without modifications, to see if the system worked. I would really appreciate if someone could give me a hand.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hi! Do you use the _exact_ same setup? Same hardware and so on? I haven't noticed this issue so I cannot really imagine the cause of it. Do you have the same baud rate on the terminal as in the code?
@karuicote7129
@karuicote7129 4 ай бұрын
Can you explain for me mean of "max.temperature(RNOMINAL, RREF)" please?
@CuriousScientist
@CuriousScientist 4 ай бұрын
Hi! Where do you see that in my code? I cannot find it.
@karuicote7129
@karuicote7129 4 ай бұрын
​@@CuriousScientist Sorry for the confusion, but may I ask why you don't use max.temperature(100,430);(it contain in max31865 library) instead of using mathematical calculations 2 ways have diffrent?
@CuriousScientist
@CuriousScientist 4 ай бұрын
@@karuicote7129 I wrote my own code, I am not using any library. 😎
@pengejarcitacita
@pengejarcitacita 10 ай бұрын
Thanks for the explanation I want to ask you something. I did the same thing with you, but the temperature measurement by the RTD Sensor is always 9.38 and Resistance is always 32640 doesn't change at all, what do you think is wrong? maybe you can provide a solution. thank you.
@CuriousScientist
@CuriousScientist 10 ай бұрын
Hi! Are you using the _exact same_ configuration? What does the probe look like? 2, 3 or 4 cables? Is the module set up accordingly?
@rustamefendi2701
@rustamefendi2701 8 ай бұрын
Can we make data logger? I have problem when I input #Include , can't work
@CuriousScientist
@CuriousScientist 8 ай бұрын
It can be made into a data logger with an SD card, sure. I don't know why it is not working for you.
@teknikmesinunsultra5009
@teknikmesinunsultra5009 8 ай бұрын
Thank you@@CuriousScientist. I've encountered a problem; the issue is that the 0.96-inch OLED display doesn't work when combined into a data logger. The hardware I'm using consists of two Adafruit MAX31865 amplifiers, a Data Logger Shield (equipped with an RTC and an SD card module), and a 0.96-inch OLED display. The OLED display doesn't function, so I replaced it with a 16x2 character LCD display.
@CuriousScientist
@CuriousScientist 8 ай бұрын
It is good to hear that you were able to make it work with a 16x2 display. Actually, they are faster than the OLED, so if it works for you well, then perhaps it is even a better choice.
@khadijalahrouni5386
@khadijalahrouni5386 Жыл бұрын
Hello every one, please I need to use the max31865 with a raspberry pi 3 B + and I don't have any idea on how to do so, I'm new to this . if anyone could help I would appreciate it. thank you
@CuriousScientist
@CuriousScientist Жыл бұрын
Hi! Search for it on Google.
@hardikshah1792
@hardikshah1792 3 жыл бұрын
Hi. I want to use 6 pt100 3 wire all together. What should I do further? Can you please help in coding and connecting circuits
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi! Since it is a standard SPI circuit, you just connect all of them to the same MOSI, MISO and SCLK pins and assign separate CS pins for each one of the 6 Pt100 units. Then, whenever you pull one of the CS pins low, the corresponding unit will start to communicate with the microcontroller. After the reading is finished, you pull the CS high and select another Pt100 unit by pulling its CS low. You can do this in a loop, store the values in an array and just iterate through the 6 pins and array items. I hope this helps.
@hardikshah1792
@hardikshah1792 3 жыл бұрын
@@CuriousScientist Yes. I can do that, can you please give me your email so I can send email if any query regarding code?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
I am not a free support service. I am sorry but I am not doing consultation for free.
@cringecorner6828
@cringecorner6828 8 ай бұрын
i want to ask tho, how do you read the resistance changes in a digital pin?
@CuriousScientist
@CuriousScientist 8 ай бұрын
You don't. The module passes some known current through the probe and then measures the resulting voltage. Then this voltage is used to calculate the probe's resistance.
@adhibanr6479
@adhibanr6479 Жыл бұрын
Sir is it possible to measure the temperature by using ESP32 , PT100 , MAX 31865 these three (Without using arduino) by using MicroPython Sir ?
@CuriousScientist
@CuriousScientist Жыл бұрын
Of course.
@jameswarren1831
@jameswarren1831 2 жыл бұрын
Is it possible to connect 2 Max31865's to one Arduino controller? Is there any chance you might make a video with the MAX31865 with a PID output for use with an SSR? There might be some interest as the only project I found was a PWM output for a smoker.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Yes, it is possible. It is an SPI device, so you can use multiple of them. Unfortunately, I don't know what SSR is. Also, I don't make videos on request for free because my schedule is very limited.
@JnanaPhaniAmbadipudi
@JnanaPhaniAmbadipudi 4 ай бұрын
18:16:52.927 -> Resistance: 0.00 18:16:52.927 -> Temperature: -242.02 But when I run your code I'm getting this kind of output
@CuriousScientist
@CuriousScientist 4 ай бұрын
Do you use the exact same hardware?
@JnanaPhaniAmbadipudi
@JnanaPhaniAmbadipudi 4 ай бұрын
@@CuriousScientist Yes
@CuriousScientist
@CuriousScientist 4 ай бұрын
How about the PT100? Which wire configuration do you use? Did you modify the board accordingly?
@JnanaPhaniAmbadipudi
@JnanaPhaniAmbadipudi 4 ай бұрын
Yes I’m using 3wire PT100
@CuriousScientist
@CuriousScientist 4 ай бұрын
Did you also make the solder bridge I show at 6:07?
@hardikshah1792
@hardikshah1792 3 жыл бұрын
Can you please make 4 channel pt100 data logger??
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Why do you ask the same question again? As I said it under the other video, if you buy me all the components, I am glad to make one and present it.
@semsettinsevinc8807
@semsettinsevinc8807 2 жыл бұрын
hi I have arduino klon ch340 . I would like to have temperature controlled relay activation project. I am very new about arduino. I have max31865 + 2 wire PT100 thermokupl + OLED display + SRD 05VDC SLC relay. How can I connect them and should I use any capacitors and resistance.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Hi! There is no need for extra components like capacitors and resistors.
@semsettinsevinc8807
@semsettinsevinc8807 2 жыл бұрын
@@CuriousScientist thank you. should I connect 2 wire PT100 red cable RTD and white cable RTD - on MAX31865. and MAX31856 VIN ; GND ; 3V3 ; CLK ; SDO ; SDI ; CS ; RDY where should I connect on arduino.
@semsettinsevinc8807
@semsettinsevinc8807 2 жыл бұрын
red cable RTD (+) white cable RTD (-)
@CuriousScientist
@CuriousScientist 2 жыл бұрын
Everything is explained in the video, why don't you watch it?
@sanjaybatra6593
@sanjaybatra6593 2 жыл бұрын
which device more reliable ? PT100 or ds18b20 (waterproof ) PT100 can be replaced with ds18b20 ? Actually MAX31865 is not easily available.
@CuriousScientist
@CuriousScientist 2 жыл бұрын
You can't even compare them. Pt100 is a much more superior thermometer by design. Better precision, better temperature range, better response time...etc. DS18B20 is a semiconductor-based thermometer. It has it's own advantages, but since you asked which is more reliable, I say Pt100 is easily much-much more reliable.
@sanjaybatra6593
@sanjaybatra6593 2 жыл бұрын
@@CuriousScientist thanx a lot sir
@CuriousScientist
@CuriousScientist 2 жыл бұрын
You're welcome!
@maharanisinta3279
@maharanisinta3279 3 жыл бұрын
if i have an RTD with 2 blue wires and 1 red wire will the connection to max31865 stay the same?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Probably yes. But I would recommend checking the resistance between the wires. One pair should be somewhere around 102 Ohm and the other pair should be 2 Ohm. Then you can connect them accordingly. I also recommend you to check Adafruit's tutorial on this topic as they have really nice explanations and a lot of pictures.
@maharanisinta3279
@maharanisinta3279 3 жыл бұрын
@@CuriousScientist I've measured it and it's 102 Ohm and 2 Ohm, but I don't know which pair it should go to
@CuriousScientist
@CuriousScientist 3 жыл бұрын
The 2 Ohm part goes to F+ and RTD+, and the third wire goes to RTD-.
@maharanisinta3279
@maharanisinta3279 3 жыл бұрын
@@CuriousScientist okay sir, thanks for your help
@CuriousScientist
@CuriousScientist 3 жыл бұрын
You're welcome! I hope it works now.
@Johann75
@Johann75 7 ай бұрын
What is the reading speed?
@CuriousScientist
@CuriousScientist 7 ай бұрын
It is in the datasheet of the chip. Google it.
@Johann75
@Johann75 7 ай бұрын
@@CuriousScientist , for max31865 max. 21ms and for max6675 from 100 to 230 ms average 170
@alinaasyari9846
@alinaasyari9846 3 жыл бұрын
Thanks for the explanation I want to ask you something. I did the same thing with you, but the temperature measurement by the RTD Sensor is always -242 and doesn't change at all, what do you think is wrong? maybe you can provide a solution. thank you.
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Hi and welcome! If you receive -242, then the number received from the module is zero. Somewhere something is wrong with the connection. Check with some extra serial.println() if there is reading coming from the module.
@alinaasyari9846
@alinaasyari9846 3 жыл бұрын
@@CuriousScientist I have done it and still no change. I'll check the connection again. Thank you for the help
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Did you connect the RTD properly? If it is connected wrong or not connected at all, you also get -242.
@alinaasyari9846
@alinaasyari9846 3 жыл бұрын
@@CuriousScientist Does this mean there is no problem in adafruit but in RTD connection? I connected the first blue wire to F+, the second blue wire to RTD+ and the red wire to RTD-, is this correct?
@CuriousScientist
@CuriousScientist 3 жыл бұрын
Theoretically, it is correct, but you should always measure the resistance values between the pins to make sure you connect them where they belong. Sometimes color coding is not reliable. Also I hope you soldered the 2/3 wire tab and cut the other tab and soldered it too. Next to the flower print on the pcb.
10-channel thermistor-based temperature logger with display and SD card
1:07:09
Box jumping challenge, who stepped on the trap? #FunnyFamily #PartyGames
00:31
Family Games Media
Рет қаралды 32 МЛН
WHO CAN RUN FASTER?
00:23
Zhong
Рет қаралды 41 МЛН
MAX31855 - A better thermocouple module
43:15
Curious Scientist
Рет қаралды 5 М.
การใช้งาน RTD PT100
45:31
Multi-Skilled for Automation
Рет қаралды 6 М.
DC motor position control using PID
43:23
Curious Scientist
Рет қаралды 74 М.
RTD Measurement Circuits
25:01
Texas Instruments
Рет қаралды 2 М.
PT100 vs PT1000 RTD Sensors: What's the Difference?
2:56
DwyerOmega
Рет қаралды 11 М.
Measuring Temperature with Arduino - 5 Sensors
29:55
DroneBot Workshop
Рет қаралды 141 М.
Arduino, Thermocouples, MAX6675 and SPI - The Fine Points
37:34
Robert's Smorgasbord
Рет қаралды 28 М.
Pt100 Sensor Explained | Working Principles
8:30
RealPars
Рет қаралды 374 М.
Producing double sided PCB with UV Resist Method
29:35
NA5Y
Рет қаралды 3,8 М.
Box jumping challenge, who stepped on the trap? #FunnyFamily #PartyGames
00:31
Family Games Media
Рет қаралды 32 МЛН