Cov txheej txheem:

Tsis-Addressable RGB LED Sawb Suab Visualizer: 6 Cov Kauj Ruam (nrog Duab)
Tsis-Addressable RGB LED Sawb Suab Visualizer: 6 Cov Kauj Ruam (nrog Duab)

Video: Tsis-Addressable RGB LED Sawb Suab Visualizer: 6 Cov Kauj Ruam (nrog Duab)

Video: Tsis-Addressable RGB LED Sawb Suab Visualizer: 6 Cov Kauj Ruam (nrog Duab)
Video: How to connect LED STRIP to speaker(BASS) 2024, Kaum ib hlis
Anonim
Image
Image

Kuv tau muaj 12v RGB LED sawb nyob ib ncig ntawm kuv lub TV txee ib ntus thiab nws tau tswj los ntawm tus neeg tsav tsheb LED tho txawv uas cia kuv xaiv ib qho ntawm 16 xim ua ntej programmed!

Kuv mloog ntau lub suab nkauj uas ua rau kuv mob siab tab sis lub teeb pom kev tsuas yog tsis ua rau lub siab xav raug. Txhawm rau kho qhov kev txiav txim siab coj lub teeb liab uas tau muab rau kuv tus neeg hais lus los ntawm AUX (3.5 hli nkaus), txheej txheem nws thiab tswj cov RGB sawb raws li.

Cov LEDs hnov suab paj nruag raws li qhov loj ntawm Bass (Tsawg), Treble (Nruab Nrab) thiab Siab ntau.

Zaus ntau - Xim yog raws li hauv qab no:

Tsawg - Liab

Mid - Ntsuab

Siab - Xiav

Txoj haujlwm no cuam tshuam nrog ntau yam khoom DIY vim tias tag nrho cov Circuit Court tau tsim los ntawm kos. Qhov no yuav tsum yooj yim zoo nkauj yog tias koj tab tom teeb tsa nws ntawm lub khob cij, tab sis nyuaj heev kom muab nws tso rau hauv PCB.

Khoom siv

(x1) RGB LED Sawb

(x1) Arduino Uno/Nano (Mega tau pom zoo)

(x1) TL072 lossis TL082 (TL081/TL071 zoo ib yam)

(x3) TIP120 NPN Transistor (TIP121, TIP122 lossis N-Channel MOSFETs zoo li IRF540, IRF 530 zoo heev)

(x1) 10kOhm potentiometer linear

(x3) 100kOhm 1/4watt resistors

(x1) 10uF electrolytic capacitor

(x1) 47nF ceramic capacitor

(x2) 3.5 hli suab txuas - Poj niam

(x2) 9V roj teeb

(x2) 9V roj teeb snap txuas

Kauj Ruam 1: Nkag Siab Hom Hom RGB LED Sawb

Nkag Siab Hom Hom RGB LED Sawb
Nkag Siab Hom Hom RGB LED Sawb

Muaj ob yam yooj yim ntawm cov hlua LED, hom "analog" thiab "digital" yam.

Analog-type (daim duab 1) ib daim kab xev muaj tag nrho cov LEDs txuas nrog ua ke thiab yog li nws ua zoo li ib qho loj loj peb-xim LED; koj tuaj yeem teeb tag nrho cov kab txaij rau txhua yam xim uas koj xav tau, tab sis koj tsis tuaj yeem tswj tus kheej LED cov xim. Lawv yooj yim heev rau siv thiab pheej yig ncaj ncees.

Digital-type (daim duab 2) cov kab ua haujlwm sib txawv. Lawv muaj cov nti rau txhua LED, txhawm rau siv cov kab txaij koj yuav tsum xa cov ntaub ntawv digitally coded rau cov chips. Txawm li cas los xij, qhov no txhais tau tias koj tuaj yeem tswj hwm txhua tus LED ib tus zuj zus! Vim tias qhov nyuaj ntxiv ntawm cov nti, lawv kim dua.

Yog tias koj tab tom nrhiav nws nyuaj rau lub cev txheeb xyuas qhov sib txawv ntawm cov kab sib piv thiab cov hom digital,

  1. Anolog-hom siv 4 tus pin, 1 qhov zoo ib yam thiab 3 qhov tsis zoo piv txwv li ib qho rau txhua xim ntawm RGB.
  2. Hom-hom siv 3 tus pin, zoo, cov ntaub ntawv thiab hauv av.

Kuv yuav siv Analog-type strips, vim

  1. Muaj tsawg heev rau tsis muaj Cov Ntawv Qhia uas qhia yuav ua li cas kom muaj suab paj nruag reactive Analog-type strip Feem coob ntawm lawv tsom mus rau Digital-type thiab nws yooj yim dua rau lawv ua rau cov suab paj nruag.
  2. Kuv muaj qee qhov Analog-type strips nyob ib puag ncig.

Kauj ruam 2: Amplifying Audio Signal

Amplifying Audio Signal
Amplifying Audio Signal
Amplifying Audio Signal
Amplifying Audio Signal
Amplifying Audio Signal
Amplifying Audio Signal

Lub teeb liab uas tau xa tawm los ntawm lub suab nkaus yog

ib qho teeb liab analog uas oscillates tsis pub dhau +200mV thiab -200mV. Tam sim no qhov no yog teeb meem yog peb xav ntsuas lub teeb liab nrog ib qho ntawm Arduino cov khoom siv sib piv vim tias Arduino cov lus sib piv tuaj yeem tsuas ntsuas qhov ntsuas hluav taws xob ntawm 0 thiab 5V. Yog tias peb tau sim ntsuas qhov tsis zoo ntawm lub suab tawm suab los ntawm, Arduino yuav nyeem tsuas yog 0V thiab peb yuav xaus rau hauv qab ntawm lub teeb liab.

Txhawm rau daws nws peb yuav tsum ua kom nrov nrov thiab txiav tawm lub suab cim kom lawv poob hauv qhov ntau ntawm 0-5V. Qhov zoo tshaj, lub teeb liab yuav tsum muaj qhov dav ntawm 2.5V uas nyob ib puag ncig 2.5V kom nws qhov hluav taws xob tsawg yog 0V thiab nws qhov hluav taws xob siab yog 5V.

Kev nthuav dav

Tus amplifier yog thawj kauj ruam hauv Circuit Court, nws ua rau kom muaj suab nrov ntau ntxiv los ntawm ib puag ncig + lossis - 200mV rau + lossis - 2.5V (qhov zoo tshaj). Lwm txoj haujlwm ntawm lub tshuab hluav taws xob yog tiv thaiv lub suab los (qhov tsim tawm lub suab teeb liab hauv thawj qhov chaw) los ntawm qhov seem hauv Circuit Court. Lub teeb liab uas tau nthuav tawm yuav muab tag nrho nws qhov tam sim no los ntawm lub tshuab hluav taws xob, yog li ib qho kev thauj khoom tso rau nws tom qab hauv Circuit Court yuav tsis "hnov" los ntawm lub suab (lub xov tooj/iPod/laptop hauv kuv qhov teeb meem). Ua qhov no los ntawm teeb tsa ib qho ntawm op-amps hauv TL072 lossis TL082 (daim duab 2) pob hauv qhov teeb tsa uas tsis hloov pauv.

Cov ntaub ntawv ntawm TL072 lossis TL082 hais tias nws yuav tsum tau siv nrog +15 thiab -15V, tab sis txij li lub teeb liab yuav tsis tau txais kev txhawb siab saum toj no + lossis -2.5V nws zoo los khiav op -amp nrog qee yam qis dua. Kuv siv ob lub roj teeb cuaj -volt txuas hauv kab los tsim + lossis - 9V fais fab mov.

Hlau koj li +V (tus pin 8) thiab –V (tus pin 4) rau op-amp. Xaim lub teeb liab los ntawm mono jack mus rau qhov tsis hloov pauv (tus pin 3) thiab txuas tus pin hauv av ntawm lub jack rau 0V siv ntawm koj qhov hluav taws xob (rau kuv qhov no yog kev sib txuas ntawm ob lub roj teeb 9V hauv kab). Hlau 100kOhm resistor nruab nrab ntawm cov zis (tus pin 1) thiab inverting input (tus pin 2) ntawm op-amp. Hauv Circuit no, Kuv siv 10kOhm potentiometer wired ua qhov sib txawv resistor txhawm rau kho qhov nce (tus nqi uas lub tshuab ua kom nrov nrov) ntawm kuv lub suab tsis hloov pauv. Hlau no 10K linear taper lauj kaub nruab nrab ntawm cov inverting input thiab 0V siv.

DC Offset

DC offset Circuit muaj ob lub hauv paus tseem ceeb: qhov faib hluav taws xob thiab lub capacitor. Qhov faib hluav taws xob tau tsim los ntawm ob lub 100k resistors wired hauv series los ntawm Arduino's 5V muab rau hauv av. Txij li cov resistors muaj qhov ua haujlwm zoo ib yam, qhov hluav taws xob ntawm kev sib tshuam ntawm lawv sib npaug 2.5V. Qhov kev sib txuas 2.5V no tau khi rau qhov tso tawm ntawm lub tshuab hluav taws xob ntawm 10uF capacitor. Raws li qhov hluav taws xob ntawm lub tshuab hluav taws xob sab ntawm lub tshuab hluav taws xob nce thiab ntog, nws ua rau them nqi ib ntus thiab tawm ntawm sab ntawm lub tshuab hluav taws xob txuas rau 2.5V kev sib txuas. Qhov no ua rau qhov hluav taws xob ntawm 2.5V kev sib tshuam kom oscillate nce thiab nqis, nyob ib puag ncig 2.5V.

Raws li qhia hauv kab lus, txuas qhov tsis zoo ntawm 10uF capacitor rau qhov tso tawm los ntawm lub tshuab raj. Txuas lwm sab ntawm lub hau mus rau qhov sib tshuam nruab nrab ntawm ob 100k resistors wired hauv kab nruab nrab ntawm 5V thiab hauv av. Tsis tas li, ntxiv 47nF capacitor los ntawm 2.5V rau hauv av.

Kauj Ruam 3: Decomposing Qhov Teeb Meem Rau Hauv Qhov Sib Txawv Ntawm Qhov Nruab Nrab Sinusoids - Theory

Decomposing lub teeb liab mus rau hauv qhov sib npaug ntawm nyob ruaj ruaj Sinusoids - Theory
Decomposing lub teeb liab mus rau hauv qhov sib npaug ntawm nyob ruaj ruaj Sinusoids - Theory

Lub suab teeb liab xa tawm los ntawm ib qho 3.5mm nkaus yog nyob hauv

ntau ntawm 20 Hz txog 20 kHz. Nws yog piv txwv ntawm 44.1 kHz thiab txhua tus qauv tau teev tseg ntawm 16 khoom.

Txhawm rau txhawm rau txhim kho cov hauv paus ntsiab lus nquag uas ua rau lub teeb liab, peb siv Fourier Hloov mus rau lub teeb liab, uas ua rau lub teeb liab tawg mus rau hauv qhov sib npaug ntawm qhov chaw nyob ruaj khov. Hauv lwm lo lus, Fourier kev tshuaj xyuas hloov pauv lub teeb liab los ntawm nws thawj qhov chaw (feem ntau lub sijhawm lossis thaj chaw) mus rau tus sawv cev hauv tus lej zaus thiab hloov pauv. Tab sis xam nws ncaj qha los ntawm lub ntsiab lus feem ntau qeeb dhau los ua qhov muaj txiaj ntsig.

Cov duab qhia pom tias lub teeb liab zoo li cas nyob rau lub sijhawm thiab zaus.

Nov yog qhov twg Fast Fourier Transform (FFT) algorithm yog qhov muaj txiaj ntsig zoo!

Los ntawm Kev Txhais Lus, Ib qho FFT nrawm suav cov kev hloov pauv no los ntawm kev txheeb xyuas DFT matrix rau hauv cov khoom lag luam ntawm qhov tsis sib xws (feem ntau yog xoom). Raws li qhov tshwm sim, nws tswj kom txo qhov nyuaj ntawm kev suav DFT los ntawm O (N2), uas tshwm sim yog tias ib qho yooj yim siv lub ntsiab lus ntawm DFT, rau O (N log N), qhov twg N yog cov ntaub ntawv loj. Qhov sib txawv ntawm qhov nrawm tuaj yeem loj heev, tshwj xeeb tshaj yog rau cov ntaub ntawv ntev teev uas N yuav nyob hauv ntau txhiab lossis ntau lab. Thaum muaj qhov ua yuam kev puag ncig, ntau qhov FFT cov txheej txheem muaj qhov tseeb ntau dua li ntsuas DFT cov lus txhais ncaj qha lossis tsis ncaj qha.

Hauv cov lus yooj yooj yim, nws tsuas yog txhais tau tias FFT algorithm yog txoj hauv kev nrawm dua los laij Fourier Transform ntawm txhua lub teeb liab. Qhov no feem ntau yog siv ntawm cov khoom siv nrog lub zog suav tsawg.

Pom zoo: