Cov txheej txheem:

Teeb Lub Sijhawm rau Cov Menyuam - Ntsuab Txhais Mus! Liab, Nyob Hauv BED !!!: 5 Kauj Ruam (nrog Duab)
Teeb Lub Sijhawm rau Cov Menyuam - Ntsuab Txhais Mus! Liab, Nyob Hauv BED !!!: 5 Kauj Ruam (nrog Duab)

Video: Teeb Lub Sijhawm rau Cov Menyuam - Ntsuab Txhais Mus! Liab, Nyob Hauv BED !!!: 5 Kauj Ruam (nrog Duab)

Video: Teeb Lub Sijhawm rau Cov Menyuam - Ntsuab Txhais Mus! Liab, Nyob Hauv BED !!!: 5 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Teeb Lub Sijhawm rau Cov Menyuam - Ntsuab Txhais Mus! Liab, Nyob hauv BED !!!
Teeb Lub Sijhawm rau Cov Menyuam - Ntsuab Txhais Mus! Liab, Nyob hauv BED !!!
Teeb Lub Sijhawm rau Cov Menyuam - Ntsuab Txhais Mus! Liab, Nyob hauv BED !!!
Teeb Lub Sijhawm rau Cov Menyuam - Ntsuab Txhais Mus! Liab, Nyob hauv BED !!!

Peb tau vwm tsis tsaug zog txaus !!! Peb tus menyuam hnub nyoog 2 xyoos tsis tuaj yeem nkag siab yuav ua li cas "tos rau 7" ntawm lub moos ua ntej tawm ntawm nws chav thaum sawv ntxov tom qab sawv ntxov. Nws yuav sawv ntxov (Kuv txhais tau tias zoo li 5:27 teev sawv ntxov - "muaj 7 !!!" nws tau hais) thiab tsuas yog xav tias lub sijhawm sawv ntxov, tawm ntawm nws chav, thiab tsaug zog rau hnub ntawd. Txij li hnub nyoog 2-4 muaj lub sijhawm nyuaj nyeem lub moos, lub teeb pom kev yooj yim no yog qhov kev daws teeb meem loj rau peb cov teeb meem !!!

GREEN txhais tau tias mus !!! RED, Nyob twj ywm hauv BED !!! Qhov yooj yim, pheej yig Arduino lub sijhawm tiag tiag tuaj yeem teeb tsa teeb pom kev zoo ntawm txhua lub sijhawm tsim nyog. Rau peb uas txhais tau tias thaum 6:00 teev sawv ntxov nws hloov RED, Nyob twj ywm hauv BED. Tom qab 10 feeb ua ntej 7:00 teev sawv ntxov nws hloov YELLOW muab qhov taw qhia nws yuav luag txog lub sijhawm yuav tawm los thiab ua si hauv koj chav. Tom qab ntawd thaum 7:00 teev sawv ntxov … "Lub teeb yog GREEN !!!", nws hais tias, thaum nws tawg mus rau hauv peb chav txhua tag kis tsis ntxov tshaj 7:00 teev sawv ntxov. Dab tsi yog tus cawm seej !!!

Kauj Ruam 1: Sau cov Khoom

Sau Cov Khoom
Sau Cov Khoom

Qhov

  • 1 x Arduino Nano ($ 2.70 ntawm AliExpress)
  • 1 x DS1307 Lub Sijhawm Tiag ($ 0.60 ntawm AliExpress)
  • 1 x Ob Chav Ob tog Tsab Cai Thawj Coj ($ 1.45 rau 5 ntawm AliExpress)
  • 1 txhua Ntsuab, Liab, Daj 5mm LED ($ 0.94 rau 100 ntawm AliExpress)
  • 1 txhua 270 Ohm, 680 Ohm, 1K Ohm Resistors ($ 2.35 rau 600 ntau yam ntawm AliExpress)
  • Cov Ncaws Pob Ncaws Pob Ncaws Pob Dawb ($ 1 Walmart lossis khw duas las)
  • Laub Teeb lossis 3-4 AA lub roj teeb tuav ($ 1 Khw Muag Khoom lossis $ 0.50 ntawm AliExpress)

Cov cuab yeej

  • Soldering Iron thiab Solder
  • Tsis Siv Neeg Breadboard
  • Hlau thiab Jumper Hlau
  • Phom phom

Nco tseg: Qhia kom tau Suav Nano Tsav Tsheb ua haujlwm:)

Kauj ruam 2: Teeb Meem

Teeb Meem
Teeb Meem
Teeb Meem
Teeb Meem
Teeb Meem
Teeb Meem

DS1307 RTC zoo li lub moos thiab siv lub roj teeb ua haujlwm thiab khaws sijhawm txawm tias thaum Arduino poob lub zog lossis rov pib dua. RTC siv I2C interface los tham nrog Arduino. SCL (moos) txuas nrog A5 thiab SDA (cov ntaub ntawv) txuas nrog A4. RTC ua tau zoo tshaj plaws nrog 5V rau VCC tab sis kuv pom nws ua haujlwm zoo ntawm 3.3V.

  • Siv lub khob cij, sib txuas lub Sijhawm Tiag rau Arduino raws li cov txheej txheem.
  • Tom ntej no, rub tawm DS1307RTC Library ntawm github ntawm no lossis hauv cov ntawv txuas.

    Yog tias koj tsis tau rub lub tsev qiv ntawv, nyem "Clone lossis rub tawm" thiab xaiv "Download ZIP" xaiv

  • Ntshuam lub tsev qiv ntawv rau hauv Arduino Editor los ntawm kev xaiv "Ntshuam" thiab xaiv ZIP.
  • Tom ntej no, rub tawm qhov txuas Program_Clock_RTC.ino kos duab thiab ntsaws zoo ib yam rau hauv tus khoos phis tawj.
  • Teem hnub/sijhawm tam sim no hauv daim duab kos thiab ua haujlwm qhov program kom teev sijhawm.
  • Txheeb xyuas lub sijhawm raug rov qab los.

Nrog koj zoo siab !! Tam sim no koj muaj sijhawm ua haujlwm !!

Kauj Ruam 3: Ntxiv LEDs thiab Programming

Ntxiv cov LEDs thiab Programming
Ntxiv cov LEDs thiab Programming
Ntxiv cov LEDs thiab Programming
Ntxiv cov LEDs thiab Programming

LED Xeem

Tam sim no, nqes cov LEDs thiab cov tiv thaiv raws li cov txheej txheem.

Rub lub Light_Up_Clock_for_Kids.ino kos duab thiab rub tawm. Hauv lub voj koj yuav pom cov lus hais tawm "setLEDs (tm. Hour, tm. Minute);" muaj nuj nqi thiab tsis ua raws li hauv qab no "testLEDs ();" muaj nuj nqi uas mus los ntawm txhua LED rau 8 vib nas this.

Txheeb xyuas kev caij tsheb kauj vab los ntawm LEDs ua haujlwm thiab tsis suav nrog cov kab ntawv txuas. Yog tias koj xav tau txhawm rau txheeb xyuas RTC tseem tab tom tawm lub sijhawm raug.

Programming Lub Sijhawm

Thaum koj txheeb xyuas txhua yam ua haujlwm, tsis pom zoo txog teeb tsa teeb tsa () ua haujlwm thiab tawm tswv yim tawm qhov kev xeem LEDs (). Hauv cov teeb LEDs () lub cev ntawm txoj haujlwm teeb tsa lub sijhawm koj xav pom cov xim sib txawv raws li qhov piv txwv.

NCO TSEG: Tej zaum koj yuav tsum tau ua si ib puag ncig nrog tus tiv thaiv qhov tseem ceeb kom tau txais lub teeb ci zoo rau koj cov LEDs (thiab tseem lub zog kos uas koj xav tau). Kuv pom cov haujlwm hauv qab no zoo rau kuv 5mm LEDS txij li Green muaj qhov siab tshaj plaws rau qhov hluav taws xob thiab yog qhov ci tshaj plaws ib txwm muaj, tom qab dimmer rau lwm yam xim:

  • Ntsuab: 1K Ohm
  • Daj: 680 Ohm
  • Liab: 270 Ohm

Kauj Ruam 4: Tsim Lub Teeb Teeb

Tsim Lub Teeb Teeb
Tsim Lub Teeb Teeb
Tsim Lub Teeb Teeb
Tsim Lub Teeb Teeb
Tsim Lub Teeb Teeb
Tsim Lub Teeb Teeb
Tsim Lub Teeb Teeb
Tsim Lub Teeb Teeb

Kev xaiv

Txhawm rau kom nthuav lub teeb tawm LEDs tawm kuv tau sim ob peb qhov nruab nrab sib txawv los thaiv lub teeb. Nrog rau qib sib txawv ntawm qhov ua tau zoo Kuv tau sim Push Button (LEDs xaus rau ze heev kom nthuav dav zoo), Mason Jar nrog daim ntawv parchment lossis glitter kua nplaum pleev xim rau sab hauv, thiab khob chaw ncaws pob dawb. Koj xav tau qee yam los nthuav lub teeb thiab txo qhov hnyav ntawm LEDs kom muab muag, txawm tias ci.

Kev Xaiv Zoo Tshaj

Kuv pom lub khob dawb chaw ncaws pob yooj yim ($ 1 rau 3) nrog cov ntawv ciab kaw rau sab hauv (raws li qhia) muab tawm txawm tias lub teeb zoo. Tsis muaj daim ntawv ciab cov LEDs ci ncaj qha rau saum lub khob tsim thaj ua rau thaj tsis sib xws. Txij li thaum kuv npaj yuav siv lub sijhawm ntev no, Kuv txawm tuav lub teeb roj teeb rau menyuam roj hmab Kuv yuav rov ua dua thiab ntxiv Arduino rau yav tom ntej ($ 10 ntawm AliExpress).

Kauj Ruam 5: Lub zog qis thiab roj teeb

Tsawg-zog thiab Roj Teeb
Tsawg-zog thiab Roj Teeb
Tsawg-zog thiab Roj Teeb
Tsawg-zog thiab Roj Teeb
Tsawg-zog thiab Roj Teeb
Tsawg-zog thiab Roj Teeb
Tsawg-zog thiab Roj Teeb
Tsawg-zog thiab Roj Teeb

Kuv xav ua qhov no mus tas li thiab siv cov roj teeb los ua haujlwm. Qhov txuas ntxiv no yog nyob ntawm yeem raws li koj tuaj yeem tso lub khob rau saum thiab lub zog nrog lub phab ntsa ntsaws lossis lub USB them nyiaj nqa tau yooj yim.

Lub zog qis thiab tshem tawm LEDs built-in

Txoj cai twb suav nrog tso Arduino hauv Tsawg-Power pw tsaug zog rau 8 vib nas this, sawv los txheeb xyuas lub sijhawm, tom qab ntawd rov qab mus pw. Txhawm rau txuag hluav taws xob ntau dua thiab kom tsis muaj Lub Hwj Chim LED tso tawm txhua lub sijhawm, koj tuaj yeem tshem tawm cov teeb tsa LED ntawm Arduino Nano (thiab txij li thaum kuv siv tus pin D13 kuj tau txiav txim siab tshem tawm cov teeb tsa hauv ntawm tus pin).

Siv cov hlau txuas los ua kom sov ob sab ntawm cov LEDs uas muaj npe POW thiab L, tom qab ntawd rub lossis txiav kom tshem tawm lawv. Muaj ntau ntau qhov kev xaiv txuag hluav taws xob koj tuaj yeem sim los ntawm googling, tab sis qhov no kav ntev ntau lub hlis ntawm cov roj teeb thiab ua haujlwm zoo rau tam sim no!

Pawg Thawj Coj thiab Cov Ntaub Ntawv Roj Teeb

Soldering tag nrho txhua feem rau hauv pawg thawj coj saib txo qhov loj me thiab tso cai rau nws kom haum tau yooj yim nyob rau sab saum toj ntawm lub roj teeb pob hauv lub khob.

Siv 3 lossis 4 AA rooj plaub roj teeb thiab ua kom zoo (+) rau Vin ntawm Arduino thiab tsis zoo (-) rau GND.

Kuv tsis muaj teeb meem roj teeb, tab sis tau muaj $ 1 lub teeb pom kev twb tau sib cais lawm uas muaj 4 AA roj teeb rooj zoo kawg nkaus npaj rau kuv cov kev xav tau. Kuv muab lub khob dawb tso rau ntawm lub roj teeb thiab cim cov yas dub, tom qab ntawd txiav nrog rab riam siv hluav taws xob.

Kub nplaum lub rooj tsavxwm rau lub hauv paus pob roj teeb, tom qab ntawd kub kua nplaum lub khob dawb hla saum nws. Koj tuaj yeem yooj yim txiav cov kua nplaum kub thaum xav tau los qhib nws thiab rov tsim dua lub teeb ci LED lub sijhawm.

Qhov no zaum saum cov menyuam hnav khaub ncaws nyob ib sab ntawm lub qhov rooj thiab tam sim no tsis muaj kev cuam tshuam thaum sawv ntxov ntxov !!!

Pom zoo: