Cov txheej txheem:

Txoj Kev Ntshav Qab Zib Kev Ntsuas Kub & Tus Neeg Cuam Tshuam: 5 Kauj Ruam
Txoj Kev Ntshav Qab Zib Kev Ntsuas Kub & Tus Neeg Cuam Tshuam: 5 Kauj Ruam

Video: Txoj Kev Ntshav Qab Zib Kev Ntsuas Kub & Tus Neeg Cuam Tshuam: 5 Kauj Ruam

Video: Txoj Kev Ntshav Qab Zib Kev Ntsuas Kub & Tus Neeg Cuam Tshuam: 5 Kauj Ruam
Video: Tus Neeg Ruam - R-Lin Thoj | New Song [ Official MV ] Nkauj Tawm Tshiab 2023 Hmong Song 2023 2024, Hlis ntuj nqeg
Anonim
Kev Ntsuas Hluav Taws Xob Kev Ntsuas Kub & Cov Neeg Cuam Tshuam
Kev Ntsuas Hluav Taws Xob Kev Ntsuas Kub & Cov Neeg Cuam Tshuam

Lub Hom Phiaj:

Kub: Cov lus qhia no yuav qhia koj li cas teeb tsa thiab teeb tsa Arduino RedBoard (siv MATLAB) txhawm rau txheeb xyuas qhov kub ntawm txoj kev tsheb ciav hlau. Thaum qhov ntsuas kub tsis nyab xeeb rau cov neeg caij tsheb, cov lus ceeb toom suab nrov, lub suab nrov nrov tawm, thiab cov lus ceeb toom teeb tsa.

Neeg Txheeb Ze Cov Neeg Tuaj: Qhov no yuav qhia koj yuav siv lub pob li cas txhawm rau suav cov neeg caij tsheb thiab hais lus ceeb toom thaum muaj peev xwm tshaj plaws.

Nta:

  • Siv Khawm kom suav cov neeg caij tsheb nkag los hauv tsheb ciav hlau
  • Siv TMP36 (ntsuas kub) txhawm rau txheeb xyuas qhov kub ntawm txoj kev tsheb ciav hlau
  • Siv Lub Teeb Liab LED ceeb toom rau chaw nres tsheb ciav hlau
  • Siv buzzers los ua lub tswb nrov
  • Xa email ceeb toom nrog cov phiaj xwm kub thiab lub sijhawm
  • Pop-up lus ceeb toom ntawm MATLAB

Kauj Ruam 1: Cov Khoom Siv thiab Cov Khoom Siv

Cov Ntaub Ntawv thiab Cov Khoom Siv
Cov Ntaub Ntawv thiab Cov Khoom Siv
  • 1 Laptop
  • NTSE 2017
  • Rub tawm Arduino Toolbox
  • Sparkfun RedBoard
  • 1 Fais Fab Cable
  • Breadbord
  • 14 cev
  • 1 Piezo Buzzer
  • 1 Laub Khawm
  • 2 10k ohm resistors
  • 1 TMP36 sensor
  • Liab LED teeb
  • 3D luam ntawv kos npe (yeem)

Kauj ruam 2: Teeb tsa Pawg Thawj Coj

Rooj Teeb
Rooj Teeb

Ua raws li teeb tsa saum toj no

Kauj Ruam 3: Sau Txoj Cai

Thaum Loop: Kom ntseeg tau tias cov cai txuas ntxiv ntsuas qhov ntsuas kub thiab nkag siab qhov xwm txheej khawm (nias lossis tsis nyuab siab), peb tso cov cai hauv lub voj thaum lub sijhawm tshwj xeeb.

Siv TMP36: Peb txiav txim siab qhov kub los ntawm kev nyeem qhov hluav taws xob thiab hloov nws mus rau degrees Fahrenheit, siv kev hloov pauv. Tom qab ntawd, peb siv cov lus hais los ua suab nrov thiab suab/xa lus ceeb toom yog tias qhov kub siab dua lossis sib npaug rau qhov ntsuas kub siab tshaj

Siv Khawm: Nrog rau cov lus hais, peb tuaj yeem sim yog tias lub pob raug nias siv readDigitalPin. Cov lus txib no yuav rov qab Boolean (1 lossis 0). Yog tias cov lus teb yog 0, tom qab ntawd lub pob tau raug nias thiab lub txee ntawm cov neeg caij tsheb nce thiab nthuav tawm cov lus txais tos. Tom qab ntawd, thaum mus txog qhov muaj peev xwm tshaj plaws, cov lus ceeb toom tau hnov.

Kauj Ruam 4: Luam Cov Cai

%Cov tswv yim: Thawb lub pob, ntsuas kub

%Cov txiaj ntsig: teeb, buzzers, ceeb toom suab, email, duab kab

Lub Hom Phiaj: Cov khoom no yog tsim los pab kom muaj kev nyab xeeb thiab kev nplij siab ntawm %cov neeg caij tsheb taug kev los ntawm tsheb ciav hlau hla hiav txwv.

%Kev Siv: Txheeb xyuas tus naj npawb ntawm cov neeg caij tsheb siv lub laub khawm, thiab %txheeb xyuas cov cua sov siv lub ntsuas kub thiab teeb duab nws thiab xa ob %tus neeg caij npav thiab lub ntsuas kub mus rau chaw nres tsheb ciav hlau

configurePin (a, 'D2', 'rub tawm'); %nyob rau yav tom ntej tshaj tawm siv configurePin

sijhawm = 200;

e = 0;

x = 0 os

thaum lub sijhawm> 0

button_status = readDigitalPin (a, 'D2'); % sib npaug xoom thaum khawm raug thawb, txwv tsis pub sib npaug 1

voltage = readVoltage (a, 'A0');%tus pin nyob ntawm qhov chaw peb tso nws

tempCelcius = (voltage*100) -50; %muab rau hauv phau ntawv ntsuas

tempF (lub sijhawm) = (tempCelcius*1.8) +32 %paub cov qauv kev hloov pauv

max = 120; %qib F

writeDigitalPin (a, 'D11', 1);

cov = mod (e, 2);

yog tempF (sijhawm)> = max

writeDigitalPin (a, 'D11', 0);

writeDigitalPin (a, 'D9', 1);

playTone (a, 'D9', 2400,.5)

ncua (.5)

writeDigitalPin (a, 'D6', 1)

playTone (a, 'D6', 1000,.5)

ncua (.5)

writeDigitalPin (a, 'D9', 1);

playTone (a, 'D9', 2400,.5)

ncua (.5)

writeDigitalPin (a, 'D6', 1)

playTone (a, 'D6', 1000,.5) %ua si "siren"

z = 'Overheat.m4a'; %Qhov no tso lub suab ntawv rau hauv qhov sib txawv

[cov ntaub ntawv, freq] = audioread (z); %Qhib cov ntaub ntawv los ntawm cov ntaub ntawv suab

o = audioplayer (cov ntaub ntawv, zaus); %Tsim lub hom phiaj los tswj kev ua si ntawm cov ntaub ntawv audio

o.play () %Plays audio file

o.playblocking () %Plays cov ntaub ntawv thiab tos kom nws ua tiav

kawg

yog button_status == 0 && rem == 0

e = e+1

msgbox ('Zoo Siab Txais Tos!');

elseif button_status == 0 && rem == 1

e = e+1

msgbox ('Bienvenido a bordo!');

kawg

os e == 5

writeDigitalPin (a, 'D11', 0);

os x == 0

playTone (a, 'D6', 600, 1);

s = 'Ceeb Toom_EF.m4a'; %Qhov no tso lub suab ntawv rau hauv qhov sib txawv

[cov ntaub ntawv, freq] = audioread (s); %Qhib cov ntaub ntawv los ntawm cov ntaub ntawv suab

o = audioplayer (cov ntaub ntawv, zaus); %Tsim lub hom phiaj los tswj kev ua si ntawm cov ntaub ntawv audio

% o.play () % Plays audio file

o.playblocking () %Plays cov ntaub ntawv thiab tos kom nws ua tiav

msgbox ('Max Peev Xwm')

x = 4x+1

kawg

elseif e> = 6

playTone (a, 'D6', 2400, 0);

kawg

sijhawm = sijhawm - 1;

% ncua (0.1);

% yog e == 5 && max (tempF)> = 120

% sijhawm = 0

% kawg

kawg

ee = num2str (e)

t = [1: 200];

tempF2 = fliplr (tempF);

phiaj (t, tempF2);

lub npe ('Sijhawm vs. Kub')

ylabel ('Kub (F)')

xlabel ('Sijhawm (s)'))

saveas (gcf, 'tempplot.jpg')

xa = '[email protected]'

lo lus zais = 'Srsora123#'

tus tswv = 'smtp.gmail.com'

setpref ('Internet', 'SMTP_Server', tus tswv tsev);

setpref ('Internet', 'E_mail', xa ntawv);

setpref ('Internet', 'SMTP_Username', xa ntawv);

setpref ('Internet', 'SMTP_Password', password);

cov khoom = java.lang. System.getProperties;

props.setProperty ('mail.smtp.auth', 'tseeb');

props.setProperty ('mail.smtp.socketFactory.class', 'javax.net.ssl. SSLSocketFactory');

props.setProperty ('mail.smtp.socketFactory.port', '465');

xa email (xa ntawv, 'Nyob Zoo Chaw Nres Tsheb! Muaj ntau tus neeg caij tsheb ciav hlau', ee, 'tempplot.jpg')

Kauj Ruam 5: Cov txiaj ntsig

Pom zoo: