Cov txheej txheem:

Tswb Tswb Tswb Tswb Nrog Arduino: 9 Kauj Ruam (nrog Duab)
Tswb Tswb Tswb Tswb Nrog Arduino: 9 Kauj Ruam (nrog Duab)

Video: Tswb Tswb Tswb Tswb Nrog Arduino: 9 Kauj Ruam (nrog Duab)

Video: Tswb Tswb Tswb Tswb Nrog Arduino: 9 Kauj Ruam (nrog Duab)
Video: Hnub So Lawm Ua Yam Zaub Mov Special Rau You Tsev Neeg Noj. 2024, Hlis ntuj nqeg
Anonim
Image
Image
Tswb Tswb Tswb Nrog Arduino
Tswb Tswb Tswb Nrog Arduino

Lub caij ntuj no tuaj yeem tu siab. Koj sawv, tsaus ntuj thiab koj yuav tsum tau tawm ntawm txaj. Qhov kawg uas koj xav hnov yog lub suab nrov nrov ntawm koj lub tswb tswb. Kuv nyob hauv London thiab kuv muaj lub sijhawm nyuaj thaum sawv ntxov. Tsis tas li, kuv nco txog thaum sawv ntxov mus rau lub teeb pom kev.

Hauv qhov kev qhia no, peb tab tom tsim Tshav Tswb Tswb Tswb. Nws yog lub tswb moos zoo li lwm yam uas koj tuaj yeem teev teev thiab feeb uas koj xav kom sawv, tab sis nrog cov txiaj ntsig ntxiv ntawm kev siv lub teeb kom ci rau koj chav pw nyob rau lub sijhawm zoo li lub hnub tuaj kom koj sawv ntau dua.

Teeb hnub tuaj muaj nyob rau ntawm kev ua lag luam tab sis lawv tuaj yeem kim (tshawb nrawm ntawm Amazon rov qab cov khoom lag luam hauv range 100 ntau yam), tsis yooj yim thiab zoo rau kev saib xyuas. Peb yuav ua qee yam pheej yig dua thiab zoo dua.

Txhua ntu yuav raug teev nyob rau qib tom ntej. Txoj cai tuaj yeem rub tawm los ntawm kuv Github repo kub-hnub tuaj-moos. Txhua qhov kev kos duab thiab tsim cov ntaub ntawv rau rooj plaub muaj rau rub tawm ntawm qhov kev qhia no.

Peb mus:)

Yog tias koj ntsib teeb meem lossis xav hais nyob zoo, xa kuv kab [email protected] lossis ua raws kuv ntawm Instagram @celinechappert.

Kauj Ruam 1: Sib sau ua ke

Sib sau ua ke
Sib sau ua ke

Txhawm rau pib tawm, peb yuav siv lub moos raws li peb cov tswv yim thiab lub teeb ci ci ci tshaj plaws raws li peb cov zis los ua piv txwv peb hnub tuaj.

Txhawm rau tsim lub Circuit Court peb yuav xav tau:

- lub moos. Peb yuav siv RTC DS3231 (£ 5)

- MOSFET los tswj qhov ci ntawm lub teeb (£ 9)

- super-ci ntsa iab LED (£ 1)

- 9V roj teeb kom muaj zog rau LED (£ 3)

- lub khob cij rau kev sib dhos yooj yim (£ 3)

- Arduino Uno (£ 20)

- lub laub khawm (xaiv tau - rau lub hom phiaj xwb)

Tus nqi tag nrho = £ 41

Yog tias koj twb muaj Arduino, lub khob cij thiab lub roj teeb 9V nyob hauv tsev, tag nrho txoj haujlwm yuav raug nqi koj tsawg dua £ 15.

Txhawm rau ua cov ntaub ntawv acrylic koj yuav xav tau:

- 2 nplooj ntawv ntawm 0.3 hli Perspex acrylic nplooj ntawv, 1 nplooj ntawv xim rau lub hnub thiab rooj plaub.

- nkag mus rau laser-cutter.

Kuv muaj hmoo tau nkag mus rau kuv lub tsev kawm ntawv lub rooj cob qhia yog li cov nqi no tau them rau feem ntau. Kuv tau yuav ib daim ntawv ntxiv ntawm acrylic vim tias kuv tus qauv tsim kom muaj xim daj rau lub hnub, uas raug nqi £ 14/ntawv (Perspex kim heev!).

Kauj Ruam 2: Sib dhos Circuit

Image
Image
Sib dhos Circuit Court
Sib dhos Circuit Court
Sib dhos Circuit Court
Sib dhos Circuit Court

Koj tuaj yeem xa mus rau daim duab dub & dawb ntawm kuv lub voj voog (thov zam txim qhov tsis meej pem) thiab rau daim duab qhia txog Arduino (ua tiav nrog Fritzing).

Qhov tseem ceeb ntawm no yog kev rhuav tshem ntawm qhov txuas nrog dab tsi:

Moos:

(-) txuas rau GND

NC sawv rau 'Tsis Txuas' thiab tsis txuas rau ib yam dab tsi

C/SCL txuas rau tus pin A5 ntawm Arduino

D/SDA txuas rau tus pin A4 ntawm Arduino

(+) txuas rau 5V ntawm Arduino

MOSFET

Lub rooj vag tus pin mus rau tus pin ~ 9 ntawm Arduino Uno vim tias nws yog PWM

Tus pin ntws mus rau qhov tsis zoo ntawm LED

Tus lej tus lej nkag mus rau GND ntawm Arduino

LED

Qhov tsis zoo txuas nrog txuas tus pin ntawm MOSFET

Qhov zoo yog txuas nrog 5V ntawm lub khob cij

9V roj teeb

(+) rau (+) ntawm lub khob cij, ib yam nrog (-).

Arduino Ib

Nco ntsoov txuas 5V rau (+) ntawm lub khob cij thiab GND rau (-). Nco ntsoov txuas (-) ntawm ib sab ntawm lub khob cij rau (-) ntawm lwm sab.

Tom ntej no peb yuav teeb tsa peb lub moos siv lub tsev qiv ntawv DS3231.

Kauj Ruam 3: Txhim Kho thiab Teeb Meem

Txhim Kho thiab Teeb Meem
Txhim Kho thiab Teeb Meem
Txhim Kho thiab Teeb Meem
Txhim Kho thiab Teeb Meem
Txhim Kho thiab Teeb Meem
Txhim Kho thiab Teeb Meem

Lub tsev qiv ntawv uas kuv siv los khiav lub moos no tuaj yeem nrhiav tau ntawm Rinky-Dink Electronics (cov duab saum toj no). Nyem rau ntawm qhov txuas thiab xyuas kom tseeb tias koj nyob ntawm DS3231 nplooj ntawv. Rub tawm cov ntawv zip, khaws nws thiab muab tso rau hauv koj li Arduino's /libraries folder.

Tam sim no teeb tsa lub sijhawm kom raug ntawm lub moos, qhib Arduino thiab mus rau Piv Txwv/DS3231/Arduino/DS3231_Serial_Easy.

Tsis suav nrog peb kab ntawm txoj cai (hais hauv kab lus txiv kab ntxwv hauv lub vijtsam), txheeb xyuas lub sijhawm thiab qhov chaw uas raug lub sijhawm nyob hauv peb kab ntawm cov cai hauv hom tub rog.

Nias Upload.

Tam sim no koj tuaj yeem tsis txaus siab rau peb kab thiab nias Upload dua.

Qhib koj li Serial Monitor thiab txheeb xyuas tias koj lub sijhawm raug lawm.

Peb lub moos tau teeb tsa! Peb muaj peb lub voj voog, tam sim no cia peb pib coding. Ib zaug ntxiv, cov repo muaj nyob ntawm Github.

Kauj ruam 4: Coding

Image
Image

Rub tawm cov cai thiab xyuas kom lub tsev qiv ntawv rau DS3231 raug teeb tsa raug.

Ua ntej tshaj peb xav txheeb xyuas peb cov chaw.

fadeTime yog ntev npaum li cas lub teeb yuav ploj los ntawm 0 mus rau nws qhov ci tshaj plaws hauv feeb. setHour/setMin sib haum rau lub sijhawm peb xav kom sawv los (ceeb toom: qhov no nyeem cov ntawv ua tub rog, yog li yuav tsum muaj 24 teev sijhawm). Peb kuj tseem txhais tus pin 9 ntawm Arduino ua peb li OUTPUT.

Hauv kev teeb tsa (), nco ntsoov SerialBegin tus lej (ntawm no 96000 baud) sib raug rau Serial Monitor tus lej.

Hauv lub voj (), yog tias nqe lus txheeb xyuas seb nws yog lub sijhawm sawv los. Txoj cai sau ntawm lub voj, txheeb xyuas txhua lub sijhawm yog teev thiab feeb qhov txiaj ntsig rov qab los ntawm lub moos sib xws rau peb cov setHour/setMin hloov pauv. Yog tias qhov xwm txheej, yog tias nqe lus rov qab ua haujlwm () muaj nuj nqi.

Kev ua haujlwm nquag () ua los ntawm ob ntu. Ua ntej peb pib fading lub teeb maj mam: qhov kev ua haujlwm qeeb nyob ntawm no txhawm rau tiv thaiv LED los dhau los ua qhov ci dhau sai sai nyob rau theem 'ntxov' ntawm fadeTime. Tom qab ntawd rau lub voj tswj hwm qhov nrawm uas lub teeb yuav tsum ci dua thiab ci dua nyob ntawm qhov fadeTime. Thaum kawg, peb kaw lub teeb tawm los ntawm kev dhau tus nqi 0 rau peb cov LED hauv analogWrite () ua haujlwm.

Cov vis dis aus saum toj no qhia txog kev ua haujlwm hauv ib ntawm ib qho ntawm cov qauv acrylic.

Kauj Ruam 5: Daim Ntawv Qhia Txog Tus Qauv (xaiv tau)

Cardboard Prototype (yeem)
Cardboard Prototype (yeem)
Cardboard Prototype (yeem)
Cardboard Prototype (yeem)

Ua ntej rau txoj haujlwm no, Kuv tsis tau ua haujlwm nrog lub tshuab txiav laser. Ua daim ntawv qhia ntawv ua rau kuv tau paub txog lub tshuab thaum ntsuas seb lub hom phiaj zoo li cas (qhov loj me, saib zoo li cas) hauv qhov chaw tiag. Cov phiaj xwm phiaj xwm rub tawm.

Pom zoo: