Mundarija:
2025 Muallif: John Day | [email protected]. Oxirgi o'zgartirilgan: 2025-01-13 06:58
NTC termistoridan foydalangan holda oddiy va arzon harorat sensori
Termistor o'z qarshiligini vaqt o'zgarishi bilan o'zgartiradi, bu xususiyat yordamida biz termistor haqida ko'proq bilib olamiz
uz.wikipedia.org/wiki/Thermistor
1 -qadam: zarur komponentlar
Arduino uno (yoki) har qanday arduino ishlaydi
ba'zi o'tish simlari va non taxtasi
1 x 10 k qarshilik
1X NTC 10k termistor
2 -qadam: ulanishlar
(Er) ---- (10k-qarshilik) ------- | ------- (Termistor) ---- (+5v)
| Analog pin 0
3 -qadam: Farengeyt uchun kod
#qo'shing
er -xotin termistor (int RawADC) {er -xotin Harorat; Harorat = log (10000.0*((1024.0/RawADC-1)))); // = log (10000.0/(1024.0/RawADC-1)) // tortish konfiguratsiyasi uchun Temp = 1/(0.001129148 + (0.000234125 + (0.0000000876741 * Harorat * Harorat)) * Harorat); Harorat = Harorat - 273.15; // Kelvinni Celcius Temp ga aylantiring = (Temp * 9.0)/ 5.0 +32; // Selsiyni Farengeytga qaytish haroratiga aylantiring; }
void setup () {Serial.begin (115200); }
void loop () {Serial.println (int (Thermistor (analogRead (0))))); // Farengeyt kechikishini ko'rsatish (1000); }
4 -qadam: Selsiy uchun kod
#qo'shing
er -xotin termistor (int RawADC) {er -xotin Harorat; Harorat = log (10000.0*((1024.0/RawADC-1)))); // = log (10000.0/(1024.0/RawADC-1)) // tortish konfiguratsiyasi uchun Temp = 1/(0.001129148 + (0.000234125 + (0.0000000876741 * Harorat * Harorat)) * Harorat); Harorat = Harorat - 273.15; // Kelvinni Selsiyga qaytish haroratiga aylantiring; }
void setup () {Serial.begin (115200); }
void loop () {Serial.println (int (Thermistor (analogRead (0))))); // Farengeyt kechikishini ko'rsatish (1000); }
5 -qadam: Xulosa
barcha qadamlarni bajargandan so'ng, ketma -ket monitorni oching va 115200 -ga uzatishni sozlang, siz harorat ko'rsatkichlarini ko'rishingiz mumkin
Bunga lcd qo'shishingiz mumkin bo'lgan keyingi o'zgarishlar
rahmat:)
agar shubhangiz bo'lsa, so'rashdan tortinmang