Digital Temperature Sensor

  • Digital Temperature Sensor

Below the corresponding code:

#include <math.h>
 
int sensorPin = A5; // select the input pin for the potentiometer
 
double Thermistor(int RawADC) {
double Temp;
Temp = log(10000.0*((1024.0/RawADC-1)));
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp - 273.15; // Convert Kelvin to Celcius
//Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
return Temp;
}
 
void setup() {
Serial.begin(9600);
}
 
void loop() {
int readVal=analogRead(sensorPin);
double temp = Thermistor(readVal);
 
Serial.println(temp); // display tempature
//Serial.println(readVal); // display tempature
 
delay(500);
}

SCHEMATIC:
Arduino pin analoog A5 --> module S (Signal)
Arduino pin GND - module -
Arduino pin 5+ --> middel pin 5V

This code don't give the right values, in a room that was kind of ok it gave a tempature of 10 C. That isn't right so the calculation in the code should be checked.

Write a review

Please login or register to review

Digital Temperature Sensor

  • Webwinkel Keurmerk en klantebeoordelingen

  • 14 dagen bedenktijd 
  • Verzendkosten voor eigen rekening
  • Product Code: KY-013-2
  • Availability: 14
  • 2.36€

  • Ex Tax: 1.95€

Similar Products

Mercury Switch / Magic Light Cup Module

Mercury Switch / Magic Light Cup Module

Below you can see the corresponding code: An example project for the KY-027/* * Author: Danny van..

2.49€ Ex Tax: 2.06€

3 Color LED Module RGB

3 Color LED Module RGB

Below the corresponding code://KY016 3-color LED module int redpin = 11; // select the pin for the ..

2.36€ Ex Tax: 1.95€

Mercury Switch Module

Mercury Switch Module

Below you can see the corresponding code: An example of a project for the KY-017 Mercury Switch./* ..

2.36€ Ex Tax: 1.95€

Ultrasonic capteur Distance - HC SR04

Ultrasonic capteur Distance - HC SR04

Below you can see the corresponding code :An example of a project for Distance Sensor/* Author: Dan..

2.99€ Ex Tax: 2.47€