Cov txheej txheem:

Starry Sky Led Tie: 9 Kauj Ruam (nrog Duab)
Starry Sky Led Tie: 9 Kauj Ruam (nrog Duab)

Video: Starry Sky Led Tie: 9 Kauj Ruam (nrog Duab)

Video: Starry Sky Led Tie: 9 Kauj Ruam (nrog Duab)
Video: She Gets A SURPRISE! 😱 2024, Kaum ib hlis
Anonim
Image
Image
Starry Sky Coj Tie
Starry Sky Coj Tie
Starry Sky Coj Tie
Starry Sky Coj Tie

Ib pliag dhau los kuv pom cov khoom ua si menyuam yaus nrog fiberoptics ntawm lub khw muag nyiaj, thiab pib xav txog qhov kuv tuaj yeem ua nrog nws.

Ib qho ntawm cov tswv yim vwm uas kuv muaj, tau ua kev khi nrog cov txiaj ntsig ntawm lub hnub qub ntuj.

Kuv tseem muaj qee qhov arduino pro mini's, adafruit boards thiab roj teeb tso nyob ib puag ncig uas tej zaum yuav haum rau txoj haujlwm no.

Yog li sai li sai tau thaum kuv pom txoj hlua khi zoo nyob hauv lub khw muag paw hauv kuv lub nroog thiab pom lub npov uas yuav haum rau kho vajtse, kuv txiav txim siab mus rau nws thiab sim thiab tsim nws.

Cov ntawv qhia no qhia koj li cas kuv ua nws.

Nws ua haujlwm ntawm arduino pro mini, adafruit powerboost 500 charger, emmerich icr 18650nh-sp thiab 5 dawb LED's. Txoj cai ua rau LED hloov pauv qhov ci ci random. (Thawj 40 vib nas this ntawm daim vis dis aus yog 3x nrawm)

Kauj Ruam 1: Schematics thiab Kho Vajtse

Schematics thiab Kho vajtse
Schematics thiab Kho vajtse
Schematics thiab Kho vajtse
Schematics thiab Kho vajtse

Kuv siv cov cuab yeej hauv qab no:

- PCB nrog Ice dawb LEDs thiab 220 Ohm resistors.

-Arduino pro mini (kuv siv lub khob)

-Adafruit Powerboost 500 them nyiaj

-Emmerich Li-ion Accu ICR-18650NH-SP

- Optic fibers (ntau qhov sib txawv)

Kauj Ruam 2: Ua PCB Hosting LED's

Ua PCB Hosting tus LED's
Ua PCB Hosting tus LED's
Ua PCB Hosting tus LED's
Ua PCB Hosting tus LED's
Ua PCB Hosting tus LED's
Ua PCB Hosting tus LED's

Kuv txiav ib txoj hlua tawm ntawm PCB los tuav lub LED thiab siv cov pins LED los txhuam nws mus rau lub ntsiab PCB.

Txuas tag nrho cov cathodes (-) rau GND, thiab siv ib nrab ntawm cov pins los txuas nws txuas mus rau lub ntsiab PCB.

Txuas txhua qhov anodes (+) rau cov neeg tawm tsam, thiab nrog cov xov txuas mus rau arduino.

LEDs txhua tus yuav tsum txuas nrog rau ib qho ntawm PWM chaw nres nkoj hauv qab no: 3, 5, 6, 9, 10, 11

Ua tsis zoo kuv ua ntau qhov yuam kev nrog txoj haujlwm no thiab tsis nco qab txheeb xyuas qhov tseeb PWM cov chaw nres nkoj, yog li kuv yuav tsum rov muag dua ob peb tom qab. Xeem nrog High/Low yog li kuv tsuas pom qhov no tom qab.

Kuv pib nrog 7 LED's, tab sis tsuas muaj 6 PWM chaw nres nkoj thiab ib qho ntawm LED kuv tau rov muag dua tuag. Kuv tsuas yog khaws 5 ua haujlwm LED's thiab kuv tsis siv lub 6th.

Kauj Ruam 3: Ua Lub Thawv

Ua Lub Thawv
Ua Lub Thawv
Ua Lub Thawv
Ua Lub Thawv
Ua Lub Thawv
Ua Lub Thawv
Ua Lub Thawv
Ua Lub Thawv

Kuv siv Bosch GRO (zoo li Dremel) thiab laum los txiav tawm lub roj teeb zoo, lub pob, lub micro-usb chaw nres nkoj, headers los ntawm Arduino thiab cov kho qhov muag fiber. (siv daim npog qhov ncauj!)

Kaw lub roj teeb rau rooj plaub nrog 2 pawg.

Siv cov ntsia hlau los txhawm rau Adafruit board thiab PCB.

Kev sib txhuam los ntawm qhib thiab kaw puas qee cov xov hlau. Kuv yuav tsum rov muag lawv thiab siv cov kua nplaum los tiv thaiv nws kom tsis txhob rov tshwm sim dua.

Kauj Ruam 4: Npaj Tie

Npaj Tie
Npaj Tie
Npaj Tie
Npaj Tie
Npaj Tie
Npaj Tie

Tshem tawm txoj hlua ntawm qhov hauv qab ntawm txoj hlua kom haum rau daim ntawv roj hmab.

Txhawm rau zais cov cuab yeej thiab tseem tuaj yeem nkag tau nws yog xav tau kuv txiav txim siab siv lub zipper.

Kuv tsis zoo nrog lub tshuab xaws, yog li kuv niam qab zib tso lub zipper rau tom qab ntawm txoj hlua khi.

Tom qab qhov ntawd ua tiav, kuv tau kaw daim ntawv roj hmab hauv txoj hlua khi. Kuv ntshai siv cov kua nplaum ntau dhau uas yuav saturate cov ntaub thiab pom tau los ntawm sab xub ntiag, yog li kuv tau sim txawm tias nws tawm thiab tsis siv ntau dhau. Zuag qhia tag nrho nws zoo nkaus li zoo, tab sis ntawm qee qhov chaw kuv pom ntau dhau los lossis me ntsis kua nplaum, ua rau nws los ntawm cov ntaub lossis tsis lo cov ntaub zoo heev. Hmoov zoo qhov no tsuas yog pom me me ntawm qhov ze nyob deb ntawm lub teeb ci.

Tam sim no lub thawv thiab khi tau ua tiav. Lub sijhawm los lo cov tshuaj fiberoptics!

Kauj Ruam 5: Kaw cov Fiberoptics

Glueing Fiberoptics
Glueing Fiberoptics
Glueing Fiberoptics
Glueing Fiberoptics
Glueing Fiberoptics
Glueing Fiberoptics
Glueing Fiberoptics
Glueing Fiberoptics

Cov khoom ua si muaj ib pob loj fiber ntau optic xov hlau uas yooj yim tawg sib nrug. Kuv sim gluing lawv ib tus los ntawm ib qho thaum xub thawj, tab sis tsis ntev pom nws yuav zoo dua los ua cov pob me me thiab lo cov ntawd rau LED ib zaug. Qhov ntawd yuav ua rau nws yooj yim dua kom nws khov kho kom txog thaum cov kua nplaum tau qhuav. Messed li thawj LED xam qhov no tawm.

Nco ntsoov siv cov kua nplaum pob tshab! Qhov kuv siv tau qhuav qeeb heev thiab cov kua nplaum ziab kom qhuav kuv tau sim thawj zaug LED tig dawb, ua qee cov fibers los ntawm thawj LED tsawg dua ci.

Kuv glued cov roj hmab dub me me los tiv thaiv lub teeb los rau saum thiab cais cov LED.

Ib qho ntawm cov ntawv tau tiv thaiv rooj plaub los ntawm kev kaw yog li kuv tau ntxiv cov hlua roj hmab kom lub hau kaw.

Kauj Ruam 6: Muab Fiberoptics Los Ntawm Txoj Kev Tie

Tso Fiberoptics Los Ntawm Kev Tie
Tso Fiberoptics Los Ntawm Kev Tie
Tso Fiberoptics Los Ntawm Kev Tie
Tso Fiberoptics Los Ntawm Kev Tie
Tso Fiberoptics Los Ntawm Kev Tie
Tso Fiberoptics Los Ntawm Kev Tie

Pib hauv qab, kuv pinched qhov nrog rab koob thiab muab cov fibers hla los ntawm ib tus. Txhua qhov LED cov fibers nthuav tawm hla hla txoj hlua.

Kuv glued kab txaij dub nyob tom qab uas yuav tsum tau mus txhua txoj hauv kev mus rau ntu me me ntawm txoj hlua khi kom hnyav ntawm lub npov, tab sis tom qab kuv tso tag nrho cov xov hlau hla thiab xav tias nruj ntawm cov xov hlau kuv txiav txim siab gluing txhua yam rau txoj hlua khi yog lub tswv yim zoo dua thiab txiav cov hlua tawm.

Txij li cov xov tooj cua fiber ntau los ntawm cov khoom ua si tau luv heev, nws nyuaj ua kom haum rau lawv hla txoj hlua. Kuv raug txwv nyob hauv lub thawv ntawv thiab muaj lub sijhawm nyuaj ua txhua yam raws li qhov kuv xav tau.

Kauj Ruam 7: Kuaj Fiberoptics rau Tie

Glueing Fiberoptics rau Tie
Glueing Fiberoptics rau Tie
Glueing Fiberoptics rau Tie
Glueing Fiberoptics rau Tie
Glueing Fiberoptics rau Tie
Glueing Fiberoptics rau Tie
Glueing Fiberoptics rau Tie
Glueing Fiberoptics rau Tie

Kuv tau kaw tag nrho cov xov tooj cua fiber ntau rau daim ntawv roj hmab kom tiv thaiv cov xov hlau tsis txhob rub tawm ntawm daim ntawv roj hmab thiab ua kom khi ncaj.

Kom paub tseeb tias kuv tsis tau lo lub clamp rau txoj hlua khi thaum tso siab rau nws kuv muab qee daim ntawv tso rau nruab nrab. Nws tsis zoo li ntawd tab sis ua haujlwm zoo. Thiab koj tsis pom nws thaum nws raug kaw.

Tom qab cov kua nplaum qhuav kuv txiav cov xov hlau nyob rau ntawm xub ntiag thiab txiav me ntsis ntawm daim ntawv roj hmab tsuas yog saum cov hlau siab tshaj plaws, ua rau txoj hlua khi ntev me ntsis.

Cov duab nrog lub tsho dawb tau ua ua ntej kuv txiav qhov kawg ntawm cov roj hmab tawm.

Kauj Ruam 8: Txoj Cai

Hauv qab cov cai kuv tau sau rau txoj hlua khi.

Txhua LED muaj teeb tsa "nruab nrab" (tsis yog qhov nruab nrab tab sis nruab nrab qhov ci).

Thaum nws mus txog qhov nruab nrab ntawd, nws yuav txiav txim siab nrog lub sijhawm 3/4 mus rau qhov qis dua. Nws kuj tseem tuaj yeem teeb tsa qhov tsawg kawg nkaus ci ci tshiab, qhov ci tshaj plaws, tos sijhawm rau qhov tsawg kawg nkaus thiab qhov ci tshaj plaws thiab qhov nrawm nws nce lossis txo qis txhua txhua ib puag ncig (1-255) los ntawm 5 qhov tseem ceeb ua ntej. Tom qab ntawd nws yuav ua lub voj voog kom txog thaum nws mus txog qhov nruab nrab dua. Tsuas yog 2 LEDs tuaj yeem nyob hauv lub voj voog siab tib lub sijhawm.

Txhua lub xeev tau sawv cev los ntawm tus lej lej (1-7) txiav txim siab tias nws yuav mus avg-qis, qis-avg, tos qis, hloov kho tshiab, thiab lwm yam.

Yog xav paub ntxiv txog kev xa cov cai mus rau arduino, thov saib ntawm www.arduino.cc

/ * Lub Hnub Qub Starry Tie * * Nov yog tsab ntawv kom tsis txhob ploj 5 LEDs los ntawm qhov nruab nrab mus rau qis dua * lossis siab dua qhov ci nrog qhov qis dua, siab dua thiab sijhawm teeb tsa * kom zoo li lub hnub qub ntuj thaum siv nrog fiberoptics. * Hauv qhov no cov no yuav raug ua tiav hauv kev khi. * * Muaj feem nce/nqis = 1/4 nce, 3/4 nqis, nrog qhov siab kawg ntawm 2 * nce mus txog qhov siab tshaj plaws tib lub sijhawm. * * Qhov nruab nrab nyob qis ib yam. * Yam tsawg kawg, qhov siab tshaj plaws thiab sijhawm xaiv hloov pauv * los ntawm 5 qhov kev xaiv txhua lub sijhawm LED nce mus txog qhov nruab nrab dua. * * Tsim los ntawm Billy Jaspers, Tsib Hlis 2019. *

/ Tshaj tawm pins

int LED01 = 3; int LED02 = 5; int LED03 = 6; int LED04 = 9; cov LED05 = 11;

// Sijhawm hloov pauv

tsis kos npe ntev tam sim no; unsigned ntev tosTime [5]; tsis kos npe ntev ntevRound;

// LED Variables

int brightMin [5] = {10, 10, 10, 10, 10}; // Yam tsawg kawg nkaus ci ci int brightAvg [5] = {200, 200, 200, 200, 200}; // Qhov nruab nrab ci ntsa iab int brightMax [5] = {240, 240, 240, 240, 240}; // Tshaj siab tshaj plaws int timeWaitLow [5] = {1000, 1000, 1000, 1000, 1000}; // Tos lub sijhawm int timeWaitAvg [5] = {5000, 5000, 5000, 5000, 5000}; // Tos lub sijhawm int timeWaitMax [5] = {4000, 3000, 3000, 3000, 3000}; // Tos lub sijhawm int nce ntxiv [5] = {2, 5, 4, 5, 2}; // Ua kom pom kev ci ci tam sim no Bright [5] = {200, 230, 210, 210, 210, 235}; // Tam sim no ci ntsa iab

// LED Variables Muaj peev xwm

int brightMinPos [5] = {5, 20, 40, 5, 20}; // Yam tsawg kawg nkaus qhov muaj peev xwm ua tau zoo ci ntsa iab MaxPos [5] = {240, 245, 230, 225, 245}; // Tshaj siab tshaj plaws qhov muaj peev xwm ua tau rau lub sijhawmLowPos [5] = {3000, 5000, 4000, 2000, 1000}; // Tos lub sijhawm ntawm qhov muaj peev xwm ci ci tuaj yeem ua rau lub sijhawm HighPos [5] = {3000, 1000, 500, 2000, 4000}; // Tos lub sijhawm ntawm qhov muaj peev xwm ua tau zoo nyob rau sijhawm timeAvgPos [5] = {3000, 5000, 4000, 7000, 8000}; // Tos lub sijhawm nyob nruab nrab qhov muaj peev xwm ua tau nce incrementPos [5] = {2, 4, 5, 3, 1}; // nce ntxiv hauv qhov muaj peev xwm ci ntsa iab

// Variables

bool startup = muaj tseeb; // Puas yog qhov pib teeb tsa yuav tsum tau pib?

// Directional hloov pauv

/* 0 = Tos ntawm Qhov Nruab Nrab 1 = mus Avg rau Tsawg 2 = Tos Tsawg 3 = mus Tsawg rau Avg 4 = mus Avg rau Max 5 = tos ntawm Max 6 = mus Siab rau Avg 7 = Hloov kho qhov sib txawv*/ int statusLED [5] = {0, 0, 0, 0, 0}; int amountHighLED = 0; int refreshRate = 50; bool statusWaiting [5] = {cuav, cuav, cuav, cuav, cuav}; // Puas yog Led tos?

// Random hloov pauv

ntev randomNumber; // Ntev khaws cov lej random ntev randomNumberTwo; // Ntev mus khaws tus lej thib ob

// suav

int kuv = 0; // Txee rau lub voj loj

void teeb tsa () {

Serial.begin (115200); // Pib serial randomSeed (analogRead (A0)); // Teeb tsa randomseed

// Tshaj tawm cov txiaj ntsig

pinMode (LED01, NTUJ) tus pinMode (LED02, OUTPUT); tus pinMode (LED03, OUTPUT); tus pinMode (LED04, OUTPUT); tus pinMode (LED05, OUTPUT); }

// Sau cov ntaub ntawv rau LEDs

void writeToLED () {analogWrite (LED01, currentBright [0]); analogWrite (LED02, tam sim no Bright [1]); analogWrite (LED03, tam sim no Bright [2]); analogWrite (LED04, tam sim no Bright [3]); analogWrite (LED05, tam sim no Bright [4]); }

// Lub ntsiab lus

void loop () {if (startup) {// Startup settings lastRound = millis (); // Teeb tsa LastRound rau khau raj writeToLED (); // Sau cov ntaub ntawv pib rau LED pib = cuav; // Tua tawm startup} currentTime = millis (); // Teem sijhawm tam sim no

yog (currentTime - lastRound> = refreshRate) {

rau (i = 0; i <5; i ++) {if (statusLED == 7) {// -7- Hloov Kho Led randomNumber = random (5); brightMin [kuv] = brightMinPos [randomNumber]; // Teeb tus nqi random rau qhov tsawg kawg nkaus ci ntsa iab randomNumber = random (5); brightMax = brightMaxPos [randomNumber]; // Teeb tus nqi random rau qhov siab tshaj plaws ci ntsa iab randomNumber = random (5); timeWaitLow [kuv] = timeLowPos [randomNumber]; // Teeb tus nqi random rau lub sijhawm tos tsawg randomNumber = random (5); timeWaitMax = timeHighPos [randomNumber]; // Teeb tus lej tsis raug rau lub sijhawm tos ntau randomNumber = random (5); timeWaitAvg = timeAvgPos [randomNumber]; // Teeb tus nqi random rau nruab nrab tos sijhawm randomNumber = random (5); nce ntxiv = incrementPos [randomNumber]; // Teeb tus nqi random rau nce tus nqi randomNumber = random (2); // Teeb tus nqi random rau kev taw qhia randomNumberTwo = random (2); // Teeb tus nqi random rau kev taw qhia yog (randomNumber == 1 && randomNumberTwo == 0 && amountHighLED = brightAvg ) {statusLED = 0; // Yog tias nyob ntawm qhov qis tshaj: Mus rau Tos Avg} lwm qhov {currentBright = currentBright +nce ntxiv ; // Lwm: Brightness Ntau dua}} lwm qhov yog (statusLED == 2) {// -2- Tos Tsawg yog (! StatusWaiting ) {// Yog tias tsis tos: tosTime = millis (); // Teem sijhawm tos xwm txheej Tos tos = muaj tseeb; // Pib tos} lwm qhov yog (xwm txheej tos && currentTime-tosTime > = timeWaitLow ) {// Yog tias tos THIAB timeWaitAvg dhau lawm: statusWaiting = tsis tseeb; // Tsis txhob tos xwm txheej LED = 3; // Teeb tsa xwm txheejLed rau Tos rau qhov hloov tshiab}} lwm qhov yog (statusLED == 1) {// -1- Mus Avg rau Qis yog tias (currentBright <= brightMin ) {statusLED = 2; // Yog tias nyob ntawm qhov qis tshaj: Mus rau Tos Tsawg} lwm qhov {currentBright = currentBright -increment ; // Lwm Yam: Txo Brightness}} lwm qhov yog (statusLED == 6) {// -6- Mus Max rau Avg yog tias (tam sim noBright = timeWaitMax ) {// Yog tos THIAB timeWaitAvg dhau lawm: statusWaiting [kuv] = tsis tseeb; // Tsis txhob tos xwm txheej LED = 6; // Teeb tsa xwm txheejLed rau Tos rau qhov hloov tshiab}} lwm qhov yog (statusLED == 4) {// -4- Mus Avg rau Max yog (currentBright > = = brightMax ) {statusLED = 5; // Yog tias nyob ntawm qhov qis tshaj: Mus rau Tos Siab} lwm yam {currentBright = currentBright +nce ntxiv ; // Lwm: Brightness Ntau dua}} lwm qhov yog (statusLED == 0) {// -0- Tos ntawm Qhov nruab nrab yog (! Xwm txheejWaiting ) {// Yog tias tsis tos: tosTime = millis (); // Teem sijhawm tos xwm txheej Tos tos = muaj tseeb; // Pib tos} lwm qhov yog (xwm txheej tos && currentTime-tosTime > = timeWaitAvg ) {// Yog tias tos THIAB timeWaitAvg dhau lawm: statusWaiting = tsis tseeb; // Tsis txhob tos xwm txheej LED = 7; // Teeb tsa statusLed rau Tos rau qhov hloov tshiab}}} i = 0; lastRound = millis (); // Teeb tsa thaum qhov kev sib tw zaum kawg tiav. writeToLED (); // Sau tag nrho cov ntaub ntawv rau LED's}}

Kauj Ruam 9: Cov Khoom Kawg

Image
Image
Khoom Kawg
Khoom Kawg
Khoom Kawg
Khoom Kawg

Kuv xav tias nws ua haujlwm tau zoo. Txoj hlua tsis yog tuab heev, tawv, ntev lossis hnyav thiab lub hnub qub zoo li zoo kawg.

Pom zoo: