Cov txheej txheem:

Arduino Light Theremin hauv Koj Lub Tsev: 8 Kauj Ruam
Arduino Light Theremin hauv Koj Lub Tsev: 8 Kauj Ruam

Video: Arduino Light Theremin hauv Koj Lub Tsev: 8 Kauj Ruam

Video: Arduino Light Theremin hauv Koj Lub Tsev: 8 Kauj Ruam
Video: 06 Starter Kit: Light Theremin 2024, Kaum ib hlis
Anonim
Arduino Lub Teeb Tseem Ceeb hauv Koj Lub Tsev
Arduino Lub Teeb Tseem Ceeb hauv Koj Lub Tsev

Txhim Kho Arduino Lub Teeb Tseem Ceeb los ntawm

Ib qho me me yog cov cuab yeej siv suab paj nruag hluav taws xob uas tuaj yeem paub txog txoj haujlwm ntawm tus neeg ua yeeb yam txhais tes thiab tsim cov suab paj nruas suab txhua yam yam tsis muaj tus neeg ua yeeb yam puas tau kov lub cuab yeej. Rau peb lub teeb nyob rau ntawd, peb yuav hloov kho lub tswv yim no thiab tsim ib qho chaw nyob uas tswj cov xim tsis txhob siv suab paj nruag.

Arduino

Khoos phis tawj

LED cov

Photoresistor

Resistors

Lub thawv

Kauj Ruam 1: Npaj Kom Teeb Dua

Cia peb pib los ntawm kev rub 7 LED tawm ntawm peb cov khoom siv. Koj tuaj yeem ntxiv ntxiv yog tias koj xav tau, tsuas yog ua kom ntseeg tau tias koj ntxiv tus tiv thaiv ntxiv thiab xaim rau qhib tus lej Arduino. Nco ntsoov tias Arduino tsis tuaj yeem muab lub zog ntau, yog li ntawm qee qhov taw tes, ntxiv ntau LED qhov tsuas yog ua rau lawv tag nrho dimmer.

Hauv av Hlau/ Ntxiv LEDs

Pib los ntawm kev ntxiv xaim ntawm av (tsis zoo "-") kev tsheb nqaj hlau ntawm lub khob cij thiab GND tus pin ntawm Arduino. Qhov no ua kom ntseeg tau tias txhua lub Cheebtsam ntawm Arduino thiab daim ntawv qhia zaub mov tam sim no sib koom ua ke thiab tuaj yeem ua tiav Circuit Court. Tom ntej no, ntsaws cov ceg luv (hauv av) ntawm LED rau hauv av (tsis zoo) kev tsheb nqaj hlau ntawm lub khob cij

Ntxiv Cov Hluav Taws Xob & Cov Hluav Taws Xob

Koj yuav xav tau 7 tus tiv thaiv, Kuv tau xaiv siv 82 Ohm (grey, liab, dub), vim tias LED's yuav ci txaus kom pom tab sis tsis kos rau ntau lub zog los ntawm Arduino.

Kauj Ruam 2: Photoresistor Circuit

Txhawm rau ua kom cov photoresistor Circuit peb rov mus tsim qhov faib hluav taws xob. Lob koj lub photoresistor thiab 82 Ohm resistor (grey, liab, dub). Muab ib txhais ceg ntawm tus kws yees duab tso rau hauv txoj kev tsheb nqaj hlau hauv av thiab ntawm ob txhais ceg hauv ib kab ntawm daim txiag ntoo.

Tom ntej no, ntxiv cov xaim los ntawm 5V tso tawm ntawm Arduino mus rau kab sib txawv ntawm koj lub khob cij thiab muaj 10K Ohm resistor txuas 5V fais fab kab thiab kab duab kab.

Thaum kawg, tam sim no peb tau ua qhov sib faib hluav taws xob peb xav tau txais lub teeb liab los ntawm kev faib mus rau Arduino, yog li siv lwm txoj hlua thiab ntsaws ib qho kawg rau hauv photoresistor thiab 10K resistor kab thiab lwm qhov kawg rau hauv A0 (analog pin 0) ntawm cov Arduino.

Kauj Ruam 3: Coding Tshooj 1

Coding Tshooj 1
Coding Tshooj 1
Coding Tshooj 1
Coding Tshooj 1

Kuv tus lej nyob ntawm no!

Txhawm rau ua kom pom lub teeb nyob ntawm no peb tab tom nthuav dav rau cov lus qhia ua piv txwv yav dhau los, thiab coj nws mus ib kauj ruam ntxiv los ntawm kev muaj ib lub cim ua rau ntau yam LED ua. Ua ntej, rub daim ntawv txuas nrog LED.ino thiab qhib nws hauv Arduino IDE. Txhawm rau pib peb yuav tsum tau pib ua ntej txhua 7 LEDs. Kuv khaws cov npe kev pom zoo haum tus qauv ntawm no, tab sis koj tuaj yeem sau npe LED raws li txhua lub rooj sib tham uas koj nyiam.

Tam sim no txhua tus LED muaj npe peb yuav tsum teeb tsa peb cov tswv yim thiab cov txiaj ntsig

Nco ntsoov tias peb tseem tab tom txuas qhov chaw nres nkoj txuas kom peb tuaj yeem ntsuas cov cuab yeej tom qab. Tus nqi 9600 yog qhov nrawm uas lub khoos phis tawj thiab Arduino tham sib tham. Qhov no hu ua Baud Rate, thiab koj tuaj yeem nyeem ntxiv txog nws hauv ntu kev pabcuam ntxiv.

Kauj Ruam 4: Coding Tshooj 2

Coding Tshooj 2
Coding Tshooj 2

Tsim tawm peb cov lej cim sib piv, peb tab tom yuav siv tib lub LED ua haujlwm tab sis peb yuav tsum nthuav tawm nws me ntsis kom tuaj yeem ua raws li qhov loj ntawm LEDs. Txhawm rau ua qhov no peb xav kom nce tus lej tsis ua haujlwm thiab xyuas kom tseeb tias peb ua rau tus pin ntxiv.

Hauv qhov xwm txheej LED Xeev no, peb muaj qhov ntsuas w1, w2, w3, w4, w5, w5, w6, thiab w7. Teeb cov no rau HIGH lossis LOW hauv lub voj tseem ceeb nrog qhib lossis tua cov LED no.

Kauj Ruam 5: Coding Tshooj 3

Coding Tshooj 3
Coding Tshooj 3

Cia peb mus rau cov nqaij tiag ntawm cov cai no thiab dhia mus rau hauv lub voj loj. Peb paub peb xav tau LED sib txawv kom pom kev raws li qhov deb koj txhais tes yog los ntawm lub ntsuas. Qhov no txhais tau tias ntau LEDs yuav tsum ci thaum lub teeb tsawg dua los tsoo lub sensor (raws li koj txhais tes npog nws). Raws li peb tau pom hauv cov kev kawm dhau los ADC tus nqi ntawm photoresistor Circuit nce nrog kev txo qis hauv lub teeb, yog li peb xav teeb tsa peb cov cai hauv txoj kev teeb pom kev ntau dua LEDs raws li ADC tus nqi nce.

Huag, uas yog lub hlwb khoov! Cia peb saib cov cai kom pab peb nkag siab tias peb xav tau dab tsi

Ahhhh, tam sim no qhov no ua rau nkag siab ntau dua. Peb ib txwm tshuaj xyuas tus nqi ntawm tus yees duab thiab tom qab ntawd teeb pom ntau dua thiab ntau dua LED qhov siab dua tus nqi ntawd. Raws li koj yuav pom hauv cov vis dis aus ntawm cov kauj ruam tom ntej, cov txiaj ntsig tsis raug no ua haujlwm zoo rau kuv nrog lub teeb nyob ib puag ncig hauv chav, tab sis koj yuav tsum tau ua si ib puag ncig nrog cov txiaj ntsig no me ntsis kom lawv ua raws li qhov deb ntawm koj txhais tes raws li koj xav tau.

Kauj Ruam 6: Kuaj Pawg Ntsuas Mov

Cia peb upload cov cai rau Arduino thiab ua si nrog peb qhov tshiab Minmin.

Kauj Ruam 7: Ua Rau Qhov Kaw Qhov Rooj/Qhov Chaw Txuas Hluav Taws Xob

Lub cev tseem ceeb ntawm cov ntawv yog lub thawv ntawv. Tom qab ntawd kuv tau txiav tawm 7 qhov hlais, sib nrug nws, nrog rab riam thiab txiab. Tom qab ntawd kuv sim haum cov LED.

Txuas koj lub xov tooj cua qub nrog lwm tus kom ntev txaus los ntsaws rau hauv lub qhov uas koj nyuam qhuav ua.

Kauj Ruam 8: Teeb Pom Kev

Tam sim no nws yog txhua yam txuas mus sim peb qhov teeb pom kev tshiab tam sim no:)

Pom zoo: