Cov txheej txheem:

LED txoj hlua tswj: 11 kauj ruam
LED txoj hlua tswj: 11 kauj ruam

Video: LED txoj hlua tswj: 11 kauj ruam

Video: LED txoj hlua tswj: 11 kauj ruam
Video: Tus Cawm Seej Hloov Neeg Txoj Hmoo (HD) 2024, Kaum ib hlis
Anonim
LED txoj hlua tswj
LED txoj hlua tswj

Cov lus qhia no suav nrog pib nrog cov hlua LED teeb. Kuv pib ua ntej los ntawm kev nrhiav ib txoj hauv kev los hloov cov txheej txheem teeb pom kev zoo ntawm tsob ntoo Christmas.

Rau kuv, kev pib yuav tsum muaj ntau qhov chaw thiab cov vis dis aus. Vam tias phau ntawv qhia no yuav pab koj txav mus rau qhov nthuav tawm sai dua.

Thaum koj tau pib nrog tus tswj thiab ib txoj hlua teeb, muaj ntau cov lus qhia koj tuaj yeem coj qhov no. Tom qab tsim tus tswj hwm, phau ntawv qhia no yuav pab koj txav mus rau:

  • Programming nrog Arduino editor
  • Ntxiv cov teebmeem tshiab thiab ntau lub teeb
  • Tswj cov hlua LED los ntawm lub xov tooj ntawm tes lossis kev siv tshuab hauv tsev
  • Kev koom ua ib lub teeb pom kev loj dua

Kauj Ruam 1: Sau Cov Khoom

Sau Cov Khoom
Sau Cov Khoom
Sau Cov Khoom
Sau Cov Khoom
Sau Cov Khoom
Sau Cov Khoom

Qhov xav tau:

Cov khoom siv teeb pom kev zoo (txuas) Cov khoom siv no suav nrog WS2811 LED hlua (5V version), lub zog 3A, thiab tus tswj ua ntej. Muaj txaus nyob ntawm no uas koj tuaj yeem paub tseeb tias txhua yam ua haujlwm ua ntej ua raws phau ntawv qhia no. Vim li cas 5V tau xaiv vim tias qhov hluav taws xob tseem tuaj yeem ua haujlwm rau Arduino

Wemos D1 mini maub los (txuas) Qhov no tau xaiv rau qhov me me, kev txuas wifi thiab yooj yim ntawm kev txuas. Tsis tas li, kuv twb muaj ib qho los sim nrog

Lub hwj chim txuas (txuas) Xav tau los txuas lub zog xa ncaj qha rau lub teeb ci. Ntau yam hauv pob, tab sis koj xav tau 1 tus txiv neej txuas

Tactile khawm hloov (txuas) Loj: 6 x 6 x 5mm, 4 Pin. Ntau yam nyob hauv pob, tab sis koj tsuas xav tau ib qho

Teeb ntxiv (txuas) Raws li xav tau. Nco ntsoov tias koj tab tom yuav 5V version. Saib cov lus qhia hauv qab no yog tias koj xav ua kom muaj zog ntau cov hlua

Kauj Ruam 2: Sib dhos Tus Tswj

Sib dhos Tus Tswj
Sib dhos Tus Tswj
Sib dhos Tus Tswj
Sib dhos Tus Tswj
Sib dhos Tus Tswj
Sib dhos Tus Tswj
Sib dhos Tus Tswj
Sib dhos Tus Tswj

Txhawm rau pib, koj xav tau 3-xaim pigtail uas los nrog LED teeb hlua. Koj tuaj yeem pom cov xov hlau zoo los ntawm kev pom li cas tus txuas txuas rau txoj hlua. Cov xaim nrog cov dashes yog qhov tsis zoo, nruab nrab yog cov kab ntawv, thiab cov seem sab nrauv uas seem yog qhov zoo.

Txhawm rau xaim D1 tus tswj, ua cov kab txuas hauv qab no:

  • Solder zoo (tej zaum liab) rau 5V tus pin
  • Solder tsis zoo (tej zaum dawb) rau GND tus pin
  • Cov ntaub ntawv laug (tej zaum ntsuab) rau D2.
  • Siv cov kua nplaum kub rau ntawm cov xov hlau thiab lub rooj tsavxwm (kom nws khov dua)

Txhawm rau txuas qhov hloov pauv, solder:

  • Ib sab rau tus pin 3.3V
  • Ib sab rau D7 tus pin
  • Solder D7 ncaj qha rau D8 (piv txwv li txuas tus pin)
  • Txiav tawm cov pins uas tsis siv lawm

Qhov hloov pauv tau txuas mus rau 3.3V thiab D7 vim tias nws haum zoo ncaj qha rau ntawm lub rooj tsavxwm. Txawm li cas los xij, D7 ntab rau ntawm D1 mini thiab yog li tsis tuaj yeem txheeb xyuas lub xeev hloov pauv los ntawm nws tus kheej. Txhawm rau kom nws ua haujlwm, siv D7 rau D8 kom D7 rub siab thaum qhib. Cov cai hauv kab ntawv txuas nrog Arduino qhia pom yuav siv lub hloov pauv li cas.

Kauj Ruam 3: Sib dhos Lub Teeb Teeb

Sib dhos Txoj hlua Teeb
Sib dhos Txoj hlua Teeb

Hauv cov kauj ruam no, peb yuav xaim lub zog ncaj qha rau txoj hlua sib txawv. Qhov no yuav ua kom muaj zog ob txoj hlua thiab D1 tus tswj hwm tib lub sijhawm. Lwm qhov txiaj ntsig ntawm txoj hauv kev no yog tias D1 tseem muaj zog thaum txiav tawm ntawm USB.

Txuas lub hwj huam txuas mus rau cov xaim xoob ntawm qhov kawg nrog tus pin ntsaws. Saib zoo thiab tsis zoo (saib Kauj Ruam 2 kom pom txhua tus).

Kauj ruam 4: Programming Tus Tswj

Programming Tus Tswj
Programming Tus Tswj

Txhawm rau npaj koj thaj tsam Arduino, ua raws cov lus qhia no:

  • https://www.instructables.com/id/Programming-the-WeMos-Using-Arduino-SoftwareIDE/
  • Ua raws li phau ntawv qhia no txhawm rau teeb tsa FastLED lub tsev qiv ntawv

Txhawm rau pib, siv qhov txuas INO program.

Txoj cai no ua cov hauv qab no:

  • Siv FastLED lub tsev qiv ntawv los ua cov hlua LED
  • Qhia pom teeb pom kev sib txawv
  • Siv khawm laub los hloov cov teebmeem
  • Khaws qhov ci ci ntawm 50%, uas yog qhov ci txaus thiab txo qhov kos tam sim no.
  • Teem cov xim kub rau hom hlua uas peb siv.
  • Txwv cov LEDs rau 50, uas yuav tsum tau hloov thaum ntxiv cov hlua ntxiv

Nco ntsoov tias dawb yog tsim los ntawm tig liab, ntsuab thiab xiav hauv qhov sib npaug ntawm txoj hlua. Qhov ntawd ua rau saib dawb sib txawv dua li cov kab dawb-tsuas yog LED muag rau Christmas ntoo. Peb tuaj yeem siv qhov zoo ntawm qhov no los teeb tsa tus qauv xim rau qee yam ntuj tsim thiab zoo li lub qhov muag teeb. Kuv pom tias "CRGB:: Khaki" muab xim zoo nkauj dua.

  • FastLED animation tsev qiv ntawv
  • Piv txwv yooj yim ntawm

Kauj Ruam 5: Muab tag nrho ua ke

Muab tso ua ke
Muab tso ua ke

Txhawm rau pib siv tus tswj hwm tshiab, ua raws cov theem no:

  • Qhib Arduino kos duab
  • Siv IDE txhawm rau thauj nws mus rau Wemos D1 mini

Kom paub meej tias nws ua haujlwm:

  • Txheeb xyuas tias LED ntawm D1 board teeb
  • Pom txoj hlua teeb ci dawb

Koj tuaj yeem hla dhau qhov cuam tshuam los ntawm kev nyem lub pob laug rau D1 mini.

Kauj Ruam 6: Teeb Pom Kev Zoo Ntxiv

Teeb pom kev zoo ntxiv
Teeb pom kev zoo ntxiv

Nov yog cov piv txwv zoo hauv kev siv FastLED lub tsev qiv ntawv.

https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/

Hloov kho cov teebmeem no rau Arduino kos duab.

Sparkle yog kev lom zem. Txog qhov ntawd, hloov cov cai los teeb tsa LED xaiv kom dub dua li ci dawb.

// hloov kho: //#txhais MAX_SEQUENCE 4 // // ntxiv cov kab no rau hauv kab lus hloov pauv: // rooj plaub 4: // SnowSparkle2 (CRGB:: Khaki, CRGB:: Dub, 20, random (100, 1000)); // tawg; // ntxiv cov kab no kawg ntawm cov ntawv: tsis muaj dab tsi SnowSparkle2 (int val, int val2, int SparkleDelay, int SpeedDelay) {setAll2 (val); int Pixel = random (NUM_LEDS); leds [Pixel] = val2; FastLED.show (); FastLED.delay (SparkleDelay); leds [Pixel] = val; FastLED.show (); FastLED.delay (SpeedDelay); }

Kauj Ruam 7: Nthuav Teeb Lub Teeb

Nthuav tawm txoj hlua teeb
Nthuav tawm txoj hlua teeb

Cov hlua tuaj yeem txuas ntxiv siv cov ntsaws txuas. Txawm li cas los xij, qhov hluav taws xob yuav poob tom qab kwv yees li 2 txoj hlua. Qhov no tuaj yeem kho tau los ntawm kev siv 5V xov nyob rau hauv kev sib tw nrog LED txoj hlua teeb. Koj tuaj yeem siv cov xaim xaim kom ua tiav qhov no-xyuam xim rau qhov zoo/tsis zoo polarity.

Piv txwv ntawm txoj hlua txuas ntawm nplooj ntawv no:

https://www.billporter.info/2017/01/07/the-engineers-guide-to-diy-computer-controlled-holiday-lights/

Kev piav qhia zoo ntawm thaiv thiab poob qhov hluav taws xob ntawm:

https://www.instructables.com/id/Arduino-Controlled-Positional-RGB-LED-Christmas-Tr/

Cov Lus Qhia no tseem suav nrog cov lus qhia zoo ntawm qhwv LEDs hauv kab xev hluav taws xob. Scotch Super 88 (3/4 dav) ua haujlwm tau zoo.

Ib qho ntxiv, MAX_LED hauv Arduino daim duab yuav tsum tau hloov pauv thaum koj ntxiv LEDs ntau dua.

Kauj Ruam 8: Kev Tswj Chaw Taws Teeb

Kev Tswj Chaw Taws Teeb
Kev Tswj Chaw Taws Teeb

Txhawm rau tswj txoj hlua nyob deb, siv Blynk. Siv ntawm:

https://www.blynk.cc/getting-started/

Ntxiv qhov xav tau Blynk code rau Arduino kos duab. Koj tuaj yeem teeb tsa Blynk app rau:

  • Hloov cov teebmeem
  • Siv RGB zebra los hloov xim
  • Tswj lub ci ci

Saib cov duab kos Arduino txuas rau kev hloov pauv kom suav nrog Blynk. Cov kauj ruam:

  1. Ntxiv Blynk cov tsev qiv ntawv rau Arduino
  2. Sau npe rau Blynk tus account
  3. Rub tawm app rau xov tooj
  4. Tsim txoj haujlwm tshiab. Qhov no yuav tsim txoj cai tso cai rau txoj haujlwm ntawd.
  5. Hloov kho daim duab txuas nrog suav nrog tus lej lees paub, lub npe wifi thiab tus password wifi
  6. Siv Arduino editor txhawm rau thauj mus rau D1 mini.

Kauj Ruam 9: Txuas Nrog Tsev Automation

Txuas Nrog Tsev Automation
Txuas Nrog Tsev Automation

Koj tuaj yeem tswj txoj hlua los ntawm kev ntxiv MQTT tus thov rau Arduino kos duab. Nruab ib lub MQTT broker ntawm koj lub tsev siv tshuab (piv txwv li OpenHAB lossis Tus Pab Tsev).

Xav paub ntau ntxiv ntawm:

https://www.baldengineer.com/mqtt-tutorial.html

Kauj Ruam 10: Ua Teeb Pom Kev

Ua Teeb Pom Kev
Ua Teeb Pom Kev

Kev tshoov siab ntawm

Pixel qhov chaw hauv XLights

Kev piav qhia ntawm DMX raws tu qauv

Artnet tsev qiv ntawv

Piav qhia qhov tseeb tshwm sim

Kauj Ruam 11: Ua Ntau Ntxiv

Ua Ntau
Ua Ntau

Ua Koj Tus Kheej Christmas

Daim ntawv qhia tag nrho nrog ua tiav cov lus piav qhia

Pom zoo: