Cov txheej txheem:

LED koj tuaj yeem tshuab tawm zoo li lub tswm ciab!: 5 Kauj Ruam (nrog Duab)
LED koj tuaj yeem tshuab tawm zoo li lub tswm ciab!: 5 Kauj Ruam (nrog Duab)

Video: LED koj tuaj yeem tshuab tawm zoo li lub tswm ciab!: 5 Kauj Ruam (nrog Duab)

Video: LED koj tuaj yeem tshuab tawm zoo li lub tswm ciab!: 5 Kauj Ruam (nrog Duab)
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
Image
Image

LEDs tau tsim los tso tawm lub teeb, tab sis lawv kuj ua rau muaj peev xwm xav tsis thoob. Siv tsuas yog Arduino UNO, ib qho LED thiab tus tiv thaiv, peb yuav tsim lub ntsuas kub kub anemometer uas ntsuas cua nrawm, thiab tua LED rau 2 vib nas this thaum nws pom tias koj tshuab rau nws. Koj tuaj yeem siv qhov no los ua kom muaj kev cuam tshuam tswj kev ua pa, lossis txawm tias taws tswm ciab uas koj tuaj yeem tshuab tau!

Cov ntaub ntawv:

Ib qho Arduino UNO (nrog USB cable txuas rau koj lub khoos phis tawj)

1/4W 220 ohm resistor (https://www.amazon.com/Projects-25EP514220R-220-Re…)

Ib qho txuas ua ntej, 0402 daj LED (https://www.amazon.com/Lighthouse-LEDs-Angle-Pre-W…)

Breakaway header (https://www.amazon.com/SamIdea-15-Pack-Straight-Co…)

Koj tseem yuav xav tau:

Lub khoos phis tawj kom khiav Arduino ib puag ncig

Cov cuab yeej siv yooj yim/cov txuj ci

Kauj Ruam 1: Qhov No Ua Haujlwm Li Cas?

Tau txais cov LED thiab Cov Kws Tiv Thaiv Npaj Los Txuas rau Koj Arduino UNO
Tau txais cov LED thiab Cov Kws Tiv Thaiv Npaj Los Txuas rau Koj Arduino UNO

Thaum koj khiav tam sim no los ntawm LED, nws qhov kub nce. Tus nqi nce yog nyob ntawm seb koj tau txias nws zoo npaum li cas. Thaum koj tshuab ntawm LED kub, qhov txias ntxiv ua rau lub ntsuas kub khiav qis. Peb tuaj yeem tshawb pom qhov no vim tias qhov poob qis rau pem hauv ntej ntawm LED nce ntxiv thaum nws txias dua.

Lub Circuit Court yog qhov yooj yim heev thiab zoo li tsav tsheb LED. Qhov sib txawv tsuas yog tias peb yuav ntxiv cov xaim hluav taws xob ntxiv los ntsuas qhov poob qis ntawm LED thaum nws nyob. Txhawm rau ua haujlwm tau zoo, koj xav siv lub me me LED (Kuv qhia kom siv 0402 nto mount LED) txuas nrog los ntawm qhov ua tau yooj yim tshaj plaws. Qhov no yuav tso cai rau LED kom sov thiab txias sai heev, thiab txo qis cua sov poob los ntawm cov xov hlau. Qhov hloov pauv qhov peb tab tom nrhiav tsuas yog millivolts - ntawm qhov kawg ntawm qhov uas tuaj yeem ntseeg tau pom tau los ntawm UNOs analog pins. Yog tias LED tau so ntawm qee yam uas ua kom sov tawm, nws yuav tsis tuaj yeem kub txaus, yog li nws ua haujlwm zoo tshaj yog tias nws nyob saum huab cua.

Kauj Ruam 2: Tau txais lub LED thiab tus tiv thaiv npaj kom txuas rau koj Arduino UNO

Tau txais cov LED thiab Cov Kws Tiv Thaiv Npaj Los Txuas rau Koj Arduino UNO
Tau txais cov LED thiab Cov Kws Tiv Thaiv Npaj Los Txuas rau Koj Arduino UNO
Tau txais cov LED thiab Cov Kws Tiv Thaiv Npaj Los Txuas rau Koj Arduino UNO
Tau txais cov LED thiab Cov Kws Tiv Thaiv Npaj Los Txuas rau Koj Arduino UNO

Soldering cov xov hlau nyias nyias mus rau qhov me me saum toj kawg nkaus LEDs siv qhov kev txawj ntse ncaj ncees. Hmoov zoo, koj tuaj yeem yooj yim yuav cov xov tooj ua ntej, 0402 LEDs. Cov no feem ntau tuaj nrog tus tiv thaiv (npog hauv tshav kub ntsws hauv daim duab) uas yog qhov loj me rau 12V kev ua haujlwm. Yog tias qhov koj tau txais, koj yuav tsum txiav tawm tus tiv thaiv. Yog tias koj txiav los ntawm cov cua sov ntsws tubing nyob ib sab ntawm tus tiv thaiv tiv thaiv, koj yuav zaum muaj peev xwm rub tawm cov tubing uas seem tawm hauv qee qhov nthuav tawm cov hlau lead rau soldering. Yog tias koj tsuas yog txiav cov xaim, koj yuav tsum tau hle qhov rwb thaiv tsev me me kom koj thiaj li tuaj yeem xauv tau, thiab muab cov tuab tuab ntawm cov xaim, qhov no tuaj yeem ua rau tsis yooj yim.

Cov xov hlau yog tawv heev dhau los ua kom muaj kev sib txuas zoo hauv Arduino lub taub hau, yog li peb yuav tsum tau muab lawv tso rau qee yam uas hnyav dua. Kuv siv tus pin los ntawm lub taub hau sib cais los ua cov kev sib txuas, tab sis koj tuaj yeem siv tsuas yog hais txog ib qho seem ntawm qhov tsim nyog ntsuas cua xaim. Sab nraub qaum (cathode) xaim los ntawm LED tau muab muag rau ib tus pin nkaus xwb. Cov hlau liab (anode) yuav tsum tau muab txuas rau qhov khoov duav raws li qhia. Txiav cov hlau lead ntawm tus tiv thaiv kom sib npaug ntev thiab muab lawv txuas rau ob lub taub hau uas nyob ib sab raws li qhia hauv daim duab.

Kauj Ruam 3: Kev Sib Txuas

Kev sib txuas
Kev sib txuas
Kev sib txuas
Kev sib txuas

Txuas lub LED/resistor raws li qhia hauv daim duab. Sab ntawm tus tiv thaiv txuas nrog lub liab LED xaim mus rau A0. Qhov no yuav yog qhov uas peb ntsuas qhov ntsuas hluav taws xob ntawm LED siv lub peev xwm analog nkag. Lwm sab ntawm tus tiv thaiv mus rau A1, uas peb yuav siv los ua cov khoom siv digital, teeb tsa nws siab kom qhib lub LED. Cov xaim dub yuav tsum txuas nrog GND. Ib qho ntawm Arduino GND pins tuaj yeem siv tau.

Kauj ruam 4: Code

Rub tawm cov cai thiab qhib nws hauv Arduino IDE. Tom qab ntawv koj tuaj yeem xa nws mus rau koj Arduino.

Qhov kev zov me nyuam xub teeb tus pin qhia thiab teeb lub LED. Tom qab ntawd nws ntsuas qhov ntsuas hluav taws xob poob qis ntawm LED ntawm ib qho analogRead ntawm tus pin A0. Txhawm rau txhim kho qhov raug ntawm qhov ntsuas, peb nyeem qhov hluav taws xob 256 zaug hauv kev ua tiav nrawm, thiab suav qhov tshwm sim. (Kev txheeb xyuas qhov zoo li no tuaj yeem ua kom muaj txiaj ntsig zoo ntawm kev hloov dua siab tshiab kom peb tuaj yeem pom cov kev hloov pauv uas me dua li cov kauj ruam me tshaj ntawm tus hloov pauv.) khaws cia hauv qhov tsis pom los yog qhov txias tsis ntev los no tau nce LED qhov hluav taws xob tsawg kawg MINJUMP. Yog tias nws tsis tau, peb khaws tag nrho hauv qhov tsis, hloov kho tus cim tsis, thiab pib ntsuas tom ntej. Yog tias nws muaj, peb tua lub LED rau 2 vib nas this, rov pib dua thiab tom qab ntawd pib txheej txheem dua.

Kom nkag siab zoo tias muaj dab tsi tshwm sim, peb sau txhua qhov suav tawm ua cov ntaub ntawv xov xwm, thiab siv Arduino IDE's Serial Plotter (hauv qab Cov cuab yeej ntawv qhia zaub mov) txhawm rau teeb LED qhov hluav taws xob raws li nws hloov pauv lub sijhawm. Nco ntsoov teeb tsa tus nqi baud rau 250000 kom phim qhov program. Tom qab ntawd koj tuaj yeem pom tias qhov hluav taws xob poob li cas thaum LED sov sov tom qab qhib. Qhov no tseem yuav qhia pom qhov ua tau zoo li cas hauv lub system. Tom qab LED raug tawm, nws yuav ua kom txias me ntsis los ntawm lub sijhawm nws tig rov qab, uas koj yuav pom zoo li dhia ntawm daim duab.

Kauj ruam 5: Txaus siab rau

Txaus siab rau!
Txaus siab rau!

Thaum txoj cai tau ua haujlwm, koj yuav tsum tuaj yeem tshuab koj lub LED nrog cua nrawm. Kuv tau pom tias kuv tuaj yeem tshuab kuv lub LED los ntawm ntau dua 1 meter deb! Hauv qee chav, huab cua tuaj yeem ua rau muaj qhov tsis raug. Yog tias qhov no yog teeb meem, koj tuaj yeem txo qhov kev nkag siab ntawm koj lub cev los ntawm kev nce MINJUMP. Cov Plotter Serial tuaj yeem pab koj pom qhov muaj txiaj ntsig zoo li cas rau koj daim ntawv thov.

Koj tuaj yeem hloov lub LED nrog ib qho ntawm cov xim sib txawv. Cov LEDs dawb ua haujlwm zoo tshwj xeeb. Vim tias lawv muaj qhov poob qis dua, koj yuav tsum hloov tus nqi tiv thaiv kom tau txais txoj cai tam sim no. Muab lub peev xwm tsav ntawm UNO, tua rau tam sim no hauv 10-15mA ntau. Rau cov LED dawb, 100 ohms yog qhov pib zoo.

Vim tias UNO muaj 6 tus lej nkag sib piv, koj tuaj yeem hloov kho tus lej no yooj yim los txhawb 6 ywj siab, kub LED anemometers! Qhov no ua rau nws muaj peev xwm tsim cov kev cuam tshuam yooj yim uas tuaj yeem lees paub thaum koj tshuab rau hauv cov lus qhia sib txawv. Qhov no tuaj yeem muaj txiaj ntsig zoo kawg thaum tsim kev cuam tshuam rau cov neeg xiam oob khab, hais qhia kev tswj hwm rau cov kws ntaus nkauj, lossis txawm tias yog khoom qab zib hnub yug nrog ntau lub tswm ciab hluav taws xob!

Thaum kawg, yog tias koj tau siv cov txheej txheem no los ua qee yam txias, thov tawm lus hauv qab no!

Pom zoo: