Cov txheej txheem:

Digital Thermometer Nrog Arduino & DS18B20: 7 Cov Kauj Ruam
Digital Thermometer Nrog Arduino & DS18B20: 7 Cov Kauj Ruam

Video: Digital Thermometer Nrog Arduino & DS18B20: 7 Cov Kauj Ruam

Video: Digital Thermometer Nrog Arduino & DS18B20: 7 Cov Kauj Ruam
Video: ? Что такое многополосный 6 атомный хронометраж ? То 2024, Kaum ib hlis
Anonim
Digital Thermometer Nrog Arduino & DS18B20
Digital Thermometer Nrog Arduino & DS18B20
Digital Thermometer Nrog Arduino & DS18B20
Digital Thermometer Nrog Arduino & DS18B20

Cias tsim lub ntsuas cua digital nrog tuaj yeem qhia koj tam sim no chav sov ntawm lub vijtsam LCD. Nov yog qhov pib ua haujlwm. Cov cuab yeej uas koj xav tau: 1. Arduino UNO R3 2. DS18B20 ntsuas kub. 3. 16X2 LCD zaub. 4. Txuas cov xov hlau. 5. Pawg phiaj xwm phiaj xwm. Tam sim no cia ua tus ntsuas kub digital….. Nov yog Atmega168 pinouts rau arduino. Tsuas yog hla qhov no yog tias koj saib kom ntsuas lub ntsuas cua no nrog koj cov arduino.

Kauj Ruam 1: Ua Arduino ntawm Breadboard

Ua Arduino ntawm Breadboard
Ua Arduino ntawm Breadboard

Tsim arduino ntawm tus breaboard yog yooj yim heev. Tam sim no cov txheej txheem txheej txheem txheej txheem tau muab qhia hauv qab no: 1. Pin 7 -> +5V 2. Pin8 -> GND 3. Pin9 -> Crystal -> 22pF capacitor -> GND 4. Pin10-> Crystal -> 22pF capacitor -> GND 5. tus pin 22 -> GND 6. Pin21 & Pin20 -> +5V 7. Pin1-> 10K tus neeg rau npe rau GND +Nias lub pob kom +5V Tam sim no koj npaj tau lawm ……………..

Kauj ruam 2: Txuas LCD

Txuas LCD
Txuas LCD

Kauj Ruam 3: Txuas DS18B20 Kub Sensor

Txuas DS18B20 Kub Sensor
Txuas DS18B20 Kub Sensor

Kauj Ruam 4: Npaj Lub Circuit Court

Npaj Lub Circuit Court
Npaj Lub Circuit Court

Txuas lub LCD nrog atmega lossis arduino raws li piv txwv LCD piv txwv ntawm arduino IDE. Tam sim no txuas DS1307 DATA npav mus rau DIGITAL PIN 7 (Atmega tus pin 13)

Kauj ruam 5: Arduino CODE

#include #include #include int DS18S20_Pin = 7; // DS18S20 Teeb tus pin ntawm digital 7 los ntawm rahulmitra LiquidCrystal lcd (12, 11, 5, 4, 3, 2); // Kub nti i/o OneWire ds (DS18S20_Pin); // ntawm tus lej digital 7 los ntawm rahulmitra tsis muaj teeb tsa (tsis muaj dab tsi) {Serial.begin (9600); lcd.begin (16, 2); // Luam tawm cov lus rau LCD. lcd.print ("Rahul Mitra"); } void loop (tsis muaj dab tsi) {ntab kub = getTemp (); Serial.println (kub); lcd.setCursor (0, 1); lcd.print ("Temp:"); lcd.print (kub); lcd.print (" *C"); ncua (100); // tsuas yog nyob ntawm no kom qeeb qhov tso tawm kom nws yooj yim nyeem} ntab getTemp () {// rov qab ntsuas kub los ntawm ib qho DS18S20 hauv DEG Celsius byte cov ntaub ntawv [12]; byte addr [8]; yog (! rov qab -1000; } yog (OneWire:: crc8 (addr, 7)! = addr [7]) {Serial.println ("CRC tsis siv tau!"); rov qab -1000; } yog (addr [0]! = 0x10 && addr [0]! = 0x28) {Serial.print ("Ntaus ntawv tsis raug lees paub"); rov qab -1000; } ds.reset (); ds xaiv (addr); ds.write (0x44, 1); // pib hloov dua siab tshiab, nrog rau lub zog cab nyob rau thaum kawg byte tam sim no = ds.reset (); ds xaiv (addr); ds.write (0xBE); // Nyeem Scratchpad rau (int i = 0; i <9; i ++) {// peb xav tau 9 bytes cov ntaub ntawv = ds.read (); } ds.reset_search (); byte MSB = cov ntaub ntawv [1]; byte LSB = cov ntaub ntawv [0]; ntab tempRead = ((MSB << 8) | LSB); // siv ob qhov kev qhuas qhuas ntab TemperatureSum = tempRead /16; rov qab TemperatureSum; }

Kauj Ruam 6: Thaum kawg Koj Tau Ua tiav

Thaum kawg Koj Tau Ua tiav
Thaum kawg Koj Tau Ua tiav
Thaum kawg Koj Tau Ua tiav
Thaum kawg Koj Tau Ua tiav

Kauj Ruam 7: Saib LIVE

www.youtube.com/watch?v=7718FODdtio&list=UUY916I6z4Y3QQhzjHsIhR8w

Pom zoo: