Cov txheej txheem:

Tub Ceev Xwm Tsheb Arduino: 6 Kauj Ruam
Tub Ceev Xwm Tsheb Arduino: 6 Kauj Ruam

Video: Tub Ceev Xwm Tsheb Arduino: 6 Kauj Ruam

Video: Tub Ceev Xwm Tsheb Arduino: 6 Kauj Ruam
Video: Tub Ceev xwm tuaj ntsuas kwv Tshaj lij ua tsheb sib nraus tag sim neej mus zoo koj mog. 3/9/2023 2024, Hlis ntuj nqeg
Anonim
Tub Ceev Xwm Tsheb Arduino
Tub Ceev Xwm Tsheb Arduino

Nyob zoo thiab txais tos rau cov lus qhia no yuav ua li cas tsim koj tus kheej lub tsheb tub ceev xwm! Kuv tau txais kev tshoov siab los puag kuv CPT tom qab tub ceev xwm lub tsheb tom qab kuv tsim kuv tus kheej lub tsheb RC ib pliag rov qab xyoo tas los uas yog txoj hauv kev nkag mus rau kev tswj chaw deb. Lub sijhawm no txawm li cas los xij, nrog arduino nws zoo nkaus li tseem ceeb dua qub thiab tag nrho ntau qhov tseeb ntawm qhov haujlwm tsis yog rau kuv tab sis txhua tus neeg uas siv cov lus qhia no. Cov theem hauv qab no yuav coj koj los ntawm cov ntaub ntawv uas koj yuav xav tau rau lub coding thiab software ntawm lub tsheb.

Kauj Ruam 1: Kauj Ruam 1: Koj Cov Ntaub Ntawv

Kauj Ruam 1: Koj Cov Ntaub Ntawv
Kauj Ruam 1: Koj Cov Ntaub Ntawv

Cov ntaub ntawv thiab khoom siv xav tau rau txoj haujlwm no yuav yog cov hauv qab no:

Qty | Khoom siv

6 | 1 kOhm resistor

2 | red LED cov

2 | blue LED cov

1 | roj teeb (5volts)

1 | DC tsav

1 | Arduino UNO R3

1 | Piezo caij

1 | 250kOhm potentiometer

1 | NPE transistor

1 | Breadboard (yeem)

Kauj Ruam 2: Kauj Ruam 2: Ntxiv Tsav thiab Potentiometer

Kauj Ruam 2: Ntxiv Cov Tsav Tsheb thiab Potentiometer
Kauj Ruam 2: Ntxiv Cov Tsav Tsheb thiab Potentiometer

Ua ntej, koj yuav tsum txheeb koj cov ntaub ntawv kom huv si, ntxiv cov arduino thiab daim ntawv qhia zaub mov. Cov txheej txheem yuav tsum yog kab rov tav kom muaj chav txaus rau tas li ntawm txoj haujlwm. Qhov thib ob, ntxiv DC lub cev muaj zog, 1 tus tiv thaiv, lub zog loj nrog rau 5 lub roj teeb hauv. Tom ntej ntxiv NPN transistor hauv qhov sib xyaw. Ib feem txuas tom ntej yog cov thaiv uas yog qhov tseem ceeb thiab yuav tsum ua kom raug, qhov tsis zoo thiab qhov thaiv zoo los ntawm lub roj teeb mus rau lub cav thiab lub khob cij yog qhov tseem ceeb. Xyuas kom koj lub potentiometer muaj nws cov xov txuas raug los ntawm lub davhlau ya nyob twg thiab wiper lossis lwm yam nws yuav tsis ua haujlwm. Terminal 1 yuav tsum txuas nrog qhov tsis zoo, davhlau ya nyob twg 2 mus rau 5V tus pin hauv arduino thiab wiper rau tus pin A0. Thaum qhov no ua tiav kev txheeb xyuas NPN transistor kom paub tseeb tias nws muaj tus tiv thaiv ntxiv nrog rau thaiv qhov raug rau nws cov emitter thiab cov neeg sau khoom. (sau los ntawm dc lub cev muaj zog, emitter los ntawm lub roj teeb). Thaum kawg qhov seem ntxiv yog ntxiv cov hlua txuas rau tus pin 5 hauv arduino.

Kauj Ruam 3: Kauj Ruam 3: Software rau Tsav

Kauj Ruam 3: Software rau Tsav
Kauj Ruam 3: Software rau Tsav

Raws li pom hauv daim duab txuas, qhov no yog lub voj rau lub cav thiab lub zog ntsuas kom ua haujlwm tau zoo txawm li cas los xij nws xav tau ob lub ntsiab lus, ib qho txhais rau qhov tso tawm raws li nws yuav yog tus nqi qhia ntawm tus saib xyuas thiab ib qho txhais rau tus pin 5 uas yog lub cev muaj zog nws tus kheej.

Kauj Ruam 4: Kauj Ruam 4: Piezo thiab LED's

Tam sim no rau Piezo thiab LED's txoj hlua tsis muaj teeb meem ntau dua li yav tas los raws li txhua yam koj yuav tsum tau ua yog teeb tsa txoj kab tav toj, thiab ntxiv tus tiv thaiv rau sab anode ntawm LED's thiab khiav cov xov hlau rau tus pin 11 txog 8 (yog tias koj ua tsis xav siv tag nrho 4 leds, 2 tus pin thiab 2 leds tseem yuav tso saib tus qauv tsuas yog tsis ntsais tas li nrog lub suab ntawm piezo). Sab cathode yuav txuas rau GND tus pin hauv arduino. Tam sim no rau Piezo, ntxiv tus tiv thaiv rau qhov tsis zoo thiab khiav cov xov txuas rau tus pin 7 (Kuv tau ua qhov no raws li lub hom phiaj raws li muaj kev sib cais ntawm tus pin 8 thiab 7, qhov no ua rau xaim yooj yim pom raws li txhua tus LED pins nyob ntawm sab laug thiab lub cav thiab piezo nyob sab xis.)

Kauj Ruam 5: Kauj Ruam 5: Software rau Siren

Kauj Ruam 5: Software rau Siren
Kauj Ruam 5: Software rau Siren

Cov cai saum toj no muaj tag nrho cov lus pom thiab cov lus qhia twb tau pab koj ua qhov no ntawm koj tus kheej nrog rau nws qhia koj tias txoj cai ua haujlwm li cas. (Millisecond qeeb, thaum LED's tau qhib/tawm) Ntxiv rau txoj cai no, koj yuav tsum tau txhais tus pin 11-7 rau LED's thiab Piezo. Nco ntsoov sau koj lub voj thib ob lwm yam raws li feem ntau kuv ua yuam kev ntawm cov npe zoo ib yam thiab cov cai tsis ua haujlwm raug.

Kauj Ruam 6: Xav Tsim Nws Hauv Lub Neej? Nov Yog Qee Yam Lus Qhia

Xav Tsim Nws Hauv Lub Neej tiag? Nov Yog Qee Yam Lus Qhia
Xav Tsim Nws Hauv Lub Neej tiag? Nov Yog Qee Yam Lus Qhia

Yog tias koj xav tsim txoj haujlwm no rau koj tus kheej siv, nco ntsoov yuav cov khoom siv sib txuas nrog cov hlau txuas thiab xaim nrog rau cov hnab looj tes tiv thaiv thiab tsom iav. Nco ntsoov nco ntsoov tsis txhob nyob ncaj qha rau ntawm koj li haujlwm vim koj tuaj yeem nqus tau cov pa phem! Ua tib zoo saib xyuas vim tias cov laug tuaj yeem ncav cuag qhov kub siab heev thiab ib txwm ua haujlwm nyob rau hauv ib puag ncig zoo. Xyuas kom tag nrho koj cov xov hlau zoo thiab muaj peev xwm ua xim xim los pab koj txheeb xyuas nws yooj yim. Thaum kawg, qhov tseem ceeb tshaj plaws … muaj kev lom zem!

Pom zoo: