# Temperature Measurement System

We had a discussion about what kind of temperature inducer we should use and came up with a little comparison table for the thermocouple, Thermistor and Pt-100 so we can make a decision on which one to use.

We decided to use a US sensor thermistor because it has very good sensitivity and economical. The Pt100 would be great but it is way too expensive and it covers the temperature range that the mechanical engineers needed (-30 to 50 degree Celsius)

The US Sensor Thermistor depends on the change of temperature. We used 0° and 20°c as our sample temperature in our project to record the resistance. Click to know more about US sensor

We discussed the possibilities of using either the voltage divider or the Wheatstone bridge to build our system but we decided to use the Wheatstone bridge for more accuracy, fuller range and zero offset.

A Wheatstone bridge is two voltage dividers in parallel and one variable resistor. It allows us to measure the difference in voltage in the two dividers and this is V_out. As long as one of the resistors in the second divider has the same value as the lowest resistance value of the thermistor.We used a non-linear rescale to rescale to temperature.

the block diagram of the Wheatstone bridge accurately to our values is as seen below:

#### Apparatus:

2. Resistor(47k,1k,10k and 22k)
3. A multimeter
4. US Sensor thermistor
5. LM24 Amplifier
6. Arduino Nano

#### Procedure for Building the System

Steps in making the temperature measurement system:

Since exact resistors values weren’t possible, we had to use various resistors in series and parallel to get our system as accurate as possible.

1. At the leftmost side of the breadboard the circuit was started.
2. Firstly, a resistor of 47k and 22k was put in parallel
3. After each resistor was placed, we used the multimeter to double check the values matched up with the calculated values
4. This was put in series to the thermistor
5. On the other side a resistor of 47k and 22k was put in parallel.
6. Then two resistors of 10k and 1k was put in series.
7. These two equivalent resistances were put together in series.
8. Another two resistor of 10k and 1k was put in series before connecting it to the LMxxx amplifier.
9. The two resistors before the amp was connected to the Wheatstone bridge at A and B.
10. One 47k resistor was connected to ground from the positive rail of the op-amp
11. Then another 47k resistor was connected back into the op amp
12. From the output of the op amp this was input into the Arduino Nano input analog port.
13. Lastly, the 5V and ground was connected to the voltage rail of the bread board and that voltage was connected to the breadboard

#### The Arduino Code

Also, you have here the code we used to program the Arduino:

``````/*
Rescaling the thermistor sensor
*/
include  //
include  // log:
float Vs = 4.288; // supply voltage:
int R3 = 14981; // resistor value of R3 and R4:
float To = 293.15; // top of the range temperature:
int Ro = 10000;
int B = 3892;
void setup()
{
// put your setup code here, to run once:
pinMode(A0, INPUT);
Serial.begin(9600); // initialze serial communication at 9600 bits per second:
}
void loop()
{
// put your main code here, to run repeatedly:
// read the input on analog pin 0:
// Convert the analog reading (which goes from 0-1023) to a voltage(0-5v):
float Vo = DU /(204.6);
// thermistor resistance values:
float Rth = ((R3*(1-(Vo/Vs))))/(Vo/Vs);
// calculating the temperature in Kevin's:
double log(double x);
float x = (Rth/Ro);
float T = (1/((log(x)/B)+(1/To)));
// temperature in degrees celsius:
float TC = T-273.15;
Serial.print("V");
// print out the voltage reading of the measurement system:
Serial.println(Vo);
delay(1000); //wait for 100ms:
Serial.print("Resistor");
// print out the thermistor resistor values:
Serial.println(Rth);
delay(1000); //wait for 100ms:
Serial.print("K");
// print out the temperature reading in Kevin's:
Serial.println(T);
delay(1000); //wait for 100ms:
Serial.print("T");
// print out the temperature in degree's celsius:
Serial.println(TC);
delay(1000); //wait for 100ms:
}``````

#### Simulation Video

You can see the video of the final model below: