Free delivery on orders above Rs 900 | Single Delivery charges for Multiple Items

Cart

Your Cart is Empty

Back To Shop

Cart

Your Cart is Empty

Back To Shop

Temperature Sensor Interfacing With Arduino Project – Connections and Code

In this article we will learn the basics of temperature sensors and their types. Also interfacing of PT100-S Temperature Sensor with Arduino UNO.

Banner - Temperature Sensor Interfacing With Arduino

Temperature measurement is very common and useful in many applications. From small household to huge industrial devices everything needs to be operated within a pre-defined temperature.

You will find temperature sensor in

  1. Automobiles
  2. Computers
  3. Home appliances
  4. Medical devices
  5. And more….

It is responsible for maintaining the device’s temperature at a rated value, thereby assuring the system’s safety and long life.

In this article, we will start with the basics of temperature sensors, understand its types, and finally interfacing with Arduino.

Anyhow I will say that temperature sensor is common in engineering applications, it would help if you understand it in detail.

What is a Temperature Sensor?

It is a device that measures and converts surrounding temperature into the data that can be understood by other devices. They work on the principle of resistance or voltage change in response to temperature variations.

A temperature sensor needs to be very precise and accurate as the failure to measure temperature can lead to damage to respective as well as surrounding devices.

Types of Temperature Sensors

1. Contact Temperature Sensor

Useful in distinguishing solids, liquids, and gases over a broad scope of temperature.

2. Non-contact Temperature Sensor

This type of sensor helps in determining the temperature of liquids and gases that radiates energy in response to rise in heat.

Interfacing Temperature Sensor with Arduino

We will be using PT100-S to illustrate the temperature sensor interfacing with Arduino.

What is PT100-S Temperature Sensor?

The resistor is a strip of platinum that has resistance of 100-138.4 Ω.

It is useful in laboratories and industries for measuring the temperature with excellent precision.

The PT100-S is equipped with a 316L stainless steel shield that makes it compatible with temperatures up to 420°C.

PT100-S Connection with Arduino

Connecting PT100-S with Arduino will take only 5-10 minutes.

Note: DO NOT connect the power supply until you ensure that everything is connected properly.

Follow the steps below to make proper connection,

Step 1 – Connect one end of the PT100-S temperature sensor to the analog pin on Arduino.

Step 2 – Now, we need to connect the same end of the sensor to 5V on Arduino through a resistor.

Resistor is added here to avoid heating problems. You can calculate value of the resistor using the formula below,

R2 = R1*1/(Vin/Vout-1)

The value of R2 should be low enough to avoid a low signal to noise ratio.

Here we are using a 150Ω resistor in this project.

Step 3 – Connect the other end of the sensor to the “GND” pin on Arduino.

Try keeping the PT100-S sensor near hot (candle) or cold (ice cube) material. You will see the change is readings.

Code

#include <Wire.h> const int analogInPin = A5; //sensor connected to A5 pin const int SensorValueLow = 463; const int SensorValueDiff = 36; // differance between high and low sensor value const int TempValueDiff = 42; // differance between high and low Temp value const int TempValueLow = 9; int sensorValue = 0; double Temp = 0; void setup() { } void loop() { sensorValue = analogRead(analogInPin); Temp = sensorValue-SensorValueLow; Temp = Temp/SensorValueDiff; Temp = Temp*TempValueDiff; Temp = Temp+TempValueLow; Serial.print(sensorValue); //printing value of sensor on the serial monitor Serial.print(Temp); // printing temperature on the serial monitor delay(200); // interval of fetching data from sensor }

Conclusion

Hope this article helped you learn the basics of temperature sensor and interfacing with Arduino. If you have any doubts, then don’t forget to comment below.

Also, we will love to see the prototype of your project; temperature sensor interfacing with Arduino.

Note that all of the products used in this project are available at Robu.in. Do not forget to check them as well.

Sayonara!

Cart

Your Cart is Empty

Back To Shop
GET DISCOUNT CODE

It will take just few seconds to claim 7% Discount, After Submitting check Email for Coupon code.

    X
    GET DISCOUNT CODE