Tsab xov xwm piav qhia txog cov khoom siv hluav taws xob xws li cov xa tawm, piav qhia txog nws ua haujlwm li cas, thiab tseem sib tham txog kev sib txuas ntawm ib qho qauv nrog ob-channel DC hloov txuas mus rau Arduino siv piv txwv ntawm kev tswj cov LEDs.
Tsim nyog
- - Module nrog relay;
- - Arduino;
- - 4 LEDs ntawm cov xim sib txawv;
- - 4 resistors nrog tsis kam ntawm 220 Ohm;
- - khoos phis tawm nrog Arduino IDE ib puag ncig kev loj hlob;
- - txuas xov hlau.
Cov Lus Qhia
Kauj ruam 1
Hauv qhov xwm txheej feem ntau, ib qho kev xa tawm yog qhov khoom siv hluav taws xob rau kaw thiab qhib qhov hluav taws xob. Hauv cov ntawv tshaj tawm, cov relay muaj ib qho hluav taws xob uas tswj hwm qhib lossis kaw ntawm cov neeg. Raws li kev faib tawm, cov relays kaw thiab qhib, hloov chaw, ib leeg-channel, multichannel, DC lossis AC relays, thiab lwm yam.
Kauj ruam 2
Peb yuav siv ib qho qauv siv nrog ob qhov txuas mus, hom SRD-05VDC-SL-C. Hom kev sib txuas no muaj peb qhov kev sib txuas rau kev sib txuas lub nra: ob lub ntsuas ruaj khov, thiab hauv nruab nrab ib qho hloov mus. Nws yog txoj kev sib txuas hauv nruab nrab uas yog ib hom ntawm "qhov tseem ceeb" uas ua haujlwm ntawm kev ncig hauv ib txoj kev lossis lwm qhov.
Kauj ruam 3
Qhov qauv no tuaj yeem siv los ntawm Arduino board nrog voltage ntawm 5 V, thiab txhua cov channel yog tswj ntawm nws tus kheej.
Los ntawm kev thov voltage rau cov tswj kev sib chwv, peb yuam txoj kev hloov pauv mus. Txhawm rau ua kom pom thiab nkag siab zoo dua qhov no, cia peb muab sib txuas ua ke Circuit Court raws li pom hauv daim duab.
Kauj ruam 4
Cia sau li sketch. Peb yuav hloov kho lub teeb ci ntawm khub ntawm LED ntawm tib xim, thiab txhua qhov thib ob hloov mus rau khub ntawm xim sib txawv.
Kauj ruam 5
Tam sim no cia peb xa cov duab kos rau hauv Arduino nco. Qhov no yog yuav ua li cas nws txhua qhov zoo.