Cov txheej txheem:

Portable Party Lights: 12 Cov Kauj Ruam (nrog Duab)
Portable Party Lights: 12 Cov Kauj Ruam (nrog Duab)

Video: Portable Party Lights: 12 Cov Kauj Ruam (nrog Duab)

Video: Portable Party Lights: 12 Cov Kauj Ruam (nrog Duab)
Video: The best way to fill up your pool ๐Ÿ˜Ž๐Ÿ”ฅ 2024, Kaum ib hlis
Anonim
Image
Image
Lub Tswv Yim
Lub Tswv Yim

Tinkercad Cov Haujlwm ยป

Koj puas tuaj yeem coj lub teeb ci rau ib tog twg thiab ua kom lom zem dua?

Qhov ntawd yog lo lus nug. Thiab cov lus teb yog YOG (tau kawg).

Cov lus qhia no yog hais txog kev ua lub cuab yeej siv tau uas mloog cov nkauj thiab tsim cov nkauj pom ntawm lub ntsej muag ntawm Neopixel LEDs.

Ib qho kev sim tau ua kom ntaus ntawv "seev cev", piv txwv li, txav mus rau qhov ntaus suab paj nruag, tab sis kev ntsuas ntsuas tau ua pov thawj los ua txoj haujlwm nyuaj dua li lub suab (tsis muaj lub hom phiaj xav tau), yog li "seev cev" yog qhov ua tau txawv me ntsis, tab sis tseem muaj.

Lub cuab yeej tau qhib Bluetooth thiab yuav teb rau cov lus txib. Kuv tsis muaj sijhawm los sau App los tswj Party Lights (ib qho hauv lossis iOS). Yog tias koj tab tom ua txoj haujlwm - thov qhia rau kuv paub !!!

Yog tias koj nyiam cov lus qhia no, thov pov npav rau nws hauv Kev Sib Tw Ua Kom Nws Glow!

Khoom siv

Txhawm rau tsim Party Lights koj yuav xav tau:

  • STM32F103RCBT6 Leaflabs Leaf Maple Mini USB ARM Cortex -M3 Module rau Arduino (txuas ntawm no) - lub hlwb ntawm lub cuab yeej. Cov cuab yeej pheej yig no muaj zog heev, nws tsis meej vim li cas koj thiaj yuav rov qab mus rau Arduino.
  • MSGEQ7 Band Graphic Equalizer IC DIP-8 MSGEQ7 (txuas ntawm no)
  • HC-05 lossis HC-06 Bluetooth module (txuas ntawm no)
  • Adafruit MAX9814 lub microphone (txuas ntawm no)
  • Tus qauv servo lub cev (txuas ntawm no) yog koj xav kom koj lub cuab yeej "seev cev"
  • CJMCU 61 Ntsis WS2812 5050 RGB LED Tsav Txhim Kho Pawg Thawj Coj (txuas ntawm no)
  • TTP223 Touch Key Module Capacitive Settable Self-Lock/No-Lock Switch Board (txuas ntawm no)
  • Ultra Compact 5000-mah Dual USB Outputs Super Slim Power Bank (txuas ntawm no)
  • Resistors, capacitors, xov hlau, kua nplaum, ntsia hlau, cov laug cam prototyping, thiab lwm yam.

Kauj Ruam 1: Lub Tswv Yim

Lub Tswv Yim
Lub Tswv Yim

Lub tswv yim yog kom muaj lub cuab yeej nqa tau uas tuaj yeem tso ze rau lub hauv paus suab paj nruag, thiab qhov ntawd yuav tsim kom pom cov nkauj zoo nkauj. Koj yuav tsum muaj peev xwm tswj hwm tus cwj pwm ntaus ntawv ntawm cov nyees khawm (kov) thiab Bluetooth.

Tam sim no, Party Lights muaj 7 qhov pom kev siv (qhia rau kuv paub yog tias koj muaj tswv yim ntxiv!):

  1. Concentric cov yeeb yuj voj voog
  2. Maltese ntoo khaub lig
  3. Pulsating teeb
  4. Qhov cub (kuv tus kheej nyiam)
  5. Teeb teeb
  6. Ntoo ntoo
  7. Sab ib sab

Los ntawm lub neej ntawd, lub cuab yeej yuav hloov pauv los ntawm kev pom txhua feeb. Txawm li cas los xij, tus neeg siv tuaj yeem xaiv los lo nrog ib qho kev pom thiab/lossis kev mus los ntawm lawv tus kheej.

Kev pom qhov muag uas tig lawv cov xim palette tseem tuaj yeem "khov" yog tias tus neeg siv nyiam cov xim tshwj xeeb.

Thiab raws li ob peb qhov kev tswj hwm ntau dua, tus neeg siv tuaj yeem hloov pauv lub suab nrov ntawm lub microphone thiab pab/lov tes taw servo motor "seev cev" hom.

Kauj ruam 2: Schematic thiab Suab Ua

Schematic thiab Sound Processing
Schematic thiab Sound Processing
Schematic thiab Sound Processing
Schematic thiab Sound Processing
Schematic thiab Sound Processing
Schematic thiab Sound Processing
Schematic thiab Sound Processing
Schematic thiab Sound Processing

Cov ntaub ntawv tsis txaus ntseeg tau suav nrog hauv pob ntawm Github hauv "cov ntaub ntawv" subfolder.

Yeej, MSEQ7 nti ua lub suab ua haujlwm, faib lub suab tawm rau hauv 7 pawg: 63Hz, 160Hz, 400Hz, 1kHz, 2.5kHz, 6.25kHz, thiab 16kHz

Lub microcontroller siv cov 7 pab pawg los tsim ntau yam kev pom, qhov tseem ceeb ua piv txwv cov qhab nia sib luag rau hauv LED teeb pom kev zoo thiab ua ke xim.

Lub suab los yog lub microphone nrog 3 qib kev tswj kom nce. Koj tuaj yeem hloov pauv los ntawm kev teeb tsa siv ib qho ntawm cov nyees khawm nyob ntawm qhov deb/nrov lub suab qhov twg.

Lub microcontroller kuj tseem sim ua "ntaus" nrhiav pom ntawm 63Hz "bass" band. Kuv tseem tab tom ua haujlwm ntawm txoj hauv kev uas ntseeg tau txhawm rau txheeb xyuas thiab tswj tuav txoj kev sib tw.

Kev siv khawm "kov" yog qhov kev sim. Kuv xav tias lawv ua haujlwm tau zoo heev, txawm li cas los xij, tsis muaj xov xwm tawm tswv yim yog tsis meej pem me ntsis.

Kauj Ruam 3: LED Log

LED Log
LED Log
LED Log
LED Log
LED Log
LED Log

Lub hauv paus ntawm kev pom kev yog 61 LED log.

Thov nco ntsoov tias ib feem los ua ib lub nplhaib uas koj yuav tau muab tso ua ke. Kuv siv qhov xav tias tooj liab hlau rau cov kab hluav taws xob (uas tseem tuav cov hlua ua ke zoo), thiab cov xov hlau nyias nyias.

Cov LEDs suav nrog 0 txog 60 pib los ntawm cov hauv qab sab hauv LED thiab mus raws txoj kab rov tav. Qhov nruab nrab LED yog tus lej 60.

Txhua qhov kev pom pom tso rau ntawm ob kab ntawv cov ntaub ntawv, uas qhia txhua qhov LED rau hauv ib txoj haujlwm tshwj xeeb rau ntu kev pom pom.

Piv txwv li, rau cov voj voos kheej kheej, muaj 5 ntu:

  • Lub voj voog sab nrauv, LEDs 0 - 23, 24 LEDs ntev
  • Qhov thib ob sab nrauv, LEDs 24 - 39, 16 LEDs ntev
  • Lub voj voog thib peb (nruab nrab), LEDs 40 - 51, 12 LEDs ntev
  • Qhov thib ob sab hauv, LEDs 52 - 59, 8 LEDs ntev
  • Sab hauv LED, LED 60, 1 LED ntev

Cov duab qhia pom pom 5 tawm ntawm 7 lub suab tso tawm thiab teeb tsa LEDs zuj zus raws li lawv txoj haujlwm hauv cov pab pawg ncig sib faib rau qib suab hauv pab pawg.

Lwm qhov kev pom pom siv cov ntaub ntawv sib txawv thiab cov qauv, tab sis lub tswv yim ib txwm muaj kom pom kev tsav los ntawm cov ntaub ntawv arrays, tsis ntau los ntawm cov cai. Txoj hauv kev pom kev no tuaj yeem hloov kho rau cov duab sib txawv (ntau dua lossis tsawg dua LEDs, ntau EQ bands) yam tsis hloov pauv txoj cai, tsuas yog tus nqi hauv cov ntaub ntawv.

Piv txwv li, qhov no yog li cas cov qauv ntaub ntawv rau kev pom pom 1 zoo li hauv daim duab:

// Visualization 1 & 3 - tag nrho 5 Circlesconst byte TOTAL_LAYERS1 = 5; const byte LAYERS1 [TOTAL_LAYERS1] [25] = {// 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 {24, 0, 1, 2, 3, 4 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, {16, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39}, {12, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51}, {8, 52, 53, 54, 55, 56, 57, 58, 59}, {1, 60}};

Kauj ruam 4: Pom kev pom

Pom kev
Pom kev
Pom kev
Pom kev
Pom kev
Pom kev
Pom kev
Pom kev

Txog tam sim no muaj 7 qhov pom kev thiab pib ua yeeb yaj kiab:

Pib-animation

Thaum lub cuab yeej tau qhib, qhov ua piv txwv ntawm lub foob pob hluav taws tau tshwm sim. Qhov no tau xav tias yog LED thiab Servo ntu sib tw, tab sis tom qab hloov pauv mus rau qhov ua yeeb yaj kiab ntawm qhov kev sim ntawd

Concentric cov yeeb yuj voj voog

Lub teeb mus ib ncig ntawm cov zaub hauv cov vojvoog sib luag sib npaug rau qhov dav ntawm qhov sib npaug band. Hloov pauv ntawm lub moos- thiab txee-moos-ntse thiab maj mam tig cov xim hla 256 lub log xim

Maltese ntoo khaub lig

Ib pawg yog qhov chaw nruab nrab LED. Lwm pab pawg yog kab ntsug thiab kab rov tav ntawm LEDs, thiab ntu seem uas sawv cev rau txhua pawg EQ. Txhua ntu tau hloov xim hauv 128 offset kom nyob sib xws.

Pulsating teeb

Txhua lub voj voos teeb txhua LEDs hauv kev sib koom ua ke rau kev ua haujlwm tshwj xeeb, thaum maj mam tig cov xim nrog qhov me me. Cov qhab EQ tau hloov pauv zuj zus los ntawm ib lub voj voog mus rau lwm qhov tsim tawm sab nrauv.

Qhov cub

Cov pab pawg yog ib nrab-lub voj voos teeb los ntawm hauv qab mus rau sab saum toj pib nrog ci liab thiab ntxiv daj ntawm txoj kev nce simulating qhov hluav taws kub hauv qhov cub. Qee lub sij hawm qaim dawb "txim taws" ua rau tawg tuaj. Tsis muaj kev hloov xim

Teeb teeb

Txhua lub voj voos kheej kheej yog cais EQ band. LEDs ua ntej yog cov kab ntawm kab ntsug hauv qab qhov chaw nruab nrab LED. Thaum LED teeb pom kev sib npaug rau cov qhab nia, nws pib "khiav" nyob ib ncig ntawm lub voj voos sib luag maj mam txo qis. Ob lub moos- thiab cov khoom siv rov qab-clockwise tig tau txais kev txhawb nqa, hloov pauv ib yam.

Ntoo ntoo

Cov ntu tau teeb nyob rau hauv txoj kab ncaj ncaj los ntawm hauv qab LED nce thiab tom qab ntawd ib sab hauv lub ntsej muag ib nrab ib puag ncig ua piv txwv ntoo xibtes. Kev sib hloov xim

Sab ib sab

Nov yog qhov hloov pauv yav dhau los Maltese Hla nrog tsuas yog 2 ntu kab pheeb ces kaum siv. Xav tias zoo ib yam li lub cim rau lub suab yoj.

Kauj Ruam 5: Kov Khawm Tswj

Kov Khawm Tswj
Kov Khawm Tswj

Muaj 4 lub khawm kov-rhiab:

  1. Mus los ntawm kev pom kev thiab khaws qhov tam sim no mus kom txog thaum lwm tus raug xaiv (los ntawm kev pom pom lub voj voog txhua 30 vib nas this)
  2. "Khov" / "tsis khov" cov xim tam sim no - yog tias koj nyiam cov xim tshwj xeeb koj tuaj yeem khov nws - cov xim sib hloov yog xiam oob khab thiab pom kev yuav txuas ntxiv nrog tsuas yog cov xim xim
  3. Kho lub microphone rhiab heev
  4. Qhib / tawm hom "seev cev"

Hauv kev seev cev, lub cuab yeej yuav sim ntsuas "ntaus" ntawm cov nkauj tam sim no thiab tig nws lub taub hau raws li kev ntaus. Txog tam sim no "seev cev" yog qhov txawv txawv dua li zoo nkauj, ua siab ncaj.

Kauj Ruam 6: Tuav Kev Tshawb Fawb thiab Servo "seev cev"

Yeej Nrhiav thiab Servo
Yeej Nrhiav thiab Servo

Cov cuab yeej siv tas li txhawm rau txhawm rau txheeb xyuas "ntaus" ntawm lub suab tam sim no raws li qhov nrug nruab nrab ntawm qhov sib txuas ntawm qhov siab tshaj ntawm 63Hz band. Thaum kuaj pom (thiab tsuas yog tias hom kev seev cev yog ON), lub cuab yeej yuav qhib nws lub cav servo kom tig tig sab laug lossis sab xis raws li kev ntaus.

Txhua lub tswv yim ci ntsa iab ntawm yuav ua li cas kom ntseeg tau zoo dua no tau txais tos!

'Music_Test_LED' kos duab tawm 7 EQ bands hauv txoj hauv kev uas tsim nyog rau kev npaj siv Arduino IDE.

Kauj Ruam 7: Duab 3D

3D Duab
3D Duab
3D Duab
3D Duab
3D Duab
3D Duab

Tag nrho Cov Teeb Rooj Sib Tham tau tsim los ntawm kos siv Autodesk TinkerCAD.

Tus thawj tsim yog nyob ntawm no. Cov ntawv "cov ntaub ntawv/3D" ntawm github.com muaj cov qauv STL.

Qhov kev tsim no qhia txog yuav ua li cas lub cuab yeej zoo li ua ke.

Tag nrho cov khoom siv tau luam tawm thiab tom qab ntawd sib sau ua ke/ua ke ua ke.

Lub "dome" yog tus tuav lub microcontroller, Bluetooth board, thiab lub microphone. Lub microcontroller tau muab tso rau ntawm 40mm x 60 mm board thiab tau txais kev txhawb nqa los ntawm cov ntsia hlau.

Qhov kev pabcuam yog nyob hauv "ceg" ntawm lub dome, thaum cov nyees khawm nyob hauv lub hauv paus.

Cov roj teeb tau muab luam tawm tshwj xeeb rau hom roj teeb uas tau hais hauv ntu Cov Khoom Siv. Yog tias koj xaiv siv lub roj teeb sib txawv, chav yuav tsum tau rov tsim dua kom haum.

Kauj Ruam 8: Cov Khoom Siv Hluav Taws Xob

Hwj chim Mov
Hwj chim Mov
Hwj chim Mov
Hwj chim Mov

Ultra-Compact 5000-mah Dual USB Outputs Super Slim Power Bank zoo li tau muab lub zog txaus rau cov sijhawm ua haujlwm.

Cov roj teeb tau tsim nyob rau hauv ib txoj hauv kev uas nws tshem tawm ntawm cov khoom siv tas li thiab tuaj yeem hloov nrog qhov tsim los rau lwm hom roj teeb.

Lub USB ntsaws tau muab tso rau hauv thiab kub zoo rau hauv qhov chaw kom txuas lub roj teeb thaum nws swb hauv.

Kauj Ruam 9: Bluetooth Tswj

Bluetooth Tswj
Bluetooth Tswj

Ib qho HC-05 module tau ntxiv los muab txoj hauv kev los tswj cov cuab yeej siv wireless.

Thaum nyob, lub cuab yeej tsim kev sib txuas Bluetooth hu ua "LEDDANCE", uas koj tuaj yeem txuas koj lub xov tooj nrog.

Qhov zoo tshaj, yuav tsum muaj App uas tso cai tswj hwm PartyLights (xaiv cov xim palette, simulating khawm nias, thiab lwm yam). Txawm li cas los xij, kuv tseem tsis tau sau ib qho.

Yog tias koj xav pab sau Android lossis iOS App rau Party Lights, thov qhia rau kuv paub!

Txhawm rau tswj lub cuab yeej, tam sim no koj tuaj yeem siv Bluetooth lub davhlau ya nyob twg app, thiab xa cov lus txib hauv qab no:

  • LEDDBUTT - qhov twg yog '1', '2', '3', lossis '4' simulates nias ib lub pob. Piv txwv: LEDDBUTT1
  • LEDDCOLRc - qhov c yog tus lej ntawm 0 txog 255 - txoj haujlwm ntawm cov xim uas xav tau ntawm lub log xim. Cov cuab yeej yuav hloov mus rau xim tshwj xeeb LED.
  • LEDDSTAT - xa rov qab 3 tus lej tus lej suav nrog '0's thiab' 1's nkaus xwb:

    • thawj txoj haujlwm: '0' - xim tsis tig, '1' - xim tig
    • txoj haujlwm thib ob: '0' - hom kev seev cev raug kaw, '1' - hom kev seev cev tau qhib
    • txoj haujlwm thib peb: '0' - lub microphone zoo li qub, '1' - lub microphone muaj qhov nce siab

Kauj Ruam 10: Tswj App Raws Li Blynk

Tswj App Raws Li Blynk
Tswj App Raws Li Blynk
Tswj App Raws Li Blynk
Tswj App Raws Li Blynk
Tswj App Raws Li Blynk
Tswj App Raws Li Blynk
Tswj App Raws Li Blynk
Tswj App Raws Li Blynk

Blynk (blynk.io) yog kho vajtse-agnostic IoT platform. Kuv siv Blynk hauv kuv li IoT Automatic Plant Irrigation System qhia tau thiab txaus siab rau qhov yooj yim thiab muaj zog ntawm lub platform.

Blynk txhawb kev txuas mus rau cov cuab yeej ntug ntawm Bluetooth - raws nraim qhov peb xav tau rau PartyLights.

Yog tias koj tseem tsis tau muaj, thov rub tawm Blynk App, sau npe thiab rov tsim dua Blynk PartyLights App siv cov ntawv tshuaj ntsuam txuas nrog rau theem no. Thov nco ntsoov tias txoj haujlwm pin tus lej zoo ib yam li ntawm lub vijtsam, txwv tsis pub, cov nyees khawm ntawm lub app yuav tsis ua haujlwm raws li xav tau.

Cov ntaub ntawv "blynk_settings.h" muaj kuv tus kheej Blynk UID. Thaum koj tsim koj qhov project, nws yuav muab ib qho tshiab rau koj siv.

Rub lub PartyLightsBlynk.ino kos duab, tua lub App. Pair nrog Bluetooth ntaus ntawv thiab txaus siab rau tog.

Kauj Ruam 11: Sketches and Libraries

Sketches thiab Tsev Qiv Ntawv
Sketches thiab Tsev Qiv Ntawv

Daim duab tseem ceeb thiab cov ntaub ntawv txhawb nqa yog nyob ntawm Github.com ntawm no.

Cov tsev qiv ntawv hauv qab no tau siv nyob hauv Party Teeb duab kos:

  • TaskScheduler - koom tes ua haujlwm ntau yam - ntawm no (tsim los ntawm kuv)
  • AverageFilter - tus qauv nruab nrab lim - ntawm no (tsim los ntawm kuv)
  • Servo - Servo tswj - yog tus qauv Arduino tsev qiv ntawv
  • WS2812B -NEOPixel tswj - los ua ib feem ntawm pob STM32

Nplooj ntawv Wiki no piav qhia yuav siv STM32 cov laug cam nrog Arduino IDE li cas.

Kauj Ruam 12: Kev txhim kho yav tom ntej

Kev txhim kho yav tom ntej
Kev txhim kho yav tom ntej

Ob peb yam tuaj yeem txhim kho hauv qhov tsim qauv no, uas koj yuav xav txog yog tias koj pib ua txoj haujlwm no:

  • Siv ESP32 hloov chaw ntawm Maple Mini board. ESP32 muaj 2 CPUs, Bluetooth thiab WiFi sib tshooj, thiab tuaj yeem khiav ntawm 60MHz, 120MHz thiab txawm tias 240MHz.
  • Kev tsim me dua - cov cuab yeej siv tau yog qhov loj. Yuav ua rau muaj kev cog lus ntau dua (tshwj xeeb tshaj yog tias koj tso lub tswv yim seev cev thiab cuam tshuam nrog servo)
  • Kev ntsuas qhov ntsuas tuaj yeem txhim kho tsis kawg. Dab tsi los ib txwm rau peb tib neeg, zoo li yog txoj haujlwm nyuaj rau lub khoos phis tawj
  • Ntau qhov pom kev ntau dua tuaj yeem tsim thiab siv tau.
  • Thiab, tau kawg, App tuaj yeem sau los tswj lub cuab yeej wirelessly nrog UI txias.

Pom zoo: