How to get realtime pt100 sensor data wirelessly

Hello,
I am trying to get realtime data from pt100 sensor (Resistance and Temperature) wirelessly. I do have adafruit31865, Arduino UNO WiFi Rev2 to get data connecting to the computer. But I want to do this wirelessly. I also have ESP 8266 (ESP-12E) for that matter.
Can anyone suggest me how to do the same.
PS: I am a complete newbie to this world. Could you please give me source code with wiring too?
Thanks,
Suhas

it all depends what you mean by 'realtime', e.g. every 10microseconds, every second, every 10seconds, etc etc???
how 'realtime' you require tends to depend on what you are sensing and how fast it changes
also the internet is not suitable for very fast realtime as thruput time depends on traffic, signal strength, cable bandwidth, etc

have a look at esp8266-nodemcu-web-server-sent-events where a web client is updated at regular intervals

also have a look at Measuring-Temperature-Using-a-PT100-and-an-Arduino

Does that make sense?

There will be examples for the Wi-Fi and connecting your RTD -study those and have a go !

You might want to look at DS18b20 as an easier temperature measurement device to use .

The problem here is, I also want to record that data, assume 3 times every second. Is that possible?

All those examples are to update the data. I want to record the data too.
If you did go through some example like this, please do share.

And pt100 sensor is more sensitive and accurate to small changes in the temperature too. So I am using the same

if you are communicating with a server on a local network 3 times/second should be no problem
how do you wish to store the data? e.g. have a look at Sending-data-from-Arduino-to-Excel-and-plotting-it
if you are using an internet based server 3 times/second may be possible - probably depends on the servce you are using

Is it possible to do that without internet and just wifi?

yes, assuming you local PC has WiFi and is in range the Arduino can send it data 3 times/second - see the reference in post 7 to storing received data using excel
can you give more details of your project? in particular what you wish to do with the received data

But, here we wont be able to get the serial monitor response as the arduino is not connected to computer directly.

I just want to get the temperature readings (and store them) of the fluid using a pt100 probe somehow on my computer wirelessly.

Thats the whole description.

is the Arduino in a remote location without a host computer?
if necessary you can transmit the data you would send to the serial monitor over WiFi to the server PC for display
think you need to tell us more about what you are attempting to do
have a read thru how-to-get-the-best-out-of-this-forum

Okay, here is the best I can describe.

I have a laptop with Wifi connection. I also have an Arduino UNO WiFi Rev2 and an ESP8266. I have a Wifi router without internet connection. A pt100 temperature sensor with adafruit 31865. I want the microprocessor to connect to wifi (which I already have) and my laptop is also connected to the same wifi. I tried to connect esp8266(on which pt100 is connected with adafruit) in a station mode to wifi and perform OTA to get data of the temperature sensor on my serial monitor of my laptop. But later that I get to know that without hardware connection, I cannot get data on to the serial monitor.
So, now I am trying to know other methods to get the data so that I can get the data without a wired connection of arduino to my laptop.
In one line I want to get temperature data without hardare connection of my laptop to arduino.

can you read temperatures from the pt100 OK on the laptop?
which micro is the pt100 connected too? the Uno or the ESP8266?
why do you require two microcontrollers?

Yes, when I connect arduino or esp to my laptop , then I am getting good results.
When I connect my arduino or esp (either of them) to pt100, then it is completely fine.
The reason I got two microcontrollers is that initially I started with uno but OTA cant be done with uno. then I tried with esp then it was successful.
I am just letting you know my options.

I suggest connecting the pt100 to the ESP8266 and forgetting the UNO and all the complication of inter process communications
initially try some basic ESP8266 WiFi communications, e.g.

  1. modify the esp8266-nodemcu-web-server-sent-events to present you pt100 on a web page
  2. send pt100 data to an Excel spreadsheet

this will give you some idea of your options

Will try and report back to you

Okay here goes the update:

I have successfully uploaded the temperature data on a server which refreshes every one second and posts the new temperature refreshing the whole page.
I now want the previous temperature to stay there and update my new temperature on the next line with time stamp. Like what serial monitor does. Could you please help me with that?

Here is the code which I developed:


const int refresh=1;// second
#include <Adafruit_MAX31865.h>

// Use software SPI: CS, DI, DO, CLK
Adafruit_MAX31865 thermo = Adafruit_MAX31865(16, 5, 4, 0);
// use hardware SPI, just pass in the CS pin
//Adafruit_MAX31865 thermo = Adafruit_MAX31865(10);

// The value of the Rref resistor. Use 430.0 for PT100 and 4300.0 for PT1000
#define RREF      430.0
// The 'nominal' 0-degrees-C resistance of the sensor
// 100.0 for PT100, 1000.0 for PT1000
#define RNOMINAL  100.0
double temperature;
//Variables and parameters for the R - T conversion
double Z1, Z2, Rt;
double RTDb = 0.393691366143317;//3.9083e-3;
double RTDa = -1.46475667019033e-04;//-5.775e-7;
double RTDc = 100.161029347726;
float tValue;

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>

#ifndef STASSID
#define STASSID "TP-Link_1778" // Your WiFi SSID
#define STAPSK  "95096636" //Your WiFi password
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

ESP8266WebServer server(80);


void sendTemp() {

  String page = "<!DOCTYPE html>\n\n";
  page +="    <meta http-equiv='refresh' content='";
  page += String(refresh);// how often temperature is read
  page +="'/>\n";  
  page +="<html>\n";
  page +="<body>\n"; 
  page +="<h1>Wireless temperature </h1>\n";    
  page +="<p style=\"font-size:50px;\">Temperature<br/>\n";  
  page +="<p style=\"color:red; font-size:50px;\">";
  page += String(tValue, 8);
  page +="</p>\n";  
  page +="</body>\n";  
  page +="</html>\n";  
 server.send(200,  "text/html",page);

}

void handleNotFound() {
 
  String message = "File Not Found\n\n";
  message += "URI: ";
  message += server.uri();
  message += "\nMethod: ";
  message += (server.method() == HTTP_GET) ? "GET" : "POST";
  message += "\nArguments: ";
  message += server.args();
  message += "\n";
  for (uint8_t i = 0; i < server.args(); i++) {
    message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
  }
  server.send(404, "text/plain", message);

}

void setup(void) {
   thermo.begin(MAX31865_4WIRE);  // set to 2WIRE or 4WIRE as necessary
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  Serial.println("");

  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  if (WiFi.status() == WL_CONNECTED)
  {
    uint8_t macAddr[6];
    WiFi.macAddress(macAddr);
    Serial.printf("Connected, mac address: %02x:%02x:%02x:%02x:%02x:%02x\n", macAddr[0], macAddr[1], macAddr[2], macAddr[3], macAddr[4], macAddr[5]);
  }  
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  if (MDNS.begin("Suhas")) {
    Serial.println("MDNS responder started");
  }

  server.on("/", sendTemp);

  server.on("/inline", []() {
    server.send(200, "text/plain", "this works as well");
  });

  server.onNotFound(handleNotFound);

  server.begin();
  Serial.println("HTTP server started");
}

void loop(void) {
  
  server.handleClient();
  MDNS.update();
uint16_t rtd = thermo.readRTD();

  //Serial.print("RTD value: "); Serial.println(rtd);
  float ratio = rtd;
  ratio /= 32768;
  //Serial.print("Ratio = "); Serial.println(ratio,8);
  Rt=RREF*ratio;  
  //Serial.print("Resistance = "); 
  //Serial.println(RREF*ratio,8);
    
  Z1=-(Rt-RTDc);
  Z2=-RTDb + sqrt( (RTDb*RTDb) - (4 * RTDa * Z1) );
  temperature=Z2/(2*RTDa); 
  //Serial.print("Temperature = "); 
  Serial.print(RREF*ratio,8); Serial.print(" "); Serial.print(temperature,8);
  // Check and print any faults
  uint8_t fault = thermo.readFault();
  if (fault) {
    Serial.print("Fault 0x"); Serial.println(fault, HEX);
    if (fault & MAX31865_FAULT_HIGHTHRESH) {
      Serial.println("RTD High Threshold"); 
    }
    if (fault & MAX31865_FAULT_LOWTHRESH) {
      Serial.println("RTD Low Threshold"); 
    }
    if (fault & MAX31865_FAULT_REFINLOW) {
      Serial.println("REFIN- > 0.85 x Bias"); 
    }
    if (fault & MAX31865_FAULT_REFINHIGH) {
      Serial.println("REFIN- < 0.85 x Bias - FORCE- open"); 
    }
    if (fault & MAX31865_FAULT_RTDINLOW) {
      Serial.println("RTDIN- < 0.85 x Bias - FORCE- open"); 
    }
    if (fault & MAX31865_FAULT_OVUV) {
      Serial.println("Under/Over voltage"); 
    }
    thermo.clearFault();
  }
  Serial.println(temperature);
  

 tValue =temperature;
  delay(300);
  
}

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