Cov txheej txheem:

Kev Nyab Xeeb Zoo dua: Ua Cov Tsheb ciav hlau Kev Nyab Xeeb: 7 Cov Kauj Ruam
Kev Nyab Xeeb Zoo dua: Ua Cov Tsheb ciav hlau Kev Nyab Xeeb: 7 Cov Kauj Ruam

Video: Kev Nyab Xeeb Zoo dua: Ua Cov Tsheb ciav hlau Kev Nyab Xeeb: 7 Cov Kauj Ruam

Video: Kev Nyab Xeeb Zoo dua: Ua Cov Tsheb ciav hlau Kev Nyab Xeeb: 7 Cov Kauj Ruam
Video: Phooj Ywg Luag Neej Zoo Tag - Tsom Xyooj Hmong New Song [Toj Roob Siab] nkauj tawm tshiab 2023 2024, Hlis ntuj nqeg
Anonim
Kev Nyab Xeeb Zoo dua: Ua Cov Tsheb ciav hlau Kev Nyab Xeeb
Kev Nyab Xeeb Zoo dua: Ua Cov Tsheb ciav hlau Kev Nyab Xeeb

Ntau lub chaw tsheb ciav hlau niaj hnub no tsis nyab xeeb vim tsis muaj kev nyab xeeb, teeb meem, thiab ceeb toom ntawm lub tsheb ciav hlau los rau hauv. Peb pom qhov xav tau uas yuav tsum tau kho. Txhawm rau daws qhov teeb meem no peb tsim Kev Nyab Xeeb Zoo. Peb siv cov ntsuas kev co, ntsuas lub suab, thiab lub tswb ceeb toom xwm txheej ceev ntawm Arduino Uno txhawm rau ntxiv kev nyab xeeb rau chaw nres tsheb ciav hlau.

Cov Khoom Siv Xav Tau:

  • Arduino Ib
  • Jumper Hlau
  • PIR Tsab ntawv tsa suab Sensor
  • Piezo Kev co Sensor
  • LCD Screen
  • Piezo Hais Lus
  • Hloov Lub Cev
  • Mos Potentiometer
  • 330 ohm tiv thaiv

Los ntawm: Jacob Wimmer, Olivia Crawley, Jin Kim

Kauj Ruam 1: Hlau Rooj Tswjhwm Saib

Hlau Board
Hlau Board

Peb txuas peb Arduino zoo li daim duab saum toj no.

Kauj Ruam 2: 3D Luam LCD Zaub

3D Luam LCD Zaub
3D Luam LCD Zaub

Peb 3D luam tawm sawv rau peb lub vijtsam LCD kom pom kev zoo dua.

Kauj Ruam 3: Txuas rau Arduino hauv Matlab

Thawj kauj ruam los sau peb cov cai yog txuas peb Arduino board rau Matlab. Qhov no yog ua tiav los ntawm kev tsim cov khoom Arduino. Peb siv cov cai hauv qab no:

a = arduino ('/dev/tty.usbmodem14201', 'Uno', 'qiv', 'Piv txwvLCD/LCDAddon');

Kauj Ruam 4: Sau Code hauv Matlab

Peb tsim ib txoj haujlwm hauv Matlab los khiav peb Arduino. Tom qab pib peb lub vijtsam LCD, peb tau sau cov cai los tswj peb lub chaw nres tsheb ciav hlau. Peb siv cov tswv yim xws li lub ntsuas kev co, lub suab txav txav, thiab lub cev hloov pauv los tsim ntau yam kev tso tawm. Cov tswv yim no, cov txiaj ntsig, thiab cov lej sib xws yuav piav qhia hauv cov theem hauv qab no.

Kauj Ruam 5: Kev Ruaj Ntseg Sensor

Kev co Sensor
Kev co Sensor

Lub ntsuas kev co yog qhov ntsuas sib piv thiab yog li siv Matlab ua haujlwm nyeem Voltage.

val_vibro = readVoltage (a, 'A0'); T

nws nyeem Kev ua haujlwm hluav taws xob rov qab los ntawm ntau qhov txiaj ntsig, tab sis peb txiav txim siab tias tus nqi siab dua 0.5 yog qhov tsim nyog kev co thiab yog li peb siv qhov ntawd raws li peb tus nqi pib. Yog tias qhov hluav taws xob siab dua 0.5, nws txhais tau tias lub tsheb ciav hlau tab tom los rau hauv chaw nres tsheb. Thaum tus nqi no tau tshawb pom cov lus xa mus rau lub vijtsam LCD. Cov lus ntawm lub vijtsam LCD yog ib txoj hauv kev sib txuas lus rau tib neeg ntawm chaw nres tsheb tias lub tsheb ciav hlau tab tom los.

Peb tau sau ntawm peb lub vijtsam LCD siv cov cai hauv qab no:

yog val_vibro <= 0.5;

elseif val_vibro> 0.5;

printLCD (lcd, 'Qhia Hauv 3 Min');

kawg

Kauj Ruam 6: PIR Motion Sensor

PIR Tsab ntawv tsa suab Sensor
PIR Tsab ntawv tsa suab Sensor
PIR Tsab ntawv tsa suab Sensor
PIR Tsab ntawv tsa suab Sensor
PIR Tsab ntawv tsa suab Sensor
PIR Tsab ntawv tsa suab Sensor

PIR tsab ntawv tsa suab sensor siv los xyuas kom tus neeg teb xov tooj paub txog cov teeb meem raws txoj kev tsheb ciav hlau. Lub ntsuas ntsuas ntsuas cov duab thiab sib piv daim duab tshiab tshaj plaws rau qhov kawg uas tau thaij thiab yog tias ib yam dab tsi tau txav mus Matlab yuav rov qab tus nqi ntawm 1. Thaum qee yam raug kuaj pom ntawm cov ciav hlau ib tus neeg siv graphical interface (GUI) tshwm tuaj ceeb toom rau tus neeg caij tsheb ciav hlau tias qee yam yog ntawm cov ciav hlau. Tus neeg teb xov tooj muaj qhov kev xaiv nres tsheb ciav hlau lossis txuas ntxiv mus. Tom qab xaiv qhov kev xaiv uas xav tau, cov lus pom zoo tau tshwm sim.

Cov cai hauv qab no tau siv rau qhov ntsuas lub suab:

yog val_opt == 1;

d1 = 'Ib qho khoom raug kuaj pom ntawm cov ciav hlau hauv chaw nres tsheb';

op_input = questdlg (d1, 'Tus Neeg Teb Xov Tooj', 'Nres Tsheb nqaj hlau', 'Khaws Tsiv', 'Tsiv Mus Ntxiv');

b1 = strcmp (op_input, 'Nres tsheb ciav hlau');

b2 = strcmp (op_input, 'Keep Moving');

yog b1 == 1

msgbox ('Tsheb nqaj hlau nres')

ncua (3)

elseif b2 == 1

msgbox ('Tsheb ciav hlau txuas ntxiv')

ncua (3)

kawg

elseif val_opt == 0;

kawg

Kauj Ruam 7: Hloov Lub Cev

Peb kuj xav tias cov chaw nres tsheb ciav hlau yuav tsum muaj kev nyab xeeb ntxiv. Peb txiav txim siab kom muaj qhov hloov pauv uas yuav ua lub tswb nrov ntawm lub chaw nres tsheb. Peb tau ua qhov no los ntawm kev siv lub cev hloov pauv. Thaum qhov kev hloov no tau qhib lub tswb nrov los ntawm tus hais lus.

Peb tau ua qhov no nrog cov cai hauv qab no:

yog s_val == 1 rau kuv = 1:10

playTone (a, 'D10', 1800, 1)

ncua (.1)

playTone (a, 'D10', 2000, 1)

ncua (.1)

kawg

kawg

Pom zoo: