// the value of the 'other' resistor
#define SERIESRESISTOR 100000
// resistance at 25 degrees C
#define THERMISTORNOMINAL 100000
// temp. for nominal resistance (almost always 25 C)
#define TEMPERATURENOMINAL 25
// The beta coefficient of the thermistor (usually 3000-4000)
#define BCOEFFICIENT 4000
// the value of the 'other' resistor
#define SERIESRESISTOR 102800


// What pin to connect the sensor to
#define sensor A0
#define trimpot A1
#define led 13

void setup()
{
pinMode(led, OUTPUT);
Serial.begin(9600);
}

void loop()
{
float reading;
float resistence;

reading = analogRead(sensor);

// convert the value to resistance
resistence = SERIESRESISTOR / ((1023 / reading) - 1);

float steinhart = (1 / (((log(resistence / THERMISTORNOMINAL)) / BCOEFFICIENT) + (1.0 / (TEMPERATURENOMINAL + 273.15)))) - 273.15;


Serial.println(steinhart);

delay(50);
}

Exibições: 144

Comentar

Você precisa ser um membro de Laboratorio de Garagem (arduino, eletrônica, robotica, hacking) para adicionar comentários!

Entrar em Laboratorio de Garagem (arduino, eletrônica, robotica, hacking)

© 2024   Criado por Marcelo Rodrigues.   Ativado por

Badges  |  Relatar um incidente  |  Termos de serviço