Cov txheej txheem:

RGB LED Lub Vev Xaib Nrog Bluetooth App + AnimationCreator: 14 Cov Kauj Ruam (nrog Duab)
RGB LED Lub Vev Xaib Nrog Bluetooth App + AnimationCreator: 14 Cov Kauj Ruam (nrog Duab)

Video: RGB LED Lub Vev Xaib Nrog Bluetooth App + AnimationCreator: 14 Cov Kauj Ruam (nrog Duab)

Video: RGB LED Lub Vev Xaib Nrog Bluetooth App + AnimationCreator: 14 Cov Kauj Ruam (nrog Duab)
Video: Xov tooj & Computer Accessories Tuam Tshoj Hoobkas, pob ntseg wireless, txawb lus nrog lub charger 2024, Kaum ib hlis
Anonim
RGB LED Lub Vev Xaib Nrog Bluetooth App + AnimationCreator
RGB LED Lub Vev Xaib Nrog Bluetooth App + AnimationCreator

Nov yog qhov qhia qhia yuav ua li cas tsim 6x6x6 RGB LED (Common Anodes) Cube tswj los ntawm Bluetooth App siv Arduino Nano. Tag nrho kev tsim tau yooj yim hloov kho kom hais tau 4x4x4 lossis 8x8x8 Cube. Txoj haujlwm no tau tshoov siab los ntawm GreatScott. Kuv txiav txim siab mus rau kev tsim kho kom zoo dua siv cov leds loj (8mm), nrog qhov deb tsawg dua + ntxiv Bluetooth kev sib txuas lus uas ua rau ntxiv cov haujlwm tshiab kom yooj yim dua thiab tseem ntxiv qhov muaj peev xwm ntawm kev tsim app los tswj lub voos xwmfab. Qhov no tseem tso cai rau kuv xws li code a Snake Game (3rd showcase video at the end). Nyob rau sab saum toj ntawm qhov ntawd kuv tau ntxiv lub Suab Visualizer hom uas tso cai rau lub voos xwmfab kom pom lub suab AUX xws li Suab paj nruag siv MSGEQ7 (tso yeeb yaj kiab thaum kawg). Ib qho ntxiv Kuv tau sau daim ntawv thov AnimationCreator hauv Java nrog qhov yooj yim siv UI los tsim thiab hloov kho Animations, yog li txhua tus tuaj yeem tsim cov kev cai ua kom nrawm heev. Yog li Sketch + Bluetooth App muab lub moj khaum rau ib qho teeb tsa LED Cube thiab nrog Tus Tsim Animation koj tsis tas yuav txhawj xeeb txog kev ua raws cov kev coj ua.

Txuas mus rau Arduino Sketch thiab Bluetooth App:

RGBCube_Arduino Sketch (Github)+Animation Creator.jar

Cubo Bluetooth App (Github)

Daim ntawv teev npe rau Cube:

  • 216x RGB LED (Common Anode) (8mm) (AliExpress / Ebay)-> 6x6x6 = 216
  • Ribbon Cable (1m 40Pin yuav tsum txaus) (AliExpress / Ebay / Amazon)
  • Poj niam thiab txiv neej Headers (tsawg kawg 4x40pin txhua) (AliExpress / Ebay / Amazon)
  • Tinned Copper / Silver Wire 0.8mm (~ 25Meter) (AliExpress / Ebay / Amazon)
  • Ntsws Tube (AliExpress / Ebay / Amazon)

Daim ntawv teev npe rau Pawg Tswj:

  • 7 x TLC5940 LED tsav tsheb (Ebay / AliExpress)
  • 6 x IRF 9540 P-Channel MOSFETs (Amazon / Ebay / AliExpress)
  • 8 x 10 uF Capacitors (Amazon / Ebay / AliExpress)
  • 3 x 1000 uF Capacitors (Amazon / Ebay / AliExpress)
  • 14x 2.2kOhm Resistors (Amazon / Ebay / AliExpress)
  • 1 x 1kOhm Resistor (Amazon / Ebay / AliExpress)
  • 7 x 28pin IC Qhov (Amazon / Ebay / AliExpress)
  • 1 x Arduino Nano (Amazon / Ebay / AliExpress)
  • 1 x 1N4001 Diode (Txhua Yam Diode) (Amazon / Ebay / AliExpress)
  • 8 x 0.1uF Capacitors (Ebay)
  • 1 x DC Jack PCB Mount (Amazon / Ebay / AliExpress)
  • 1 x HC-05 Bluetooth Module (Amazon / Ebay / AliExpress)

Kauj ruam 1: Txoj kev xav

Txoj kev xav
Txoj kev xav

Yog tias koj tsis txaus siab rau txoj kev xav txog kev sib tw ntau dua li dhia mus rau Kauj Ruam 2 rau qhov pib ntawm qhov tsim tiag

Txij li kho vajtse thiab software yog qhov sib npaug loj ntawm qhov haujlwm no, cia saib qhov kev xav ua ntej.

Lub hlwb ntawm lub voos xwmfab yog Arduino Nano. Nws muab I/O txaus los cuam tshuam nrog siv LED Tsav Tsheb nrog rau tsim kom muaj kev sib txuas Bluetooth mus rau HC-05 tus qauv thiab lwm yam khoom siv tswj hwm. Yog tias koj tau saib ntawm lwm lub LED Lub Vev Xaib tsim, koj yuav paub tias cov neeg feem ntau siv cov npe yooj yim Shift los khaws qhov ci ci ntawm cov xim ntawm tus kheej LEDs. Qhov kev tsim no tsis siv Shift cov npe, tab sis hloov qhov hu ua "TLC5940" LED Tsav Tsheb. Raws li peb yuav pom tom qab qhov no txuag peb ntau lub sijhawm nrog rau ntau ntxiv ntawm cov cuab yeej ntxiv (piv txwv li cov tiv thaiv).

Kev ua haujlwm yooj yim ntawm kev tswj lub voos xwmfab siv cov lej sib npaug. Hauv qhov no peb tab tom sib npaug 6 txheej ntawm lub voos xwmfab, txhais tau tias txhua qhov Anodes (+) ntawm txhua lub LEDs hauv ib txheej tau txuas nrog, thaum tib neeg Cathodes ntawm txhua LEDs hauv tib kab ntawv txuas rau hauv qab. Qhov no txhais tau tias yog koj xav teeb lub LED ntawm txoj haujlwm x = 1, y = 2, z = 3, xim: ntsuab koj yuav tsum tau muab 5V ntawm Anode ntawm Txheej 3 thiab txuas GND rau Cathode ntawm Kab ntawv sib xws Ntsuab Pin ntawm x = 1, y = 2. Yog li hauv qhov tseeb ntawm ib lub sijhawm, tsuas yog ib txheej ntawm lub voos xwmfab tau qhib tiag, tab sis raws li koj yuav pom tom qab hauv Txoj Cai peb tab tom tua thiab ntawm tus kheej txheej nrawm heev, uas peb lub qhov muag xav tias tag nrho lub voos xwmfab nyob..

Txhawm rau tswj hwm yam xws li ci ntsa iab, ua kom pom kev thiab lwm yam peb siv HC-05 Bluetooth module txuas nrog Arduino Nano. Nws yooj yim heev los siv tus qauv nrog Arduino txij li koj tsuas xav tau 4 Pin txuas thiab tuaj yeem yooj yim cuam tshuam tus qauv ntawm lub neej ntawd Serial-Commuincation ntawm Arduino. Txog qhov kawg ntawm cov lus qhia no koj yuav pom yooj yim npaum li cas nws yog sau koj tus kheej Bluetooth App los tswj lub Cube.

NCO TSEG

Hauv kuv qhov txheej txheem ntawm Arduino Circuit board koj tseem tuaj yeem pom cov txheej txheem me me rau cuam tshuam nrog MSGEQ7 chipto txheej txheem Audio Input, qhov no tsis tas yuav tsum muaj rau lub voos xwmfab tiag tiag thiab tsuas yog ua haujlwm ntxiv uas kuv tau ntxiv, yog li koj tuaj yeem yooj yim tsis quav ntsej Schematic cim nrog "MSGEQ7"

Kauj Ruam 2: Kho vajtse: LED Cube Build

Kho vajtse: LED Cube Tsim
Kho vajtse: LED Cube Tsim
Kho vajtse: LED Cube Tsim
Kho vajtse: LED Cube Tsim
Kho vajtse: LED Cube Tsim
Kho vajtse: LED Cube Tsim

Yog li cia saib seb yuav tsim lub Cube nws tus kheej li cas, ua ntej tham txog kev tswj hwm ib puag ncig Arduino Nano.

Daim Ntawv Teev Npe rau Kev Siv Lub Vev Xaib:

  • 216x RGB LED (Common Anode) (AliExpress / Ebay)-> 6x6x6 = 216
  • Ribbon Cable (1m 40Pin yuav tsum txaus) (AliExpress / Ebay / Amazon)
  • Poj niam thiab txiv neej Headers (tsawg kawg 4x40pin) (AliExpress / Ebay / Amazon)
  • Tinned Copper / Silver Wire 0.8mm (~ 25Meter) (AliExpress / Ebay / Amazon)
  • Ntsws Tube (AliExpress / Ebay / Amazon)

Thawj qhov uas yuav tsum tau ua, thiab tam sim no kuv tau nkees tab sis tsim nyog, peb yuav tsum ntsuas LEDs. Txhawm rau ua qhov ntawd, peb yooj yim txuas cov khoom siv hluav taws xob piv txwv li 9V Roj teeb thaiv nrog clip rau lub nkoj loj. Raws li koj tuaj yeem pom hauv daim duab 3 tus Pin ntev tshaj plaws ntawm LEDs yog Anode (+) yog li koj txuas tus pin no rau +9V ntawm lub roj teeb. Tam sim no ua ntej txuas GND rau tus kheej xim Cathodes (Liab, Ntsuab, Xiav) ntxiv 220Ohm resistor rau txhua tus cathode kom txwv qhov tam sim no. Tam sim no muaj kev lom zem sim txhua xim ntawm txhua 216 LEDs.

Hauv cov kauj ruam tom ntej peb yuav npaj cov ntsuas LEDs kom peb tuaj yeem yooj yim sib sau ua ke hauv kab tom qab.

Kauj Ruam 3: LED Kab

LED Kab
LED Kab
LED Kab
LED Kab
LED Kab
LED Kab

Ua ntej peb tuaj yeem tso cov LEDs rau hauv lawv cov kab sib txawv peb yuav tsum khoov thiab txiav cov hlau lead.

Raws li koj tuaj yeem pom hauv thawj daim duab kuv tau yooj yim rub lub 8mm qhov (rau 8mm LEDs) rau hauv ib qho ntoo thiab drilled 3 qhov kev xyaum me me mus rau sab laug ntawm lub qhov LED thiab lwm mus rau sab xis ntawm lub qhov. Cov kev xyaum no yog cov cim rau khoov cov coj kom raug thiab yuav tsum muaj qhov deb li ntawm 1cm ntawm nruab nrab ntawm lub qhov rau LED.

Cov txheej txheem no tau tshoov siab los ntawm Steve Manley, koj tuaj yeem pom cov vis dis aus ntawm nws ua qhov no hauv kev hloov pauv me ntsis hauv YouTube.

Ua ntej koj txiav thiab khoov txoj hauv kev ib puag ncig kev xyaum raws li pom hauv daim duab 2 thiab 3, nco ntsoov tias kev taw qhia ntawm cov coj coj mus rau daim duab 1 (Xiav nyob rau sab saum toj mus rau sab laug, tom qab ntawd ntsuab, tom qab ntawd anode + mus rau sab xis, thiab liab sab laug dua). Lub voj voos uas koj khoov rau hauv txoj hauv kev yuav tsum muaj lub taub loj txaus kom haum rau cov xaim tooj liab xaim (0.8mm). Cov kauj ruam no ua rau nws zoo nkauj yooj yim dua los ua kom cov LEDs nyob hauv qhov chaw zoo.

Tam sim no tias txhua qhov LED tau npaj, peb xav sau lawv ua kab ntawm 6 qhov twg Anodes (+) txuas nrog:

  1. Ua tus jig me me raws li pom hauv daim duab 6, laum 6 qhov (txoj kab uas hla 0.8mm) nrog qhov nrug ntawm 2.5cm mus rau lub qhov tom ntej. Qhov no tso cai rau peb haum 6 LEDs ib lub sijhawm rau hauv jig
  2. Txhawm rau txuas cov anodes peb xav tau qhov ncaj tinned tooj liab xaim ntawm ~ 16cm ntev (nrog qee qhov npoo ntxiv). Txhawm rau kom tau cov xaim zoo thiab ncaj koj tuaj yeem txuas ib kawg ntawm cov xaim mus rau piv txwv li siv lub laum hluav taws xob, ruaj ntseg txog 2m ntawm cov xov hlau ib zaug ntawm lub rooj, tom qab ntawd tuav lub laum kom xaim tau nthuav dav thiab nruj thiab muaj zog ntawm qhov laum rau ob peb feeb nrog ncaj tawm cov xaim nrawm heev. Tom qab ntawd koj tuaj yeem txiav xaim txoj cai ntawm qhov chaw koj ruaj ntseg daim. Koj kuj tseem tuaj yeem siv ob rab riam thiab kaw qhov xaim me me ntawm ib lub sijhawm, tab sis qhov ntawd yog qhov ntau dua
  3. Thaum koj muaj 16cm cov xov hlau ntev koj coj lawv hla Anode (+) qhov ntawm LEDs hauv lub jig thiab muab cov kab xaim Anode txuas rau xaim (Daim duab 7)

Rau tag nrho lub voos xwmfab peb yuav xav tau 6x6 = 36 ntawm cov kab LED no

Kauj Ruam 4: Txheej Los Ua Ke

Txheej Los Ua Ke
Txheej Los Ua Ke
Txheej Los Ua Ke
Txheej Los Ua Ke
Txheej Los Ua Ke
Txheej Los Ua Ke

Raws li kuv tau hais ua ntej, peb yuav ua ntau txheej txheej ntawm lub voos xwmfab, tab sis rau kev sib dhos nws yooj yim dua los tsim 6 Phab Ntsa ntawm 6x6 LEDs thiab tom qab ntawd sib sau ua ke lawv ib sab thiab yooj yim khiav ib lub xaim tooj liab xaim txuas nrog anodes ntawm kab hauv ib txheej ua ke.

Ceev faj tias cov kauj ruam no siv sijhawm ntau thiab ua siab ntev txhawm rau ua kom raug, nyob rau hauv tag nrho koj yuav tsum tau sib dhos ib puag ncig 1000 cov laug txuas rau kev tsim yog li siv koj lub sijhawm!

Txhawm rau tsim LED Phab Ntsa:

  1. Rau jig: Peb xav tau ib daim ntoo nrog 6 kab txua ntoo kom haum 6 kab ib kab saum toj ib sab los tsim phab ntsa. Koj tuaj yeem pom jig nws tus kheej hauv daim duab 2 (nrug ntawm kab: 2.5cm)
  2. Koj haum rau 6 kab ntawm LEDs rau hauv daim duab, nrog Anode xaim lub ntsej muag nqes mus rau hauv kab txua ntoo, kom 3 Cathodes (R, G, B) ntsej muag
  3. Txhawm rau txuas Cathodes uas nyob saum ib leeg ib leeg (saib daim duab 2) peb xav tau qee cov xov hlau ntxiv (yog li peb ntxiv 6 Kab x 3 Cathodes x 6 Phab Ntsa = 108 tinned xaim xaim raws li tau piav qhia hauv kauj ruam kawg))
  4. Xaub cov xov hlau los ntawm hauv qab ntawm kab ntawv los ntawm lub qhov ntawm Cathodes mus rau kab saum toj kawg nkaus thiab muab cov xaim txuas tso rau ntawm txhua qhov LED

Koj ua qhov no 6 zaug kom tau 6 phab ntsa ntawm LEDs.

Tam sim no peb tuaj yeem sib dhos Cov Phab Ntsa mus rau hauv lub voos xwmfab nws tus kheej. Tab sis kom tuav lub voos xwmfab, peb yuav tsum tsim qee yam ntawm lub dav hlau hauv av. Txog qhov no kuv tsuas siv qee cov plywood nyias thiab drilled me 0.8mm qhov rau hauv nws, kom haum cov xov hlau dai los ntawm qis LED Kab (rau txhua 6 LED Phab Ntsa). Kev ntsuas ntsuas rau lub qhov ntawm ib qho LED tau sau tseg hauv Kauj Ruam 3 thiab qhov kev ncua deb ntawm txhua LED yog 2.5cm.

Nrog lub qhov nyob hauv qhov chaw tam sim no peb coj thawj phab ntsa thiab txav nws mus rau hauv lub qhov ntawm sab laug ntawm lub plywood. Cov kab LED nyob hauv qab yuav tsum zaum sab xis ntawm cov ntoo, yog li thaum kawg txhua phab ntsa tau sib dhos zoo ib yam.

Mus ua qhov qub nrog rau seem ntawm LED Phab Ntsa, tab sis nco ntsoov tias Anodes ntawm Phab Ntsa ib txwm ntsib tib txoj kev coj. (hauv daim duab 3 txhua qhov Anodes ntawm Phab Ntsa ntsia sab laug)

Thaum tag nrho lub voos xwmfab nyob hauv qhov chaw, peb yuav tsum tau muab tshuaj txhuam Anodes ntawm txhua txheej ua ke. Txhawm rau ua qhov no peb coj lwm ~ 16cm daim hlau ncaj thiab tso nws rau saum txheej thawj, yog li xaim kov txhua qhov xov hlau Anode ntawm 6 phab ntsa hauv ib txheej. Saib xyuas tias cov xaim tshiab tsis kov ib yam ntawm Cathodes. Muab cov xaim tso rau hauv qhov chaw thiab rov ua qhov qub rau 5 txheej ntxiv.

Kauj Ruam 5: Cube Txuas

LED tsav tsav
LED tsav tsav
LED tsav tsav
LED tsav tsav
LED tsav tsav
LED tsav tsav

Qhov rau LED Tsav Tsheb:

  • 7 tx5940
  • 6/7 x 10 uF Capacitors
  • 2 x 1000 uF Capacitors
  • 7 x 2.2 kOhm Resistors
  • 7 x 28pin IC Qhov (Socket)
  • 7 x 0.1uF Capacitors
  • Ribbon Cable

Tsiv mus rau qhov kev tswj hwm Circuit Court, cia xub xub saib ntawm LED tsav tsheb. Raws li tau hais ua ntej peb xav tau 7 TLC5940 txuas nrog Arduino Nano. Txhua yam ntawm TLC5940 Chips yog daisy saw uas txhais tau tias txhua qhov kev tswj Pins ntawm Cov Tsav Tsheb tau sib cuam tshuam (piv txwv li BLANK tus pin ntawm thawj TLC txuas nrog BLANK ntawm qhov thib ob, thib peb, plaub, … TLC) thiab txhua tus tau txuas nrog Arduinowith tib cov xov hlau, tshwj tsis yog Serial Hauv uas yog thawj zaug txuas los ntawm Arduino Digital Pin mus rau thawj TLC, tom qab ntawd Tus lej Serial Out ntawm thawj TLC no txuas nrog SIN tus pin ntawm TLC thib ob thiab ntxiv rau (saib daim duab 4) …

Yog li cov txheej txheem ntawm TLC Pawg Thawj Coj yog qhov yooj yim heev raws li koj tuaj yeem pom hauv kab ntawv txuas nrog.

(Yog tias koj xav tau ECHCH BOARD JUMP TO STEP 8)

Kuv kuj tau txuas ib daim duab ntawm schematic hauv frizz uas suav nrog tus lej cim npe thiab tseem yog GIMP.xcf cov ntaub ntawv nrog txheej rau txhua qhov Kev Tswj Pin txuas sib cais.

Pib los ntawm kev siv tag nrho cov IC ntsaws rau hauv qhov chaw, tom qab ntawd ntxiv 100nF Capacitors rau txhua TLC, tom qab ntawd 2.2kOhm resistorsto IREFand GND thiab 7 tus pin Header nyob rau sab xis saum toj kawg nkaus.. Tom qab ntawd koj tuaj yeem ua raws li.xcf cov ntaub ntawv los ntawm pib nrog "SIN txheej" hauv Gimp cov ntaub ntawv uas qhia txog yuav ua li cas txuas Serial IN/OUT pins ntawm tus tsav tsheb siv Ribbon Cables, tom qab ntawd ua kom CLK Layer hauv GIMP thiab ntxiv rau. Nco ntsoov tias koj muaj kev sib txuas zoo ntawm + thiab - Pins rau tus pin Header nyob rau sab saum toj txoj cai Qhov seem ntawm cov phiaj xwm yuav tsum yog tus kheej piav qhia tab sis nco ntsoov tias koj ntxiv txaus 1000uF thiab 10uF Capacitors rau lub rooj tsavxwm nws tsis muaj feem cuam tshuam qhov twg raws nraim koj tso lawv.

Thaum lub rooj tsavxwm no tiav koj tuaj yeem txav mus rau Arduino Board hauv kauj ruam tom ntej.

Kauj Ruam 7: Arduino + Bluetooth Control Board

Arduino + Bluetooth Control Board
Arduino + Bluetooth Control Board

Qhov Chaw rau Pawg Tswj Xyuas:

  • 6 x IRF 9540 P-Channel MOSFETs
  • 1 x 10 uF Capacitors
  • 1 x 1000 uF Capacitors
  • 7 x 2.2kOhm Resistors
  • 1 x 1 kOhm Resistor
  • 2 x 14 Poj niam tus pin Header
  • 1 x Arduino Nano
  • 1 x 1N4001 Diode
  • 1 x 0.1uF Capacitors
  • 1 x DC Jack PCB Mount
  • 1 x HC-05 Bluetooth Module
  • 1 x 3.5mm Audio Jack

Pawg Tswj Xyuas Arduino feem ntau yog tuav cov kev sib tw zoo ib yam li muab cov khoom sib piv ntawm tus pin header ntawm LED Tsav tsheb.

Soldering ntawm perfboard:

  1. Muab ob tus poj niam Pin lub taub hau los ua lub qhov rau Arduino nyob nruab nrab ntawm pawg thawj coj.
  2. Muab 6 MOSFETs ua ke ib sab ntawm sab xis ntawm Arduino (sab nrog Analog Pins) thiab ntxiv 2.2kOhm resistor ntawm thawj thiab tus pin kawg txhua.
  3. Tam sim no tso 6 tus pin header nyob rau pem hauv ntej ntawm MOSFETs (nruab nrab ntawm kab) thiab txuas 6 DRAIN tus pin ntawm FETs (tus pin nruab nrab) mus rau lub header thiab GATE pins (tus pin sab laug) ntawm FETs rau cov khoom Arduino Analog pins.
  4. Tom ntej no, siv lub 7pin header rau LEDDriver kev sib txuas ntawm lwm sab ntawm Arduino, tawm qee qhov chaw rau cov xov tooj thiab txuas tag nrho cov kev sib txuas los ntawm Arduino mus rau tus pin header.
  5. Ntxiv qee lub capacitors (1-2 1000uF, 1 10uF, 100nF ib sab ntawm Arduino) rau cov dej tam sim no.
  6. Solder 4 tus pin header nyob ib sab ntawm sab nraum qab ntawm Arduino rau HC-05 module thiab ua 4 txuas rau VCC, RX, TX, GND thiab tsis txhob hnov qab ua qhov sib faib hluav taws xob los ntawm RX Pin ntawm HC-05 thiab TX Pin of Arduino (saib ntawm no)
  7. Muab DC Jack tso rau ntawm ib sab ntug ntawm lub rooj tsavxwm nrog hloov mus ib sab thiab txuas tus pin ncaj ntawm qhov hloov mus rau + Pin ntawm DC Jack
  8. Thaum kawg ua txhua qhov tsim nyog Txuas Hluav Taws Xob los ntawm GND Pin ntawm DC Jack thiab tus pin txoj cai ntawm qhov hloov (VCC) mus rau Arduino, MOSFETs, Capacitors thiab HC-05 raws li pom hauv cov txheej txheem. Nco ntsoov ntxiv Diode tsuas yog muab Lub Hwj Chim los ntawm VCC tus pin ntawm qhov hloov pauv mus rau hauv Arduinos 5V tus pin, tsis yog lwm txoj hauv kev. (Qhov no tiv thaiv Arduino thaum ua haujlwm nws ntawm USB txuas)

Rau qhov txuas hluav taws xob Kuv siv DC Power Jackwith hloov pauv yooj yim, koj kuj tseem tuaj yeem siv USB txuas yog tias koj xav tau. Kuv tshaj qhov txuas hluav taws xob mus rau lwm lub rooj sib tham me me kom zoo haum rau hauv kuv lub rooj ntoo tab sis koj tuaj yeem yooj yim muab nws ncaj qha mus rau Arduino Board. Raws li tau hais hauv thawj kauj ruam tseem muaj MSGEQ7 Kev Sib Txuas Circuit hauv cov txheej txheem tab sis tsuas yog tsis quav ntsej tias yog tias koj tsis siv MSGEQ7. (Yog xav paub ntxiv txog MSGEQ7 kev ua haujlwm nyem ntawm no)

Tsis txhob hnov qab ua lwm 7Pin Ribbon Cable nrog txiv neej tus pin Headers ntawm txhua qhov kawg rau kev txuas Arduino board nrog Driver board

Kauj Ruam 8: Tsis teb los tau: Etching Circuit Board

Tsis teb los tau: Etching Circuit Board
Tsis teb los tau: Etching Circuit Board
Tsis teb los tau: Etching Circuit Board
Tsis teb los tau: Etching Circuit Board
Tsis teb los tau: Etching Circuit Board
Tsis teb los tau: Etching Circuit Board

Yog li yog tias koj tsis nyiam soldering ntau ntawm cov kab lus tau kawg koj tseem tuaj yeem kos cov PCB uas tsim nyog yog tias koj nyiam qhov ntawd.

Hauv kuv lub voos xwmfab Arduino pawg thawj coj saib thiab Lub Hwj Chim/Suab txuas lub rooj sib tham yog ob qho tib si sib dhos siv cov ntawv schematic/EAGLE txuas. Thawj zaug kuv tau ua yuam kev hauv cov txheej txheem yog li kuv yuav tsum rov ua dua LED Tsav tsheb zoo li kuv tau ua hauv cov kauj ruam kawg. Tsis muaj qhov txiaj ntsig zoo los kos lub rooj tsavxwm tsis txhob siv lub rooj sib tham, yog li xav tias dawb los xij ntawm lub rooj tsavxwm lossis muab tshuaj txhuam rau ntawm cov ntawv ntoo.

Hauv qhov txuas.zip koj tuaj yeem pom ob daim ntawv BOARD nrog rau SCHEMATIC cov ntaub ntawv.

Daim ntawv ceeb toom tias cov txheej txheej saum toj kawg nkaus (liab) yuav tsum yog xaim hlau txuas (txij li kuv tsis tuaj yeem khawb ob tog sab hauv tsev). Cov kab ke tsis tau qhia tawm qhia txog kev sib txuas ua los ntawm cov xov rau poj niam Pin Headers.

Cov txheej txheem suav nrog MSGEQ7 qhov tshwj xeeb, uas koj tuaj yeem yooj yim rho tawm los ntawm kev tshem tawm ntu ntawm cov phiaj xwm cim "(MSGEQ7)" hauv lub screenshot ntawm.pdf schematic.

Kauj Ruam 9: Txuas lub Cube

Txuas lub Cube
Txuas lub Cube
Txuas lub Cube
Txuas lub Cube
Txuas lub Cube
Txuas lub Cube

Txhawm rau txuas txhua ntu ntawm lub voos xwmfab, pib los ntawm ntsaws rau hauv 7pin Cable rau Arduino Board thiab Driver Board (xyuas kom tseeb tias kev taw qhia raug!). Tom ntej txuas rau HC05 Module rau 4 Tus pin header thiab txuas rau Pawg Thawj Fwm yog tias sib cais.

Txhawm rau txuas 7x16 Tus Pin Headers ntawm Lub Cube nco ntsoov pib nrog thawj TLC (tus uas nws tus lej PIN txuas nrog Arduino ncaj qha). Nrhiav qhov tseeb 16pin Cable los ntawm lub voos xwmfab thiab txuas nws mus rau thawj TLC tus pin header (nco ntsoov tias kab rau Cathode Nr.0 txuas rau thawj TLC OUT0 Pin!). Mus thiab txuas rau lwm 16pin Cables rau qhov sib thooj TLC headers hauv qhov kev txiav txim raug.

Qhov kawg tab sis tsis tsawg kawg, txuas 6Pin Cable rau Anodes los ntawm Cube mus rau 6Pin lub taub hau ntawm Pawg Tswj Xyuas ib sab ntawm MOSFETs.

Txhawm rau ua kom tiav lub voos xwmfab kuv ntxiv cov phab ntsa rau rooj plaub nrog qee cov plywood ntxiv nrog cov xim dub rau nws thiab ua rau lawv nyob hauv.

Tam sim no peb tau ua tiav nrog tag nrho cov cuab yeej xav tau rau tag nrho kev tsim!

Kauj ruam 10: Software: Cycle Multiplexing

Software: Multiplexing Cycle
Software: Multiplexing Cycle

Tam sim no hauv kev xav Arduino tau ua tiav raws li cov hauv qab no:

  1. Yog tias LayerDuration dhau los, thauj cov txiaj ntsig rau Txheej Tom ntej mus rau TLCs, tua txheej tam sim no, tig rau txheej tom ntej, rov teeb tsa LayerDuration, cog lus tus nqi tshiab rau TLCs
  2. Yog tias FrameDuration tau dhau mus, thauj tus ncej tshiab ntawm Animation tam sim no los ntawm khaws cov txiaj ntsig rau txhua LEDs thiab Xim rau hauv ValueLed tsis, rov pib dua FrameDuration
  3. Yog tias Bluetooth Cov Ntaub Ntawv muaj, ua raws li lawv (Hloov Animations, Brightness, …) (xav paub ntau ntxiv tom qab)

Raws li koj tuaj yeem pom lub ntsiab lus tseem ceeb ntawm txoj cai yog nrawm. Nws yog ib qho tseem ceeb uas lub sijhawm hloov Cov Txheej Txheem yog qhov tsawg heev.

Qhov sai dua koj hloov/tawm Cov Txheej Txheem ntau dua "Frames" koj yuav tau txais. rau 6x6x6 RGB LED Lub Vev Xaib zoo li qhov no kuv xam pom tias Txheej Txheej Ntev ntawm 1700 microSec. yog qhov zoo txaus kom ua rau flickering tsawg kawg thiab yuav tsum tau sab laug ntawm tus nqi no. FrameDuration tswj ntau qhov nrawm ntawm Animation yog li nws tuaj yeem hloov pauv rau Animations sib txawv.

Hauv qib tom ntej peb yuav saib yuav ua li cas peb thiaj tuaj yeem sau peb tus kheej Animations.

Kauj ruam 11: Custom Animations

Kev cai Animations
Kev cai Animations
Kev cai Animations
Kev cai Animations

Txhawm rau ua qhov kev ua yeeb yaj kiab peb yuav tsum teeb tsa Tus Nqi ValueLed tsis mus rau qhov muaj txiaj ntsig peb xav tau rau tus ncej tom ntej txhua lub sijhawm FrameDuration dhau los. Peb ua qhov ntawd los ntawm kev hu Macro ua haujlwm "SETLED (x, y, z, COLOR, Brightness)"

x, y, z yog qhov ua haujlwm ntawm LED uas peb xav teeb tsa thiab COLOR (RED, GREEN lossis BLUE) yog xim uas peb xav teeb tsa thiab ci ntsa iab yog tus nqi tiag rau cov xim tshwj xeeb no peb tau teeb tsa.

Yog li piv txwv siv qhov Animation uas yooj yim qhia Liab, Ntsuab thiab Xiav xim hla hla tag nrho lub voos xwmfab koj tuaj yeem yooj yim ua qhov no:

void randomLedsFull () {

rau (uint8_t j = 0; j <CUBE_SIZE; j ++) {rau (uint8_t x = 0; x <CUBE_SIZE; x ++) {rau (uint8_t y = 0; y <CUBE_SIZE; y ++) {uint8_t rand = random8 (3); SETLED (x, y, j, rand, maxBright); }}}}

Txoj kev no yog hu ua txhua lub sijhawm FrameDuration tau dhau los thiab raug xaiv los ntawm qhov hloov pauv-hais kom ua hauv lub voj (). Yog tias koj sau cov duab tshiab koj tuaj yeem ntxiv lawv los ntawm kev yooj yim ntxiv lawv rau hauv cov ntaub ntawv hloov chaw.

Kauj Ruam 12: Ntxiv: AnimationCreator

Ntxiv: AnimationCreator
Ntxiv: AnimationCreator

Kuv ntxiv sau AnimationCreator siv JavaFX thiab Java3D.

Nws ua rau tsim thiab kho cov kev cai Animations yooj yim heev los ntawm kev muab qhov yooj yim nkag siab UI.

Koj tuaj yeem tsim, kho, hloov npe thiab rov teeb tsa Cov Duab rau 4x4x4, 6x6x6 lossis 8x8x8 LED Cubes

Txhawm rau tsim cov Animation tshiab yooj yim ntaus Cov Ntaub Ntawv> Tshiab, hauv qab "Cube" koj tuaj yeem xaiv lub Cube loj, los teeb Cov Xim ntawm LED xaiv cov xim uas koj xav tau nrog Cov xim xaiv nyob rau sab laug thiab tom qab ntawd nyem rau ntawm LEDs koj xav tau xim ntawd rau tus ncej ntawd. Txhawm rau ntxiv Lwm Tus Ntaus "Tom ntej" lossis "+". Tus so ntawm UI Kev Tswj yog qhov piav qhia tus kheej heev, lub npov nyob ib sab ntawm Cubes Layers yog txhawm rau txheeb xyuas Cov Txheej Txheem twg yuav tsum cuam tshuam los ntawm kev hloov pauv thiab "Khaws Ncej". Tsuas yog sim nws thiab koj yuav xam tawm txhua yam nyob rau hauv tsis muaj sijhawm.

Ib qho ntxiv los sim qhov Animation koj tuaj yeem nyem lub pob "View 3D" uas qhib lwm lub qhov rais nrog Java3D Qauv ntawm Lub Cube. Koj tuaj yeem tig lub Koob Yees Duab thaum tuav sab laug nas khawm (Nias R kom rov kho lub Koob Yees Duab). To ua si/ncua lub Animation ntaus P Key, kom rov pib ua Animation ntaus Q. TextField hauv qab "View 3D" buttondenotes tam sim no FrameTime, ua qhov nrawm ntawm koj qhov kev ua yeeb yaj kiab.

Thaum koj ua tiav nrog Animation muab nws lub npe thiab ntaus Cov Ntaub Ntawv> Txuag Raws li … thiab khaws cov Animation rau tib daim nplaub tshev zoo li Cubo_Control.ino Sketch.

Txhawm rau suav nrog koj cov Animation tshiab hauv Sketch qhib Cubo_Control.ino thiab ntxiv cov cai hauv qab no rau saum Sketch:

#suav nrog "RGBit.h" // Hloov

Nqes mus rau BTEvent () thiab ntxiv cov ntaub ntawv cov ntaub ntawv mus rau qhov hloov pauv-rooj plaub ntawm cov animations

hloov (curAnim) {

… Case 10: animation = & ani_cubesmove [0] [0]; FRAME_TIME = ANI_CUBESMOVE_FRAMTIME; maxCount = ANI_CUBESMOVE_FRAMES; tawg; rooj plaub 11: // KOJ YUAV TSUM NYEEM TSHIAB animation = & ani_rgbit [0] [0]; FRAME_TIME = RGBIT_FRAMETIME; maxCount = ANI_RGBIT_FRAMES; tawg; }

Kauj Ruam 13: Bluetooth App

Bluetooth App Cov
Bluetooth App Cov

Txhawm rau tswj lub Cube, ua tsaug rau HC-05 Module nws yooj yim heev los tsim Bluetooth app los txuas koj Xov Tooj rau Cube.

Txuas mus rau App: Github

Lub App tau qhib qhov chaw yog li xav tau ntxiv ntxiv Animations/nta koj tus kheej.

  • Pib App, nws nug koj kom qhib Bluetooth
  • Nyem "Tshawb nrhiav" thiab cov npe muaj Bluetooth sib txuas tshwm. Txheeb xyuas HC-05 Module los ntawm Cube thiab nyem rau ntawm nws.
  • Yog tias muaj qhov ua yuam kev thaum sim txuas rau Lub Cube, sim ua khub HC-05 tus qauv hauv Bluetooth teeb tsa tus kheej
  • Thaum txuas nrog App hloov mus rau Lub Vev Xaib Tswj thiab Bluetooth txuas tau tsim

Tswj

  • Ceev & Ci ntsa iab: Hloov qhov ntsuas qhov ntsuas kom nrawm dua/qeeb Animation lossis hloov qhov ci ci
  • Animations: Nyem rau ntawm lub pob kom hloov qhov Animation, los ntawm lub neej ntawd Animations tau rov ua dua (Pib los ntawm sab laug sab laug lub pob sib xws rau currAnim)
  • Text Scroll: Nyem rau "Text" khawm uas coj los sib tham los nkag rau qee cov ntawv uas yuav raug nqes los ntawm lub voos xwmfab
  • Hais kom ua: Koj tuaj yeem nkag mus ua lus txib tus kheej nrog Command TextField (saib mus rau hauv BTEvent () txoj kev ntawm Cubo_Control.ino rau syntax)
  • Snake: Game Snake classic (liab: apple, ntsuab: nab Lub taub hau, xiav: sneak Tail) (Kev tswj: 4 lub khawm qhia, nce thiab nqis yog tshwm sim los ntawm kev xa Xov Tooj rau pem hauv ntej (Up) lossis rov qab (Down))
  • Suab Visualizer: MSGEQ7 siv los pom 6 lub suab band los ntawm AUX Jack (Khawm rau Animation 7)

Kauj ruam 14: Showcase

Pom zoo: