Samantha KovichAsha McDougal
Published © GPL3+

Universal Temperature Sensor

There's thermostats on the wall, weather apps on your phone, but is there an accurate way to measure temperature freely?

IntermediateShowcase (no instructions)10 hours373
Universal Temperature Sensor

Things used in this project

Hardware components

Argon
Particle Argon
×1
Small Solderless Breadboard Kit
Digilent Small Solderless Breadboard Kit
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
Amazon Alexa NTC Thermistor
×1
I2C 16x2 Arduino LCD Display Module
DFRobot I2C 16x2 Arduino LCD Display Module
(Optional)
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Fritzing

Story

Read more

Schematics

Schematic

This is how we connect all our components.

Code

Temperature Sensor Code

Arduino
This code takes the signal from an NTC Thermistor and calibrates it to display a temperature value.
// This #include statement was automatically added by the Particle IDE.
#include <LiquidCrystal.h>

// This #include statement was automatically added by the Particle IDE.
#include <ThingSpeak.h>

TCPClient client;

unsigned long myChannelNumber = 1249700;		/*Thingspeak channel id*/
const char * myWriteAPIKey = "JV9ZUGWBYLJHGBGL";/*Channel's write API key*/

#include <math.h>
LiquidCrystal lcd(12,11,5,4,3,2);
const int thermistor_output = A3;
void setup() {
Serial.begin(9600);
//Connect to ThingSpeak
ThingSpeak.begin(client);
double temperature;
}

void loop() {
int thermistor_adc_val;
double output_voltage, thermistor_resistance, therm_res_ln, temperature;
thermistor_adc_val = analogRead(thermistor_output);
output_voltage = ((thermistor_adc_val * 3.3)/ 4095.0);
thermistor_resistance = ((3.3 * (10/output_voltage))-10);
thermistor_resistance = thermistor_resistance * 1000;
therm_res_ln = log(thermistor_resistance);
temperature = (1/(0.001129148 + (0.000234125 * therm_res_ln)+( 0.0000000876741 * therm_res_ln * therm_res_ln))); // solving for temp
temperature = temperature - 273.15;
temperature = ((temperature*1.8) + 32)-15;
ThingSpeak.setField(1,(float)temperature);
ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
delay(120000);
Serial.print("Temperature=");
Serial.print(temperature);
Serial.print("\n\n");
lcd.begin(16,2); 
lcd.print("Temperature=");
lcd.print(temperature);
lcd.print("\n\n");
delay(1000);
}

Credits

Samantha Kovich

Samantha Kovich

1 project • 0 followers
Asha McDougal

Asha McDougal

1 project • 0 followers

Comments

Add projectSign up / Login