Introduction: Arduino AD8495 Thermometer
A quick guide how to solve your problems with this K-type thermometer. We hope it helps :)
For the following project you will need:
1x Arduino (any kind, we just seemed to have 1 Arduino Nano free)
1x AD8495 ( it generally comes as kit with the sensor and everything)
6x Jumper wires (connecting AD8495 to Arduino)
soldering iron & soldering wire
OPTIONAL:
1x 9V battery
2x resistors ( we used 1x 10kOhms & 2x5kOhms because we connected the 2x5k together)
Please beware to proceed with care and watch for your fingers. The soldering iron may cause burns if not handled with care.
Step 1: How Does It Generally Works
Generally this thermometer is a product of Adafruit, its with a K-type sensor which can be used for almost anything from home or basement temperature measurement to furnace & oven heat measurement. It can withstand temperature from -260 degrees C up to 980, and with some small adjustments of the power supply it goes as far as 1380 degrees C (which is quite remarkable) and it is quite precise too, with the +/-2 degrees variation its remarkably useful. If you make it like we did with Arduino Nano you can pack it up in a small box as well ( considering you will make your own box which is not included in this tutorial).
Step 2: Connecting and Proper Wiring
As we recieved the package was like this as You can see from the photos above. You can use jumper wires to connect it to the Arduino board, but I would reccomend soldering the wires because it works on very small voltages so any slight movement can spoil the results.
The photos above are taken of how we soldered the wires on the sensor. For our project we used Arduino Nano and as you can see we have modified our Arduino a little bit as well for geting the optimal results from our measurements.
Step 3: Type of Usage
According to the datasheet this sensor can be used to measure from -260 to 980 degrees C with the normal Arduino 5V power supply or you can add some external power source and that will give you the opportunity to measure up to 1380 degrees. But beware if the thermometer gives more than 5V back to the Arduino to read it may damage your Arduino and your project may be doomed to fail.
To overcome this problem we put a voltage divider on the device which in our case is Vout to half the Vin voltage.
Links to the datasheet:
Step 4: The Big Problem With the Code When Measuring
Acording to the datasheet for the thermometer the referent voltage is 1.25V. In our measurements this was not the case... As we tested further we found out that the referent voltage is variable and we tested on two computers, on both it was different(!?!). Well we put a pin on the board (as shown on the picture above) and we put a line in the code to read the referent voltage value every time before calculating.
The main formula for this is Temp=(Vout-1.25) / 0.005.
In our formula we made it : Temp=(Vout-Vref) / 0.005.
Step 5: The Code Part 1
const int AnalogPin= A0; //Analog pin for temp read
const int AnalogPin2= A1; //Analog pin for reading referent value
float Temp; //Temperature
float Vref; //Referent voltage
float Vout; //Voltage after adc
float SenVal; //Sensor value
float SenVal2; //Sensor value from referent pin
void setup() {
Serial.begin(9600);
}
void loop() {
SenVal = analogRead(A0); //Analog value from temperature
SenVal2 =analogRead(A1); //Analog value from refferent pin
Vref = (SenVal2 *5.0) / 1024.0; //Conversion analog to digital for referent value
Vout = (SenVal * 5.0) / 1024.0; //Conversion analog to digital for the temperature read voltage
Temp = (Vout - Vref) / 0.005; //Temperature calculation
Serial.print("Temperature= ");
Serial.println(Temp);
Serial.print("Referent Voltage= ");
Serial.println(Vref);
delay (200);
}
This code is used when You use the power from the Arduino (no external power source). This will limit your measurement up to 980 degrees C according to the datasheet.
Step 6: The Code Part 2
const int AnalogPin= A0; //Analog pin for temp read
const int AnalogPin2= A1; //Analog pin from where we read referent value(We had to make this because the referent value of the sensor is unstable)
float Temp; //Temperature
float Vref; //Referent voltage
float Vhalf; //Voltage on the arduino read after the divider
float Vout; //Voltage after conversion
float SenVal; //Sensor value
float SenVal2; //Sensor value from the where we get referent value
void setup() {
Serial.begin(9600); }
void loop() {
SenVal = analogRead(A0); //Analog output value
SenVal2= analogRead(A1); //Analog output from where we get referent value
Vref = (SenVal2 * 5.0) / 1024.0; //Transfroming analog value from Referent pin to digital value
Vhalf = (SenVal * 5.0) / 1024.0; //Transform Analog to Digital value
Vout = 2 * Vhalf; //Calculation of the voltage after the halfing voltage divider
Temp = (Vout - Vref) / 0.005; //Temperature formula calculation
Serial.print("Temperature= ");
Serial.println(Temp);
Serial.print("Vout= ");
Serial.println(Vout);
Serial.print("Referent Voltage= ");
Serial.println(Vref);
delay (100);
}
This is the code if you are using an external power source and for this we use the voltage divider. That's why we have the "Vhalf" value inside. Our voltage divider used (see in part 3) is to half the incoming voltage (R1 has same ohm values as R2) because we used a 9V battery. As mentioned above any voltage above 5V can damage your Arduino, so we made it to get max 4.5V (which is impossible in this case, since top power output from sensor after the voltage divider can be something around 3.5V ).
Step 7: Results
As you can see from the screenshots above, we have tested it and it works. In addition we have provided you with the original Arduino files.
This is it, We hope it helps you with your projects.