Temperature Logger with Particle Photon

Lets make something useful with Particle Photon

I think temperature logger is a project that can find many application around house. For exaple I want to have temperature logger which will provide temperature measurements in my garage 🙂 Also I will be using it to control temperature of certain objects, as I can screw in thermistor into any M3 thread.

What you need:

  • Particle Photos ( Particle Core will work as well )
  • Small bread board, the one shipped with Particle Core will work
  • Thermistor, NTC type, 100 kOm
  • Bread board jumpers
  • 20 kOm resistor
  • USB cable to power up the device.

Video tutorial is here:

Here is the application code:

#include <math.h>
const int PULLUP_RES = 20000; // in Ohm( 20kOm )
const double BETA = 4390; // in K for Semitec 104 GTA-2
const double THERMISTOR_RES = 100000; // in Ohm
const double THERMISTOR_NOM_TEMP = 25; // Celsius, C
void setup()
{
}
void loop()
{
 thermister_temp(analogRead(4));
 delay(1000);
}
void thermister_temp(int aval)
{
 double R, T;
R = (double) PULLUP_RES / ( (4095 / (double) aval ) - 1 );
 
 T = 1 / ( ( 1 / (THERMISTOR_NOM_TEMP + 273.15 )) + ( ( 1 / BETA) * log ( R / THERMISTOR_RES ) ) );
 
 T -= 273.15; // converting to C from K
 
 // return degrees C
 Spark.publish("Temperature", String(T) + " °C");
}
About the Author
Love to tinker all day long

Leave a Reply

*

captcha *