Cov txheej txheem:

Infinity Clock - Arduino - WS2813 thiab DS3231: 5 Cov Kauj Ruam (nrog Duab)
Infinity Clock - Arduino - WS2813 thiab DS3231: 5 Cov Kauj Ruam (nrog Duab)

Video: Infinity Clock - Arduino - WS2813 thiab DS3231: 5 Cov Kauj Ruam (nrog Duab)

Video: Infinity Clock - Arduino - WS2813 thiab DS3231: 5 Cov Kauj Ruam (nrog Duab)
Video: Making the best Arduino Clock for beginners 2024, Kaum ib hlis
Anonim
Image
Image
Infinity Clock - Arduino - WS2813 thiab DS3231
Infinity Clock - Arduino - WS2813 thiab DS3231

Infinity Clock - Arduino - WS2813 thiab DS3231

Kuv xav tsim lub moos, thiab nyiam lub tswv yim ntawm kev sim kuv txhais tes ntawm kev ua lub moos infinity nrog Arduino. Kuv xav kom nws tsim nws tawm ntawm cov khoom ib txwm muaj, thiab sau qhov program kuv tus kheej.

Dab tsi yog Infinity Clock?

Qhov ua kom pom kev tsis pom kev 3D tau tsim tawm thaum twg los xij muaj ob lub ntsej muag sib luag uas tuaj yeem thaws lub teeb ntawm lub teeb rov qab thiab tawm mus yam tsis muaj qhov kawg (theoretically infinite) tus lej. Cov kev xav zoo li rov qab mus rau qhov kev deb vim tias lub teeb yeej tab tom hla qhov deb. Los ntawm kev ntxiv cov xim LED rau daim iav Infinity peb sim ua piv txwv lub moos sib piv siv lub teeb pom kev zoo ib yam li lub moos tes.

Hauv cov lus qhia no kuv yuav taug koj kev los ntawm cov kauj ruam los tsim Lub Sij Hawm Infinity thiab tom qab ntawd tshuaj xyuas qee qhov ntsuas tsis tau hauv qhov program.

Kauj Ruam 1: Qhov Yuav Tsum Tau Ua Rau Txoj Haujlwm no

Yam Yuav Tsum Tau Ua Rau Txoj Haujlwm no
Yam Yuav Tsum Tau Ua Rau Txoj Haujlwm no

Daim Ntawv Teev Npe:

  1. Arduino Uno $ 6 ntawm taydaelectronics
  2. Protoshield rau arduino uno. Koj tuaj yeem tau txais ib qho rau 2.50 ntawm Amazon ntawm no.
  3. DS3231 ntxiv rau roj teeb. koj tuaj yeem tau txais ib puag ncig 3.00 ntawm Amazon ntawm no.
  4. WS2813 LED 144 rau 1 meter. $ 20 ntawm Amazon ntawm no.
  5. 470 OHM 1 W Carbon zaj duab xis tiv thaiv ib puag ncig 1 xees ntawm Taydaelectronics.
  6. 1000uf 16V Electrolytic capacitor 9 xees ntawm Taydaelectronics
  7. 5v fais fab mov- Kuv siv lub qub blackberry them.
  8. 6in round iav. ncig $ 5 ntawm Amazon
  9. 6in Acrylic Disc ib puag ncig 10 ntawm Amazon
  10. 2 - 6 "ntoo paj ntaub hoops (yoo uas yog) $ 2 txhua ntawm amazon
  11. Nyiaj ib-txoj kev daim iav zaj duab xis. Ebay zoo li pheej yig tshaj.
  12. Ntau cov xov hlau.
  13. 3/8 "ntoo square dowel HomeDepot rau $ 1.27
  14. qub ntoo moos puag los yog lwm yam khoom tso saib.
  15. 2 qhov sib txuas me me.

Daim ntawv tiv thaiv daim ntawv tsis xav tau, tab sis yog tias koj nyiam siv Arduino koj yuav pom nws yooj yim heev hauv kev tsim cov haujlwm no. Sib pauv daim ntawv tiv thaiv daim thaiv nrog daim txiag ntoo yog xav tau.

Koj kuj tseem yuav xav tau cov hlau txuas.

Kuv xav tias qhov project yuav raug nqi txog $ 40.00

Kauj ruam 2: Teeb Koj Lub PC

Teeb koj lub PC
Teeb koj lub PC
Teeb koj lub PC
Teeb koj lub PC
Teeb koj lub PC
Teeb koj lub PC

Yog tias qhov no yog koj thawj qhov haujlwm arduino:

  1. Rub tawm arduino software los ntawm arduino.cc
  2. Txuas Arduino rau PC nrog usb cable.
  3. Thaum koj pib lub software koj yuav tsum tau teeb tsa peb lub tsev qiv ntawv:

    • Nyem rau ntawm "Sketch" ntawv qhia zaub mov, tom qab ntawv nyem "suav nrog Cov Tsev Qiv Ntawv" tom qab ntawd "Tswj Cov Tsev Qhua …"
    • Nruab ob lub tsev qiv ntawv: FastLED thiab RTClib. Saib cov duab kom ntxaws ntxiv.
  4. Tau txais Arduino scketch los ntawm kuv github

    • Kuv yuav tshuaj xyuas qhov chaws kawg kom koj tuaj yeem hloov kho nws raws li xav tau.
    • Txij ntawm no mus ntsaws qhov program Infinity_Clock_DS3231_WS2813.ino
  5. Mus rau Sketch thiab Upload kom thauj khoom Arduino.
  6. Ntu kawg ntawm Cov Lus Qhia tau npog qee qhov tsis tuaj yeem teeb tsa.

Nws yog qhov zoo tshaj plaws los rub cov duab tam sim no, vim tias ib zaug lub zog sab nraud tau ntxiv nws qhov zoo tshaj plaws kom tsis txuas nws mus rau koj lub PC.

Kauj Ruam 3: Txuas qhov Project

Txuas qhov Project
Txuas qhov Project
Txuas qhov Project
Txuas qhov Project

Yog tias koj siv ProtoType Shield muab tso rau ntawm Arduino.

Txoj hlua yog qhov nyuaj tshaj plaws ntawm txoj haujlwm. Kuv suav nrog cov duab los pab koj pom qhov kuv tau ua. Kuv pom zoo ob zaug txheeb xyuas txhua qhov kev sib txuas ua ntej qhib lub zog.

DS3231 - Lub Sijhawm Sijhawm Tiag

Muab tus qauv DS3231 tso rau hauv lub khob cij thiab txuas zoo li hauv daim duab.

  • Arduino Av rau GND
  • Arduino 5V rau VCC
  • Arduino A4 rau SDA
  • Arduino A5 rau SCL

Hauv daim duab kuv xaim 5v thiab Hauv av rau thier tus kheej khiav ntawm lub khob cij vim tias tom qab ntawd peb yuav xav txuas lub zog sab nraud.

Txuas WS2813 LED Sawb

  • arduino 5V rau koj lub zog 5V.
  • Qhov nruab nrab ob qhov txuas txuas yog cov ntaub ntawv txuas ntxiv. lawv mus rau tus pin 7

    Nco ntsoov muab 470 OHM tus tiv thaiv nruab nrab ntawm tus pin7 thiab ob qho ntaub ntawv coj

  • Arduino Av rau qhov txuas kawg.

Txuas sab nraud 5V fais fab mov (khiav cov hlua LED los ntawm lub zog arduino rau lub sijhawm ntev tsis tau rov ua dua).

  • Muab 1000uf electrolytic capacitor nruab nrab ntawm cov coj.
  • Txuas lub zog thiab av rau Arduino Power (5V) thiab Av (GND)

Kuv tsis pom zoo txuas lub zog sab nraud thiab USB rau Arduino tib lub sijhawm.

Kauj Ruam 4: Tsim Daim iav Infinity

Tsim Infinity Mirror
Tsim Infinity Mirror

Cov kauj ruam los tsim Daim iav Infinity:

  1. Siv zaj duab xis rau Acrylic dics. Qhov no yuav ua rau koj ib txoj kev tsom iav.
  2. Muab cov Acrylic disc tso rau hauv Paj Ntaub Hoop. Ceev cov ntsia hlau kom nws tsis txhob plam
  3. Muab daim iav tso rau hauv lwm lub Embroiery hoop. Tighen ntswj ntsia hlau.
  4. Txiav lub xwmfab dowel rau hauv ntu me. txog 1/2"
  5. Loop cov hlua coj nrog LEDs taw rau sab hauv lub voj voog.

    1. Siv cov hlua zauv los tuav tus coj hauv qhov chaw.
    2. Tej zaum koj yuav tsum tau txiav ib qho thais hauv lub zip khi.
  6. Muab lub voj rau ntawm daim iav

    1. Siv ntoo thaiv los ua spacers
    2. Muab cov nplaum tso rau hauv qhov chaw. Lawv yuav tsum muaj kev nyab xeeb txaus los tuav lub hauv paus coj.
  7. Muab daim iav Acrylic tso rau saum daim iav/LEDs thiab lo rau hauv qhov chaw.

Kauj ruam 5: Txoj Cai

Txoj Cai
Txoj Cai
Txoj Cai
Txoj Cai

Qhov kev zov me nyuam siv Lub Tsev Qiv Sij Hawm Sijhawm Caij Nyoog thiab lub tsev qiv ntawv nrawm.

Nov yog qee qhov code snippets los kho tus cwj pwm.

  • OFFSET - yog qhov sib tshooj. Cov phiaj xwm cia siab tias kev sib tshooj yuav los ntawm LED0. Kuv muaj 3 LED offset.
  • CLOCKSTART - yog qhov chaw thaum tav su ntawm lub moos. LED 30 tso nws tawm ntawm qhov sib txuas hluav taws xob.

Kuv tau sau qhov program kom siv cov xim HTML. Koj tuaj yeem tau txais lawv los ntawm https://htmlcolorcodes.com/ Tsuas yog pauv # rau 0x hauv qhov program.

Koj tuaj yeem hloov keeb kwm yav dhau rau thaum sawv ntxov/yav tsaus ntuj

  • backgroundAM = 0x070707;
  • backgroundPM = 0x646D7E;

LED Tes ntawm lub moos:

  • hourHand = 0x000FFF;
  • minHand = 0x00CC00;
  • secHand = 0xcc0000;

Txhawm rau kom nws sawv tawm Kuv ntxiv qhov kev xaiv kom muaj 3 LEDs rau teev teev tab sis tso cai rau koj hloov xim ntawm ob sab ntawm ib nrab kom ua rau nws sawv tawm.

  • theeledhour = tseeb; // koj tuaj yeem ua qhov tseeb lossis tsis tseeb
  • extraHourHand = 0x00001F;

Lwm qhov zoo yog RTClib yuav kuaj pom tias koj lub DS3231 tau tshem lub roj teeb thiab yuav teem sijhawm rau lub PC suav sau sijhawm. Nws yog qhov zoo rau DS3231 tshiab.

Yog tias koj tsis tau txais cov duab kos thaum pib ntawm tus doc, nws tuaj yeem pom ntawm GitHub

Ua tsaug rau kev nyeem Cov Lus Qhia no. Kuv tus tub tau pab thiab nws yog txoj haujlwm lom zem rau peb. Kuv vam tias peb tau txiav txim siab hauv kev sib tw optic.

Pom zoo: