NTC Thermistor/ Temperature sensor

  • NTC Waterproof Thermistor/ Temperature sensor

Length 50 cm.
Below you can see the corresponding code:
An example of a project for the sensor.
/*
Author: Danny van den Brande, Arduinosensors.nl. BlueCore Tech.
This code is written for the Thermistor, i attached a LCD1602A to
display the temperature, you can change Celsius to fahrenheit below in the code.
just uncomment line 73. you can use I2C or normal wiring.
 */
// which analog pin to connect
#define THERMISTORPIN A0         
// resistance at 25 degrees C
#define THERMISTORNOMINAL 10000      
// temp. for nominal resistance (almost always 25 C)
#define TEMPERATURENOMINAL 25   
// how many samples to take and average, more takes longer
// but is more 'smooth'
#define NUMSAMPLES 5
// The beta coefficient of the thermistor (usually 3000-4000)
#define BCOEFFICIENT 3950
// the value of the 'other' resistor
#define SERIESRESISTOR 10000    

//#include <LiquidCrystal.h> //uncomment when not using I2C
#include <LiquidCrystal_I2C.h>//uncomment when using a I2C

//LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //Uncomment when not using a I2C
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);// Uncomment when using a I2C
//make sure you set the right adress. here are the most common ones.
//PCF8574 = 0x20, PCF8574A = 0x38, PCF8574AT = 0x3F.
 
int samples[NUMSAMPLES];
 
void setup(void) {
  Serial.begin(9600);
  analogReference(EXTERNAL);
  lcd.begin(16,2); 
  lcd.setCursor(2,0);  
  lcd.print("Thermistor");
  lcd.setCursor(1,1);
  lcd.print("BlueCore Tech");
  delay(3000);
  lcd.clear();
}
 
void loop(void) {
  uint8_t i;
  float average;
 
  // take N samples in a row, with a slight delay
  for (i=0; i< NUMSAMPLES; i++) {
   samples[i] = analogRead(THERMISTORPIN);
   delay(10);
  }
 
  // average all the samples out
  average = 0;
  for (i=0; i< NUMSAMPLES; i++) {
     average += samples[i];
  }
  average /= NUMSAMPLES;
 //  Serial.print("Average analog reading "); 
//  Serial.println(average);
// convert the value to resistance
  average = 1023 / average - 1;
  average = SERIESRESISTOR / average;
//  Serial.print("Thermistor resistance "); 
//  Serial.println(average); 
  float steinhart;
  steinhart = average / THERMISTORNOMINAL;     // (R/Ro)
  steinhart = log(steinhart);                  // ln(R/Ro)
  steinhart /= BCOEFFICIENT;                   // 1/B * ln(R/Ro)
  steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15); // + (1/To)
  steinhart = 1.0 / steinhart;                 // Invert
  steinhart -= 273.15;  // convert to Celsius
//  steinhart = (steinhart * 9.0)/ 5.0 + 32.0;  // Uncomment if you want to use fahrenheit

  lcd.setCursor(2,0);
  lcd.print("Temperature "); 
//  Serial.print("Temperature "); 
  lcd.setCursor(3,1);
  lcd.print(steinhart);
//  Serial.print(steinhart);
  lcd.println(" *C              ");//Comment when using fahrenheit
//  lcd.println(" *F            ");//Uncomment when using fahrenheit
//  Serial.println(" *C");
//  Serial.println(" *F");
 
  delay(1000);
}


Write a review

Please login or register to review

NTC Waterproof Thermistor/ Temperature sensor

  • Webwinkel Keurmerk en klantebeoordelingen

  • 14 dagen bedenktijd 
  • Verzendkosten voor eigen rekening
  • Product Code: W1209
  • Availability: 14
  • 2.36€

  • Ex Tax: 1.95€

Similar Products

Reed Switch Module

Reed Switch Module

Below the corresponding code:int Led = 13 ;/ / define LED Interface int buttonpin = 3; / / define t..

2.36€ Ex Tax: 1.95€

Obstacle Avoidance Sensor Module

Obstacle Avoidance Sensor Module

Below the corresponding code://Author: Danny van den Brande. BlueCore Tech. Arduinosensors.nl //Thi..

2.49€ Ex Tax: 2.06€

Photoelectric sensor / photo interrupter

Photoelectric sensor / photo interrupter

Below you can see the corresponding code:An example of a project for the ky-010//Author: Danny van d..

2.29€ Ex Tax: 1.89€

Line Tracing Sensor Module

Line Tracing Sensor Module

Below you can see the corresponding code:An example project for Line Tracing Module/* Author: Danny..

2.49€ Ex Tax: 2.06€

Tags: arduino, thermistor, W1209, W1401