Cov txheej txheem:

Arduino Raws Tus Kheej Tus Kheej: 3 Kauj Ruam
Arduino Raws Tus Kheej Tus Kheej: 3 Kauj Ruam

Video: Arduino Raws Tus Kheej Tus Kheej: 3 Kauj Ruam

Video: Arduino Raws Tus Kheej Tus Kheej: 3 Kauj Ruam
Video: Computer Vision with Python! Resizing Images 2024, Kaum ib hlis
Anonim
Arduino Raws Tus Ntsuas Kub
Arduino Raws Tus Ntsuas Kub

Hauv txoj haujlwm no, Arduino raws tus ntsuas kub digital tau tsim los uas tuaj yeem siv los tshuaj xyuas qhov kub ntawm chav.

Tus pas ntsuas kub feem ntau yog siv ntsuas kub. Muaj ntau yam hauv paus ntsiab lus uas tuaj yeem siv los ntsuas qhov ntsuas kub xws li kev nthuav dav cua sov ntawm cov kua los yog kua, qhov siab ntawm cov pa, ntsuas lub zog infrared, thiab lwm yam.

Arduino raws tus ntsuas kub digital tau hais tseg uas tuaj yeem siv los tshuaj xyuas qhov kub ntawm chav. LM35 LM35 yog qhov ntsuas kub. Qhov hluav taws xob tso tawm ntawm qhov ntsuas no yog ncaj qha rau qhov kub hauv centigrade. LM35 tuaj yeem siv tau hauv thaj tsam ntawm -550C txog +1500C nrog +/- 0.750C qhov tseeb.

Khoom siv

Arduino Ib

LM35 Kub sensor

16x2 LCD Zaub

Kauj Ruam 1: Tsim Circuit Court ntawm Digital Thermometer

Tsim Circuit Court ntawm Digital Thermometer
Tsim Circuit Court ntawm Digital Thermometer

Qhov ntsuas kub ntsuas siv hauv txoj haujlwm no yog LM35. Qhov tso tawm ntawm qhov ntsuas kub yog ncaj qha rau qhov kub tab sis hauv daim ntawv sib piv. Li no, qhov tso tawm ntawm LM35 txhais tau tias tus pin 2 txuas nrog analog input A0 ntawm Arduino.

Raws li nws yog lub ntsuas cua digital, peb yuav tsum hloov pauv qhov sib piv ntawm qhov kub thiab txias mus rau digital thiab tso tawm qhov tshwm sim ntawm cov zaub zoo li LCD, thiab lwm yam 16X2 LCD tau siv. Tus lej 1 thiab 2 ntawm LCD tau txuas nrog hauv av thiab muab khoom raws. Txhawm rau tswj kev sib piv ntawm cov zaub, Pin 3 ntawm LCD tau txuas nrog lub wiper ntawm 10 KΩ POT.

Qhov seem ntawm POT txuas nrog txuas rau cov khoom siv thiab hauv av. Pins 15 thiab 16 ntawm LCD tau siv los ua lub teeb pom kev rov qab ntawm LCD uas txuas nrog rau cov khoom siv thiab hauv av feem. Txhawm rau tso tawm cov ntaub ntawv ntawm LCD, peb xav tau 4 cov ntaub ntawv pins ntawm LCD. Pins 11 - 14 (D4 - D7) tau txuas rau Pins 5 - 2 ntawm Arduino. Pins 4, 5 thiab 6 (RS, RW thiab E) ntawm LCD yog tswj pins. Pins 4 (RS) ntawm LCD txuas nrog tus pin 7 ntawm Arduino. Tus Pin 5 (RW) txuas nrog hauv av. Pin 6 (E) txuas nrog tus pin 6 ntawm Arduino.

Kauj Ruam 2: Ua haujlwm ntawm Digital Thermometer

Ua haujlwm ntawm Digital Thermometer
Ua haujlwm ntawm Digital Thermometer

Lub ntsuas kub digital qhov tseeb tau teev tseg hauv txoj haujlwm no. Kev ua haujlwm ntawm Circuit yog raws li tau piav qhia hauv qab no.

Qhov ntsuas kub piv txwv li LM35 tshuaj xyuas qhov kub hauv chav tas li thiab muab qhov sib piv zoo ib yam uas ncaj qha piv rau qhov kub.

Cov ntaub ntawv no tau muab rau Arduino dhau A0. Raws li ib txoj cai tau sau, Arduino hloov pauv qhov ntsuas qhov sib piv rau qhov ntsuas kub digital.

Tus nqi no tau qhia ntawm LCD. Cov zis tso tawm ntawm LCD yog qhov nyeem tau meej ntawm chav sov hauv centigrade.

hIOTron's Internet of Things Course Training tau tsim ntau yam IoT Solutions tshaj li daim ntawv thov los txhim kho tus neeg siv kev paub.

Kauj ruam 3: Khiav qhov program

#suav nrog

LiquidCrystal lcd (7, 6, 5, 4, 3, 2);

const int Sensor = A0;

byte degree_symbol [8] =

{

0b00111, 0b00101, 0b00111, 0b00000, 0b00000, 0b00000, 0b00000, 0b0000

};

void teeb tsa ()

{

pinMode (Sensor, INPUT);

lcd.begin (16, 2);

lcd.createChar (1, degree_symbol);

lcd.setCursor (0, 0);

lcd.print ("Digital");

lcd.setCursor (0, 1);

lcd.print ("Tus pas ntsuas kub");

ncua (4000);

lcd.clear ();

}

void lub voj ()

{

ntab temp_reading = analogRead (Sensor);

ntab kub = temp_reading*(5.0/1023.0)*100;

ncua (10);

lcd.clear ();

lcd.setCursor (0, 0);

lcd.print ("Kub hauv C");

lcd.setCursor (4, 1);

lcd.print (kub);

lcd.write (1);

lcd.print ("C");

ncua (1000);

}

Pom zoo: