Cov txheej txheem:

Ish Clock: 5 Kauj Ruam (nrog Duab)
Ish Clock: 5 Kauj Ruam (nrog Duab)

Video: Ish Clock: 5 Kauj Ruam (nrog Duab)

Video: Ish Clock: 5 Kauj Ruam (nrog Duab)
Video: Zoo Siab Nrog Koj - Paj Tsua Thoj [ Official MV ] Nkauj Tawm Tshiab 2022 2024, Kaum ib hlis
Anonim
Image
Image
Sib Sau Ua Ke & Ntoo Ua Haujlwm
Sib Sau Ua Ke & Ntoo Ua Haujlwm

Kuv nquag pom kuv tus kheej yuav khoom uas kuv tsis muaj lub tswv yim kuv yuav ua dab tsi nrog. Txoj haujlwm no yog los ntawm kev yuav lub nplhaib uas muaj 12x WS2812b LEDs rau. Kuv tsis muaj phiaj xwm rau nws tab sis nws zoo li hauv online yog li kuv kaw ib qho hauv kuv lub laub, ua si nrog nws ib pliag thaum nws tuaj txog thiab tom qab ntawd hnov qab txhua yam txog nws.

Ib pliag tom qab ntawd kuv tau xav txog kev ua lub moos thiab nco qab tias nws tau zaum ntawd tsis ua dab tsi. Kuv tab tom xav txog yuav lub nplhaib thib ob nrog 60 LEDs los ua cov feeb tab sis tom qab ntawd pib xav li cas peb / Kuv zoo li saib lub sijhawm thiab hloov nws mus rau qhov ze tshaj 5 feeb.

Nrog qhov no hauv kuv tus kheej kuv tau teeb tsa nrog kuv 12 lub nplhaib LED los ua lub moos ua haujlwm. Nws qhia 1 LED nyob rau ib lub sijhawm rau 1 thib ob, los qhia txog teev (Blue LED) thiab tom qab ntawd feeb (LED liab) sib npaug

Kauj Ruam 1: Sib Sau Qhov Chaw & Ntoo Ua Haujlwm

Sib Sau Ua Ke & Ntoo Ua Haujlwm
Sib Sau Ua Ke & Ntoo Ua Haujlwm
Sib Sau Ua Ke & Ntoo Ua Haujlwm
Sib Sau Ua Ke & Ntoo Ua Haujlwm
Sib Sau Ua Ke & Ntoo Ua Haujlwm
Sib Sau Ua Ke & Ntoo Ua Haujlwm

Kuv muaj hmoo heev tuaj txog ntawm kev ua haujlwm ib hnub thiab pom lub pallet. Lub pallet no tawm mus rau kuv vim nws tsis zoo li koj tus qauv, khiav ntawm lub zeb pallet. Nws yog qhov huv, kho cua sov thiab feem ntau cov ntoo ntoo tsis zoo.

Txoj haujlwm no yog tsim los ntawm ib qho ntawm cov khoom pallet. (Kuv nug tus thawj coj ua ntej kuv coj nws mus tsev)

Kuj siv:

  • 12 pixel ws2812b LED nplhaib
  • Lub Sijhawm Tiag (RTC) module (Kuv siv DS3231 nrog I2C)
  • Arduino Nano v3.0 tau tshaj
  • Acrylic ntawv (5 hli)
  • Xim Hlau

Cov cuab yeej

  • Laum Fais Fab
  • Router
  • Adjustable tiaj ntoo me ntsis
  • Lub zog sander
  • Tes pom
  • Soldering hlau
  • Kub kua nplaum phom
  • Cov ntawv xuab zeb
  • Danish Roj

Sanding

Kuv pib los ntawm kev siv lub tshuab ziab khaub ncaws kom ncaj thiab ntxuav lub thaiv ntoo kom txog thaum txhua sab uas huv thiab du. Kuv tau tso qee qhov tsis pom kev thiab nws tsis ncaj ncaj los yog plaub fab li kuv nyiam kom tuaj yeem pom qee qhov keeb kwm hauv ntoo.

Npav thiab Txiav qhov

Tom qab xuab zeb kuv xaiv sab kuv xav tau lub ntsej muag ntawm lub moos thiab cim lub hauv paus los ntawm kev kos kab los ntawm txhua lub ces kaum. Kuv teeb tsa cov ntoo kho tau me ntsis loj dua lub nplhaib coj yog li yuav muaj lub txee rau acrylic kom zaum ntawm thiab txiav txog 5mm sib sib zog nqus ces kho lub tshuab txiav tsuas yog qhov loj ntawm lub nplhaib LED thiab txiav lwm 5 hli lossis li ntawd.

Txoj kab thiab kab qhov

Siv kuv lub router nrog 12mm me ntsis kuv tau tawm qhov chaw so hauv qab ntawm qhov thaiv kom zais RTC thiab Arduino. Nws txog 15mm sib sib zog nqus thiab tsis pub tsawg dua 5mm los ntawm ib qho ntug. Kuv cim lub chaw nruab nrab (ish) los ntawm hauv qab thiab siv qhov siv 10mm me ntsis tsuas yog yav dhau los ib nrab txoj kev tso cai rau cov xov hlau LED. Tom qab ntawd siv 5mm me ntsis kuv tau laum los ntawm qhov nruab nrab ntawm qhov LED kom tau raws li 10mm qhov los ntawm hauv qab.

Ib qho ntxiv 4mm ntawm lub nraub qaum rau lub zog kom nkag los thiab siv lub router me me los ua cov channel rau cov xov hlau nyob tom qab ntawm lub nplhaib LED thiab cov ntoo ua haujlwm tiav.

Kauj Ruam 2: Acrylic Vajvoog

Acrylic Vajvoog
Acrylic Vajvoog
Acrylic Vajvoog
Acrylic Vajvoog
Acrylic Vajvoog
Acrylic Vajvoog

Txhawm rau ua cov acrylic rau sab xub ntiag ntawm lub moos Kuv hais kom txiav ib qho square uas yog qhov loj dua ces lub qhov nws yuav tsum tau sau. Tom qab ntawd siv lub tshuab ziab khaub ncaws kom pib Kuv pib tshem cov ces kaum kom txog thaum nws txog qhov zoo thiab qhov loj me. Tom qab ntawd kuv tau txav mus rau hauv cov xuab zeb kom kuv tsis txhob tua thiab yuav tsum pib dua.

Nws yog qhov txheej txheem qeeb thiab nyuaj ntawm kev sim thiab ua yuam kev kom txog thaum nws haum rau qhov yog tab sis kuv xav tias qhov kawg tau tsim nyog nws. Kuv ua tiav los ntawm kev siv daim ntawv nplua zoo heev los muab rau pem hauv ntej ntawm acrylic kom pom zoo.

Kauj ruam 3: Soldering

Soldering
Soldering
Soldering
Soldering
Soldering
Soldering
Soldering
Soldering

Kuv nyiam siv cov xim txheej rau kuv cov xov hlau nyob rau lub sijhawm no kuv xaiv:

  • Liab rau Lub Hwj Chim (5v)
  • Dawb rau av
  • Daj rau Cov Ntaub Ntawv
  • Ntsuab rau Moos

Kuv pib los ntawm kev siv 3 qhov tsim nyog xov hlau mus rau lub nplhaib LED siv cov txheej txheem saum toj no thiab thawb cov xov hlau nqes mus rau hauv lub qhov. Raws li nws yuav tsum tsis txhob raug rau ib qho kev yuam tiag tiag kuv tau siv me ntsis ntawm cov kua nplaum kub los tuav lub nplhaib nyob hauv qhov chaw. (Kuv yuav xav hloov nws qee lub sijhawm) thiab teeb cov acrylic nrog tsuas yog me ntsis kub kua nplaum nyob ib ncig ntawm ntug.

Tom qab ntawd kuv tau siv 4 lub xov hlau mus rau RTC siv cov txheej txheem saum toj no. Txhawm kom ua tej yam me me neater Kuv txiav txim siab los kos lub zog rau RTC los ntawm Arduino. Tom qab ntawd txuas txhua yam rau Arduino thiab txuas 1 xaim rau lub zog thiab lwm qhov rau hauv av mus rau Arduino.

RTC

  • SCL (Clock) rau Analog Pin 5
  • SDA (Cov Ntaub Ntawv) rau Analog Pin 4
  • VCC to 5V
  • GND rau ib qho GND ntawm Arduino

LED Nplhaib

Din rau Digital Pin 6

Kuv muaj lub qub USB cable dai ncig yog li txiav txim siab siv qhov ntawd los ua lub zog rau lub moos. Kuv txiav tawm qhov kawg uas ib txwm txuas rau qee yam thiab thawb nws los ntawm lub qhov nyob tom qab. Tom qab ntawd hle thiab tined qhov kawg ua ntej siv VCC mus rau Arduino thiab lub nplhaib LED mus rau qhov zoo thiab hauv av los ntawm Arduino thiab LED rau hauv av. Kuv sov me ntsis ntsws tom qab thiab nws tau saib zoo, Rab phom kua nplaum kub rov qab los kom tuav tau txhua yam cia. Kuv txiav txim siab tawm ntawm Arduino nrog kev ua si txaus uas kuv yuav tuaj yeem nkag mus rau USB chaw nres nkoj los ua haujlwm rau yav tom ntej tab sis tsis ntau heev uas kuv tuaj yeem poob tawm.

Kauj ruam 4: Txoj Cai

Tam sim no koj yuav tsum tuaj yeem xa cov cai no mus rau Arduino.

Yog tias RTC tsis ua haujlwm cov cai no yuav teeb tsa lub sijhawm raws li thaum cov lej tau suav ua ke yog li nco ntsoov tsuas yog nyem lub pob upload thiab tsis txheeb xyuas.

hloov qhov no kuj tseem ua haujlwm zoo rau kev teeb tsa lub sijhawm.

www.instructables.com/id/Setting-the-DS130…

Ntau ntawm cov cai no kuv tau qiv los ntawm Adafruit NeoPixel lub tsev qiv ntawv thiab qee qhov los ntawm RTC lub tsev qiv ntawv kuv pom thiab qee qhov kuv tau tsim ntawm kuv tus kheej.

// suav nrog lub tsev qiv ntawv chaws: #suav nrog

#suav nrog

#suav nrog

// txhais pins

#Txhais tus lej PIN 6

#define BRIGHTNESS 20 // teeb tsa qhov ci ci tshaj plaws

#fine r5 ua

#nco g 5

#nco b5

RTC_DS3231 rtc; // Tsim lub moos yam khoom

Adafruit_NeoPixel strip = Adafruit_NeoPixel (12, PIN, NEO_GRB + NEO_KHZ800); // strip khoom

void teeb tsa () {

Hlau.begin (); // Pib I2C

rtc.begin (); // pib moos

Serial.begin (9600);

// teeb tsa pinmodes

pinMode (PIN, NTAWV);

yog (rtc.lostPower ()) {

Serial.println ("RTC poob lub zog, cia teem sijhawm!");

// kab ntawv hauv qab no teeb tsa RTC rau hnub tim & sijhawm uas cov duab kos no tau muab tso ua ke

rtc.adjust (DateTime (F (_ DATE_), F (_ TIME_))));

// Kab no teeb tsa RTC nrog hnub tim & sijhawm qhia meej, piv txwv li teeb tsa

// Lub Ib Hlis 21, 2014 ntawm 3 teev sawv ntxov koj yuav hu:

// rtc.adjust (DateTime (2014, 1, 21, 3, 0, 0));

}

strip.begin ();

strip.show (); // Pib tag nrho cov pixels rau 'tawm'

DateTime theTime = rtc.now (); // coj mus rau hauv tus account DST

byte secondval = theTime.second (); // tau txais vib nas this

byte minuteval = theTime.minute (); // tau feeb

int teev = theTime.hour ();

dot (strip. Color (0, g, 0), 50);

}

void voj () {

// tau sijhawm

DateTime theTime = rtc.now (); // coj mus rau hauv tus account DST

int minuteval = theTime.minute (); // tau feeb

int teev = theTime.hour (); // tau teev

int thib ob = theTime.second ();

yog (minuteval 0) {

strip.setPixelColor (0, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 9) {

strip.setPixelColor (1, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 14) {

strip.setPixelColor (2, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 19) {

strip.setPixelColor (3, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 24) {

strip.setPixelColor (4, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 29) {

strip.setPixelColor (5, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 34) {

strip.setPixelColor (6, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 39) {

strip.setPixelColor (7, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 44) {

strip.setPixelColor (8, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 49) {

strip.setPixelColor (9, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 54) {

strip.setPixelColor (10, r, 0, 0);

strip.show ();}

lwm yog (minuteval <= 59) {

strip.setPixelColor (11, r, 0, 0);

strip.show ();}

ncua (1000);

rau (int kuv = 0; kuv <12; kuv ++) {

strip.setPixelColor (i, 0, 0, 0);

strip.show ();

}

yog (hourval == 0) {

strip.setPixelColor (0, 0, 0, b);

strip.show ();}

lwm yog (hourval == 1) {

strip.setPixelColor (1, 0, 0, b);

strip.show ();}

lwm yog (hourval == 2) {

strip.setPixelColor (2, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 3) {

strip.setPixelColor (3, 0, 0, b);

strip.show ();}

lwm yog (hourval == 4) {

strip.setPixelColor (4, 0, 0, b);

strip.show ();}

lwm yog (hourval == 5) {

strip.setPixelColor (5, 0, 0, b);

strip.show ();}

lwm yog (hourval == 6) {

strip.setPixelColor (6, 0, 0, b);

strip.show ();}

lwm yog (hourval == 7) {

strip.setPixelColor (7, 0, 0, b);

strip.show ();}

lwm yog (hourval == 8) {

strip.setPixelColor (8, 0, 0, b);

strip.show ();}

lwm yog (hourval == 9) {

strip.setPixelColor (9, 0, 0, b);

strip.show ();}

lwm yog (hourval == 10) {

strip.setPixelColor (10, 0, 0, b);

strip.show ();}

lwm yog (hourval == 11) {

strip.setPixelColor (11, 0, 0, b);

strip.show ();}

lwm yog (hourval == 12) {

strip.setPixelColor (0, 0, 0, b);

strip.show ();}

lwm yog (hourval == 13) {

strip.setPixelColor (1, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 14) {

strip.setPixelColor (2, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 15) {

strip.setPixelColor (3, 0, 0, b);

strip.show ();}

lwm yog (hourval == 16) {

strip.setPixelColor (4, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 17) {

strip.setPixelColor (5, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 18) {

strip.setPixelColor (6, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 19) {

strip.setPixelColor (7, 0, 0, b);

strip.show ();}

lwm yog (hourval == 20) {

strip.setPixelColor (8, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 21) {

strip.setPixelColor (9, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 22) {

strip.setPixelColor (10, 0, 0, b);

strip.show ();}

lwm tus yog (hourval == 23) {

strip.setPixelColor (11, 0, 0, b);

strip.show ();}

ncua (1000);

rau (int kuv = 0; kuv <12; kuv ++) {

strip.setPixelColor (i, 0, 0, 0);

strip.show ();

}

// rau kev debugging serial

Serial.print (teev sijhawm, DEC);

Serial.print (':');

Serial.print (minuteval, DEC);

Serial.print (':');

Serial.println (thib ob, DEC);

}

void dot (uint32_t c, uint8_t tos) {

rau (int j = 0; j <3; j ++) {

rau (int kuv = 0; kuv <12; kuv ++) {

strip.setPixelColor (i, c);

strip.show ();

ncua (tos);

rau (int kuv = 0; kuv <12; kuv ++) {

strip.setPixelColor (i, 0, 0, 0);

strip.show ();}

}

}

}

Kauj Ruam 5: Danish Roj

Danish Roj
Danish Roj
Danish Roj
Danish Roj
Danish Roj
Danish Roj
Danish Roj
Danish Roj

Kauj ruam kawg thiab xaiv tau yog thov qee cov roj danish rau ntoo. Kuv nyiam heev li cas nws nqa tawm cov nplej ntxiv rau nws muab qee qhov kev tiv thaiv los ntawm cov av thiab dej noo. Yog li kuv pom zoo nws.

Koj tuaj yeem txhuam nws lossis kuv tsuas yog siv daim ntaub qub los so nws.

Txhua yam uas tshuav tam sim no yog txhawm rau nws thiab txaus siab rau.

Pom zoo: