Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>
- LiquidCrystal lcd(12,11,5,4,10,13);
- const int sens=A0;
- float RT, VR, ln, TX, T0, VRT;
- int VCC=5;
- int RTO=10000;
- int B=3977;
- int R=10000;
- void setup() {
- // put your setup code here, to run once:
- lcd.begin(16,2); //imposta il numero di colonne e righe
- analogReference(EXTERNAL); //il pin aref รจ collegato alla tensione di riferimento di 3,3v
- T0 = 25 + 273.15;
- }
- void loop() {
- // put your main code here, to run repeatedly:
- VRT = analogRead(A0); //Acquisition analog value of VRT
- VRT = (5.00 / 1023.00) * VRT; //Conversion to voltage
- VR = VCC - VRT;
- RT = VRT / (VR / R); //Resistance of RT
- ln = log(RT / RTO);
- TX = (1 / ((ln / B) + (1 / T0))); //Temperature from thermistor
- TX = TX - 273.15; //Conversion to Celsius
- lcd.setCursor(0,0);
- lcd.print("temperatura in Celsius: ");
- lcd.setCursor(0,1);
- lcd.print(TX);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement