Cov txheej txheem:

Tsev Automation: Suab Tswb thiab Zaub ntawm LCD Thaum Kub Siab Tshaj Qhov Tsawg Tus Nqi: 5 Kauj Ruam
Tsev Automation: Suab Tswb thiab Zaub ntawm LCD Thaum Kub Siab Tshaj Qhov Tsawg Tus Nqi: 5 Kauj Ruam

Video: Tsev Automation: Suab Tswb thiab Zaub ntawm LCD Thaum Kub Siab Tshaj Qhov Tsawg Tus Nqi: 5 Kauj Ruam

Video: Tsev Automation: Suab Tswb thiab Zaub ntawm LCD Thaum Kub Siab Tshaj Qhov Tsawg Tus Nqi: 5 Kauj Ruam
Video: leej twg tej ntxhai - Mang Vang [ Official MV ] 2024, Kaum ib hlis
Anonim
Kev Siv Tshuab Hauv Tsev: Suab Tswb thiab Zaub ntawm LCD Thaum Kub Kub Tshaj Saum Tus Nqi
Kev Siv Tshuab Hauv Tsev: Suab Tswb thiab Zaub ntawm LCD Thaum Kub Kub Tshaj Saum Tus Nqi

Cov blog no yuav qhia yuav ua li cas thiaj ua Lub Tsev Siv Hluav Taws Xob Hauv Tsev uas yuav pib ua lub tswb thaum twg qhov kub nce mus txog ntau dua li qhov kev qhia pib qhov nqi. Nws yuav ua kom pom qhov ntsuas kub tam sim no ntawm chav nyob ntawm LCD thiab qhov yuav tsum tau ua (Ex: Txo Qhov Kub) thaum qhov kub nce ntau dua li tus nqi pib. Hauv qhov kev qhia no, Kuv tab tom siv AD22100 ntsuas lub ntsuas cua uas tsim los ntawm Cov Cuab Yeej Sib Piv thiab AG-1005G Buzzer. AD22100 yog Voltage Output Kub Sensor nrog Teeb Pom Kev Zoo

Kauj Ruam 1: Qhov Chaw

Koj xav tau cov ntu no nrog koj ua ntej pib qhov tsis tsim nyog los ua haujlwm

1. Arduino UNO Board

2. LCD Zaub (16x2)

3. Buzzer - 2 Pin (AC -1005G)

4. Kub Sensor - 3 Pin (AD22100)

Kauj Ruam 2: Kev Sib Txuas ntawm Qhov Sib Txawv Nrog Arduino UNO

LCD Txuas nrog Arduino UNO board

LCD RS Pin (Pin 4) nrog Pin 7 ntawm Arduino Board

LCD Pab Tus Pin (Pin 6) nrog Pin 8 ntawm Arduino Board

LCD D4 Pin (Pin 11) nrog Pin 9 ntawm Arduino Board

LCD D5 Pin (Pin 12) nrog Pin 10 ntawm Arduino Board

LCD D6 Pin (Pin 13) nrog Pin 11 ntawm Arduino Board

LCD D7 Pin (Pin 14) nrog Pin 12 ntawm Arduino Board

Ntxiv 10 KΩ Pot rau +5v (Pot Pin 1) thiab GND (Pot Pin 3), Txuas Nruab Nrab Tus Pin ntawm lauj kaub (Pot Pin 2) mus rau LCD V0 Pin (Pin 3).

LCD VDD Pin (Pin 2) thiab LCD A Pin (Pin 15) nrog +5v ntawm Arduino Board.

LCD VSS Pin (Pin 1) thiab LCD K Pin (Pin 16) nrog GND ntawm Arduino Board.

AD22100 Temp Sensor txuas nrog Arduino UNO Board

Pin 1 (V +) ntawm AD22100 yuav tsum txuas nrog +5 v ntawm Arduino Board.

Pin 2 (Vo) ntawm AD22100 yuav tsum txuas nrog Pin A1 ntawm Arduino Board.

Tus Pin 3 (GND) ntawm AD22100 yuav tsum txuas nrog GND ntawm Arduino Board

Buzzer (AC-1005G) Kev Sib Txuas nrog Arduino UNO Board

Pin 6 PWM tso tawm ntawm Arduino board yuav tsum txuas nrog +ve input ntawm Buzzer.

GND ntawm Arduino Board yuav tsum txuas nrog -v cov tswv yim ntawm Buzzer

Kauj ruam 3: Arduino Codes

Ua ke nws thiab muab tso rau ntawm Arduino Board thiab soj ntsuam Tsev Automation System demo

// Qhov program pib ntawm no

koj val;

int tempPin = A1;

int tus buzzer = 6;

#suav nrog LiquidCrystal lcd (7, 8, 9, 10, 11, 12);

void teeb tsa () {

// muab koj cov cai teeb tsa ntawm no, kom khiav ib zaug:

lcd.begin (16, 2);

lcd.clear ();

Serial.begin (9600);

tus pinMode (buzzer, OUTPUT);

}

lub voj void () {// muab koj cov cai tseem ceeb ntawm no, kom rov ua dua:

val = analogRead (tempPin); // AD22100 txuas nrog ntawm Pin A1

/*

*Rau 25C, val tuaj raws li 900 uas txhais tau tias

* 900 yog sib xws rau 1.9375 v

* Hloov ua haujlwm yog (V +/5) * (1.375 + 22.5 mv/degC * 25 degC), * Nyeem Cov Ntaub Ntawv ntawm AD22100

*/

ntab cel = ((((1.9375/900) * val) - 1.375)/22.5) * 1000;

ntab farh = (cel*9)/5 + 32;

Serial.print (tus nqi);

Serial.println ();

Serial.print (“TEMPRATURE =”);

Serial.print (cel); Serial.print (“*C”);

Serial.println ();

yog tias (cel> 26) {

suab (buzzer, 1000);

lcd.clear ();

lcd.print (“Temp siab dua qhov pib”);

lcd.setCursor (0, 1);

lcd.print ("Txo Temp");

}

lwm tus

{noTone (buzzer);

lcd.clear ();

lcd.print (“Temp tswj”);

lcd.setCursor (0, 1);

lcd.print (“Temp =”);

lcd.print (cel);

lcd.print (“degC”);

}

ncua (500);

}

// Qhov program xaus ntawm no

Kauj Ruam 4: Nkag Siab Qhov Kev Kawm Kom Paub Dua

Kuv yuav sim piav ob peb ntu ntawm txoj cai.

Cov haujlwm ntsig txog Yog/lwm nqe lus

Yog tias qhov ntsuas kub ntau dua li tus nqi pib, Kuv tab tom xa lub teeb liab mus rau lub suab nrov kom nrov lub tswb thiab tso tawm ntawm LCD kom txo qhov ntsuas kub nrog ntu hauv qab ntawm cov cai

yog tias (cel> 26)

{suab (buzzer, 1000);

lcd.clear ();

lcd.print ("Temp siab dua qhov pib");

lcd.setCursor (0, 1);

lcd.print ("Txo Temp");

}

Yog tias tsis yog tam sim no xa tus nqi tam sim no ntawm temp mus rau LCD thiab tso tawm qhov ntsuas ntawd yog tswj.

lwm tus

{noTone (buzzer);

lcd.clear ();

lcd.print (“Temp tswj”);

lcd.setCursor (0, 1);

lcd.print (“Temp =”);

lcd.print (cel);

lcd.print (“degC”);

}

Cov haujlwm muaj feem cuam tshuam nrog Buzzer

suab nrov (buzzer, 1000) - txoj haujlwm no yuav xa 1 khz teeb liab rau tus pin npe hu ua buzzer uas tau txhais ua tus Pin 6 thiab Sib nqus buzzer txuas nrog ntawm Pin 6.noTone (buzzer) - yuav tsum nres xa 1 khz teeb liab. Yog li ntawd, lub suab nrov yuav nres

Kev ua haujlwm ntsig txog Temp Sensor

Kev hloov pauv ntawm Analog tus nqi ntawm kev ntsuas kub mus rau deg C tus nqi tau ua tiav siv kev hloov pauv uas tuaj yeem nrhiav pom hauv AD22100 Cov Ntawv Teev Npe raws li sau hauv qab no.

Vout = (V +/5 V) × (1.375 V + 22.5 mV/° C × TA) thiab tus nqi zoo ib yam yog luam tawm ntawm cov zaub LCD.

Kauj Ruam 5: Demo ntawm Cov Lus Qhia

Thaum qhov kev zov me nyuam raug suav sau thiab muab tso rau ntawm Arduino UNO pawg thawj coj

cia peb sim ua kom lub siab nkag siab los ntawm lub ntsuas cua ntsuas AD22100 thiab txaus siab rau Lub Tsev Automation system.

Txhawm rau ua kom lub ntsuas kub nce ntxiv, kuv tab tom kov nws nrog cov hlau txuas muaj nyob hauv Lab.

Koj tuaj yeem saib qhov demo ntawm no..

Demo ntawm Tsev Automation System

Pom zoo: