Cov txheej txheem:

LED Dance Room: 7 Kauj Ruam
LED Dance Room: 7 Kauj Ruam

Video: LED Dance Room: 7 Kauj Ruam

Video: LED Dance Room: 7 Kauj Ruam
Video: I.aM.mE presents: "if i was you"O.M.G by DI"MOON"ZHANG 2024, Kaum ib hlis
Anonim
LED Dance Room
LED Dance Room

Nov yog phau ntawv qhia rau tsim Arduino-based LED music visualizer, AKA chav ua las voos zoo nkauj tag nrho. Muaj ntau yam kev qhia nyob ib puag ncig cov lus qhia hais txog kev siv lub tshuab ua kom pom tseeb, tab sis feem ntau yog qee yam ntawm lub tshuab ua kom nrov nrov kom ua rau lub teeb mem tes thiab hloov pauv siv zog los teb rau lub zog xa hauv lub suab. Kuv xav tau ib yam dab tsi ntau dua ntawm kab ntau strobes teb rau ntau zaus ntawm cov nkauj. Qhov kawg tshwm sim yog tus txiv neej hloov pauv ntawm qhov no thiab qhov no thiab qhov me me ntawm qhov no, tab sis nws yog qhov muaj txiaj ntsig tag nrho. suab los ntawm iPod / Rock Band / karaoke / xijpeem koj vwm rau menyuam yaus tuaj yeem npau suav. Yog suab nkauj tshiab! Kev tso siab ntawm DoKashiteru thiab Creative Commons, Kuv coj koj cov vis dis aus tsis raug cai ntawm lub kaw lus hauv kev nqis tes ua:

Kauj Ruam 1: Qhov Chaw / Cov Cuab Yeej

Qhov / Cov Cuab Yeej
Qhov / Cov Cuab Yeej

Qhov: LEDs - Pom tseeb. Kuv yuav qhov ci 10mm tiag tiag hauv cov xim sib txawv hauv ntau los ntawm eBay, tab sis koj tuaj yeem pom lawv ntawm Digikey lossis Mouser. Cov qhab nia millicandela siab dua yog qhov zoo dua, tshwj xeeb tshaj yog tias koj xav kom cov no ua kom pom dab tsi thiab tsis yog qhov xim. Khw ib ncig kom pom qhov zoo. Resistors - Ib qho rau txhua LED. Kuv xav tau 470 ohms, tab sis nco ntsoov tias koj txheeb xyuas qhov ntsuas ntawm koj li LEDs kom koj tau txais lub teeb ntau npaum li sai tau yam tsis hlawv lawv. Solderless breadboad - Rau tag nrho cov Circuitry. Arduino - Lub computer/Circuit interface. Ib pawg txaus txaus. Yuav nws hauv online. Hlau - Muaj ntau cov tub ntxhais hlau. Kuv xav tau ntau, nrawm, yog li kuv tau ua tiav kev ntxuav tawm kuv lub xov tooj cua RadioShack ntawm cov khoom no, tab sis koj yuav tsum muaj peev xwm pom nws pheej yig dua. Muaj ob txoj hlua tuav ua ke zoo li qhov no muaj txiaj ntsig zoo, raws li koj yuav pom tom qab. Khoos phis tawj - Qhov twg qhov kev suav tiag tshwm sim. Yog lawm, qhov no tuaj yeem ua rau me ntsis overkill rau ob peb lub teeb, tab sis raws li peb tsis tuaj yeem xaus ua si peb cov nkauj seev cev los ntawm lub khoos phis tawj txawm li cas los nws ua haujlwm tau zoo. Cov khoom siv hluav taws xob - Cov LEDs yuav zoo li muaj hwj chim ntau dua li arduino tuaj yeem muab tau, yog li peb tab tom yuav txhawb lawv sab nraud thiab hloov lawv nrog transistors. Koj yuav tsum muaj cov pawg no dag ib puag ncig los ntawm cov khoom siv hluav taws xob qub, lossis koj tuaj yeem pom lawv ntawm cov khw muag khoom. Saib nplooj ntawv npaj rau qhov voltage / amperage koj xav tau dab tsi. NPN transistors - Peb tab tom siv cov no ua cov khoom siv tam sim no / hloov pauv. Me ntsis tam sim no kos los ntawm arduino tswj ntau qhov tam sim no kos los ntawm cov khoom siv hluav taws xob uas khiav los ntawm LEDs. Nrhiav lawv hauv online lossis ntawm RadioShack. Soldering hlau - Zoo nkauj tus kheej piav qhia. Hais lus / suab splitter / txiv neej -txiv neej lub suab cable - Hais lus rau lub suab, splitter thiab cable kom pub lub teeb liab los ntawm lub mloog pob ntseg tso rau tus hais lus thiab lub mloog pob ntseg. Software: Arduino - Rub tawm arduino software ib puag ncig los ntawm no. Ua - Ua cov lus hais tau zoo nrog arduino, thiab muaj qee lub tsev qiv ntawv txaus ua hauv. Rub nws los ntawm no. Nco ntsoov tias koj muaj qhov hloov tshiab kawg ntawm Minim suab ua lub tsev qiv ntawv los ntawm no. Koj kuj tseem yuav tsum tau txais lub tsev qiv ntawv 'arduino' kom lawv sib txuas lus - tau nws los ntawm no thiab lo nws hauv koj li Kev Ua Haujlwm/qiv ntawv.

Kauj Ruam 2: Tsim Circuit Court

Tsim Circuit Court
Tsim Circuit Court

Ib qho kev pom tag nrho ntawm Circuit Court peb tab tom tsim. Ob txoj hlua ntawm cov xaim txuas nrog qhov siab thiab qis voltage, thiab txhua LED/resistor khub txuas lawv kom pom kev. Cov hluav taws xob qis qis tau txuas nrog hauv av los ntawm transistor kom peb tuaj yeem tswj tus nqi tam sim no uas ntws (thiab yog li qhov ci ntawm LEDs).

Kauj ruam 3: Npaj

Kev npaj!
Kev npaj!
Kev npaj!
Kev npaj!

Cov kauj ruam tseem ceeb tshaj plaws yog npaj seb cov xim twg koj xav tau, thiab nyob qhov twg. Lub qab nthab hauv kuv chav pw tau piav qhia zoo tshaj li "waffle-shaped," nrog cov kab plaub fab sib dhos ua ke saum npoo. Cov no tau ua kab sib chaws zoo nkauj los teeb cov xim, tab sis koj yuav tsum tau los nrog koj li phiaj xwm. Koj tuaj yeem txiav txim siab txog li 8 lossis ntau dua LEDs rau ib qho kev tswj hwm ib leeg, txhais tau tias cov 8 yuav qhib thiab tua ib txhij. Qhov txheej txheem teeb tsa txhua qhov, tam sim no peb xav tau kev suav fais fab. Txheeb cov ntawv txheeb rau koj cov LEDs txhawm rau txheeb xyuas qhov ua ntej thiab qhov tam sim no. Kuv muaj qhov poob qis ntawm ~ 3.5 volts thiab muaj qhov siab tshaj tam sim no ntawm 20 milliamps. Raws li kuv muaj 12 volt fais fab tuag nyob ib puag ncig, peb tuaj yeem ua qhov yooj yim me me ntawm kev ua lej siv Ohm's Law (V = IR): (12 - 3.5) = 0.02 * R R = 425 ohms. Rau qhov yooj yim peb hloov qhov ntawd mus rau 470 ohms. Feem ntau 5mm LEDs yuav muaj qhov poob qis ib puag ncig 2 volts thiab ntsuas tam sim no nyob ib puag ncig 15 milliamps, tab sis xyuas kom koj tsis txhob hlawv lawv. Nco ntsoov: lub teeb siv sib piv rau qhov tam sim no, yog li siv lub zog loj dua los txwv qhov tam sim no yog tias lawv ci dhau. Kuj xyuas kom ntseeg tau tias lub zog siv hluav taws xob tuaj yeem tswj tau txhua qhov tam sim no - qee qhov me me tsuas yog ntsuas rau ob peb puas milliamps, txhais tau tias koj tuaj yeem tsuas yog siv hluav taws xob 10-20 LEDs ua ke zoo ib yam li peb.

Kauj Ruam 4: Npaj LEDs thiab Hlau

Npaj LEDs thiab Hlau
Npaj LEDs thiab Hlau
Npaj LEDs thiab Hlau
Npaj LEDs thiab Hlau

Nws yooj yim dua los txuas cov LEDs rau cov xov hlau yog tias peb xub muab lawv sib dhos ua ke nrog cov tiv thaiv. Txiav ob qho tsis zoo (luv dua) cov hlau lead ntawm LED thiab ib sab ntawm tus tiv thaiv txog ib nrab, tom qab ntawd muab lawv sib dhos ua ke. Thaum qhov no ua tiav, khoov cov hlau lead zoo thiab cov tiv thaiv sab nrauv kom lub LED lo me ntsis. Saib daim duab kom pom meej dua. Tom ntej no, teeb tag nrho cov xov hlau thiab xyuas kom koj muaj txaus rau txhua txoj hlua kom ncav tau. Ntsuas tawm thiab cim qhov twg txhua qhov LED xav tau mus. Ib zaug ntxiv, qhov kev piav qhia rau qhov txuas tiag yog qhov zoo tshaj plaws los ntawm daim duab. Solder cov LEDs rau cov xaim, ua kom ntseeg tau tias qhov sib txawv tsis sib xws - txhua qhov ua tau zoo coj mus rau ib lub xaim, thiab txhua qhov tsis zoo ua rau lwm tus. Thaum koj ua tiav, sim cov hlua ua ntej koj tso lawv - txuas cov xov hlau rau koj lub hwj chim lossis lub roj teeb 9 volt kom paub tseeb tias txhua lub teeb qhib. Hauv kuv qhov xwm txheej, qhov no cuam tshuam nrog ntau thiab ntau daim kab xev dawb dawb thiab sawv ntawm lub rooj zaum. Nco ntsoov tias qhov kawg pub dawb txhua qhov tuaj ua ke ntawm ib qho chaw, qhov uas peb yuav tso lub khob cij, arduino, thiab khoos phis tawj. Kuv kuj tso me ntsis origami globes hla lub LEDs kom nthuav lub teeb - tsuas yog txiav cov qhov me me tawm sab nraud los ntawm lub qhov hauv lub zais pa kom ua plaub tab thiab nws yuav plam zoo. Saib daim duab ntawm nplooj ntawv dhau los kom pom cov txiaj ntsig. Cov ntsiab lus ntxiv yog tias lub ntiaj teb tau tsim los ntawm cov lus qhuab qhia qub.

Kauj Ruam 5: Tsim Circuitry

Tsim Circuitry
Tsim Circuitry
Tsim Circuitry
Tsim Circuitry
Tsim Circuitry
Tsim Circuitry
Tsim Circuitry
Tsim Circuitry

Yeej tsis muaj ntau yam hais ntxiv. Txuas qhov ua tau zoo thiab tsis zoo los ntawm koj lub zog xa mus rau txoj kab hluav taws xob ntawm koj lub khob cij, thiab txuas rau tus pin arduino hauv av rau tib txoj kev tsheb ciav hlau tsis zoo. Saib daim duab kom muaj txheej txheem txheej txheem zoo. Kuaj tias txhua yam ua haujlwm los ntawm kev tshem cov coj los ntawm arduino (qhia hauv xiav, dub, thiab liab hauv qab) thiab txuas lawv mus rau txoj kev tsheb nqaj hlau zoo. Tam sim no yuav ntws los ntawm cov transistors thiab tso cai rau LEDs qhib (yog tias txhua yam txuas nrog kom raug). Muab cov no rov qab li cas lawv yuav tsum yog thiab txuas lub arduino rau koj lub khoos phis tawj nrog kab ke usb. To teeb tsa lub suab kaw, ntsaws tus hais lus thiab txiv neej-txiv neej cable rau hauv lub splitter. Xa lwm qhov kawg ntawm tus txiv neej-txiv neej cable rau hauv lub microphone nkaus ntawm koj lub computer. Ib zaug ntxiv, qhov no yog overkill me ntsis yog tias koj tsuas yog mus ua suab los ntawm koj lub khoos phis tawj (tshwj xeeb tshaj yog tias koj tuaj yeem txiav txim siab yuav siv jack li cas) tab sis txoj hauv kev no cov kab ke tuaj yeem nyem rau Rock Band lossis karaoke lossis lwm yam uas tuaj yeem tso tawm ntawm 3.5mm lub mloog suab. Kev paub tseeb tias koj lub microphone ua haujlwm - ntsaws lub splitter rau hauv txhua lub suab, tom qab ntawd qhib lub kaw lus kaw suab kom pom tias koj puas tau sau npe lub teeb liab. Ntau zaus lub microphone tuaj yeem ntsiag to, yog li yog tias koj muaj teeb meem uas yog thawj qhov chaw los saib.

Kauj Ruam 6: Txoj Cai Code

Qhib arduino software ib puag ncig, thiab xa cov StandardFirmata piv txwv kos duab rau pawg thawj coj saib. Cov duab kos yuav tso cai rau koj los tswj cov arduino hla tus lej sib cuam tshuam, lub ntsiab lus tsis raug cai ntawm lub khoos phis tawj tuaj yeem tswj lub teeb uas peb nyuam qhuav sib txuas. Nws yog nyob ib puag ncig qhov txaus ntshai BeatDetect lub tsev qiv ntawv hauv lub tsev qiv ntawv tsawg. Chav Kawm BeatDetect suav nrog Fourier hloov pauv ntawm lub teeb liab, thiab taug qab qhov nruab nrab thiab qhov sib txawv ntawm txhua qhov sib koom ua ke rau ob peb feeb dhau los. Yog tias tus nqi hauv ib qho ntawm FFT lub thoob ntau tshaj qhov sib txawv, qhov ntsuas tau pom thiab lub teeb cuam tshuam nrog qhov zaus ntawd yuav qhib.. Qhov no txhais tau li cas yog tias txhua txoj hlua ntawm LEDs yuav sib raug rau ntau zaus ntawm suab paj nruag - ib txoj hlua yuav nyem rau cov ntses bass thaj tsam, lwm qhov rau snare tsoo, lwm qhov kom sau suab nrov, thiab lwm yam, rau 26 qhov sib txawv. kos duab los ntawm hauv qab no, thiab hloov pauv ledPins array ntawm kab 10 kom pom koj tus kheej teeb tsa. Thawj tus lej tus lej sib raug rau qhov qis tshaj. Thaum qhov no tiav, koj ua tiav! Plug lub suab sib cais rau hauv koj lub mloog pob ntseg, pib kos duab, thiab pib ua si qee lub suab paj nruag. Yog tias txhua yam ua haujlwm raws li qhov xav tau, lub teeb pom kev zoo yuav tshwm thiab lub teeb yuav ci. Txaus siab rau!

Kauj ruam 7: Troubleshooting

Cov teeb meem tseem ceeb uas koj yuav ntsib tau yog Kev Ua thiab cov arduino los tham nrog ib leeg. Nco ntsoov koj teeb tsa software arduino - qhov no yuav nqa nrog nws txhua lub tsev qiv ntawv tsim nyog. Koj tuaj yeem pom kev zam teeb meem nrog Circuit Court los ntawm kev sim thaum koj mus - sim txhua LED, tom qab ntawd txhua txoj hlua, tom qab ntawd txhua tus transistor teeb tsa. Yog tias txhua yam ua tsis tau rov qab mus rau qhov no txhawm rau txheeb xyuas qhov teeb meem nyob qhov twg. Tam sim no uas kuv tau tswj hwm kom tshem tawm txhua qhov kab los ntawm kuv tus kheej teeb tsa, Kuv tsis tuaj yeem xav txog qhov lawv tawm ntawm kuv lub taub hau. Tshaj tawm cov teeb meem uas koj muaj, raws li kuv tej zaum tau khiav mus rau lawv thiab txij li tsis nco qab lawm.

Pom zoo: