Using a PT100 RTD (Resistance Temperature Detector) with an Arduino and connecting it to the Arduino IoT Cloud via Wi-Fi allows you to remotely monitor temperatures with high accuracy and reliability. In this tutorial, we’ll walk you through the process of setting up your PT100 sensor with an Arduino that has Wi-Fi capabilities, and then integrate the data into Arduino Cloud for remote monitoring and logging.
What You’ll Need
- PT100 RTD Temperature Sensor
- RTD Amplifier/Module – For example, an Adafruit MAX31865 Amplifier, which is specifically designed for RTDs.
- Arduino with Wi-Fi capability – Arduino MKR WiFi 1010 , ESP32, or similar.
- Jumper wires
- Arduino IoT Cloud Account
Understanding the PT100 Sensor and Amplifier
The PT100 RTD sensor changes resistance in response to temperature. The PT100’s resistance is 100 ohms at 0°C and changes linearly with temperature. To interface it with the Arduino, you need an amplifier like the MAX31865, which converts the resistance changes into digital signals readable by the Arduino.
Wiring the PT100 RTD and Amplifier
Connect the PT100 RTD to the amplifier. Most RTD amplifiers like the MAX31865 come with labeled inputs for 2-wire, 3-wire, or 4-wire RTD configurations. Here’s how to connect a 3-wire PT100 RTD to a MAX31865 module and then connect the module to the Arduino
PT100 Sensor to MAX31865:
- Wire one side of the RTD to the RTD+ pin.
- The other two wires go to the RTD- and RTD Middle connections (follow the specific module’s labeling).
MAX31865 Amplifier to Arduino:
- VCC of the MAX31865 to 3.3V on the Arduino.
- GND of the MAX31865 to GND on the Arduino.
- SDO (MISO) of the MAX31865 to MISO on the Arduino.
- SDI> (MOSI) of the MAX31865 to MOSI on the Arduino.
- SCK of the MAX31865 to SCK on the Arduino.
- CS> of the MAX31865 to any available digital pin on the Arduino (e.g., D5).
Install Required Libraries
To make your Arduino code simpler, install the required libraries:
Adafruit MAX31865 Library:
- Open the Arduino IDE.
- Go to Sketch > Include Library > Manage Libraries.
- Search for Adafruit MAX31865 and install it.
Arduino IoT Cloud Library:
- Go to Sketch> Include Library> Manage Libraries
- Search for ArduinoIoTCloud and install it.
Step 4: Create an Arduino IoT Cloud Account and Setup a New Thing
- Go to Arduino IoT Cloud and sign in or create an account.
- Create a new Thing in the Arduino IoT Cloud, which will be the object holding your temperature data.
- Define a variable in the Thing (e.g., temperature of type Float) that will store and display the PT100 sensor’s temperature readings.
- Select your device type and configure it to connect to Wi-Fi.
Step 5: Write the Arduino Code
Here’s an example code snippet to read from the PT100 sensor and upload the data to Arduino Cloud.
Code Explanation
- Wi-Fi Configuration: The code connects to your Wi-Fi using WiFiNINA.h.
- RTD Setup: The Adafruit_MAX31865 library configures the sensor with max31865.begin(MAX31865_3WIRE).
- Temperature Readings: temperature = readTemperature() fetches the temperature and assigns it to the temperature variable created in Arduino Cloud.
- Sending Data to the Cloud: ArduinoCloud.update() syncs the temperature data to your Arduino IoT Cloud account.
Monitoring Data on Arduino IoT Cloud
- Go back to Arduino IoT Cloud and open the Dashboard for your Thing.
- Add a widget (such as a Gauge or Chart) to visualize the temperature variable in real-time.
Deploy and Test
- Upload the code to your Arduino board.
- Open the serial monitor to verify if temperature readings are displayed correctly.
- Check the Arduino IoT Cloud dashboard to ensure the temperature data is streaming and updating in real-time.
Conclusion
This tutorial demonstrated how to connect a PT100 RTD to an Arduino with Wi-Fi capability and integrate it into Arduino IoT Cloud. This setup is suitable for remote monitoring, data logging, and implementing smart temperature monitoring systems. You can further customize the setup by adding more features, such as email alerts or integration with other IoT services.