Cov txheej txheem:

Lub Hnub Tuaj thiab Teeb Teeb Nrog LEDs: 7 Cov Kauj Ruam (nrog Duab)
Lub Hnub Tuaj thiab Teeb Teeb Nrog LEDs: 7 Cov Kauj Ruam (nrog Duab)

Video: Lub Hnub Tuaj thiab Teeb Teeb Nrog LEDs: 7 Cov Kauj Ruam (nrog Duab)

Video: Lub Hnub Tuaj thiab Teeb Teeb Nrog LEDs: 7 Cov Kauj Ruam (nrog Duab)
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
Lub Hnub Qub thiab Hnub Teeb Teeb Nrog LEDs
Lub Hnub Qub thiab Hnub Teeb Teeb Nrog LEDs

Koj paub nws, thaum lub caij ntuj no nws nyuaj rau sawv, vim tias nws tsaus ntuj sab nraum thiab koj lub cev tsuas tsis sawv thaum ib tag hmo. Yog li koj tuaj yeem yuav lub tswb-moos uas ua rau koj tsaug zog. Cov cuab yeej no tsis kim li ob peb xyoos dhau los, tab sis feem ntau ntawm lawv zoo li tsis zoo. Ntawm qhov tod tes, feem ntau nws tseem tsaus ntuj thaum koj los tsev los ntawm kev ua haujlwm. Yog li hnub poob zoo kawg thiab. Lub caij ntuj no zoo li tu siab, tsis yog? Tab sis tsis yog rau cov nyeem cov lus qhia no. Nws piav qhia koj yuav tsim lub hnub tuaj thiab hnub poob-teeb los ntawm picaxe microcontroller, qee qhov LEDs thiab ob peb lwm qhov. Cov LEDs yuav raug nqi koj 5-10 Euros nyob ntawm qhov zoo thiab lwm qhov yuav tsum tsis txhob ua ntau dua 20 Euros. Yog li nrog tsawg dua 30 Euros koj tuaj yeem tsim qee yam muaj txiaj ntsig thiab zoo heev. Thiab cov lus qhia no yuav tsis tsuas yog piav qhia koj yuav rov txhim kho qhov no li cas, tab sis kuj qhia koj yuav hloov kho nws li cas rau koj tus kheej nyiam.

Kauj Ruam 1: Yam Peb Xav Tau

Yam Peb Xav Tau
Yam Peb Xav Tau
Yam Peb Xav Tau
Yam Peb Xav Tau
Yam Peb Xav Tau
Yam Peb Xav Tau
Yam Peb Xav Tau
Yam Peb Xav Tau

Koj xav tau cov khoom no: o12V lossis 24V fais fab mov o1 Picaxe 18M (lossis lwm yam microcontroller) los ntawm https://www.rev-ed.co.uk/picaxe/ oA lub qhov rau 3.5mm xov tooj-jack, lossis lwm yam kev sib txuas los ntawm cov chaw nres nkoj txuas mus rau lub microcontroller los teeb tsa lub picaxe o1 lub pob nyem thiab 1 lub toggle-hloov, lossis 2 lub pob tawb o1 IC7805 nrog lub capacitors, qhov no hloov peb 12V lossis 24V rau 5V peb xav tau los tswj lub microcontroller o1 IC ULN2803A, Qhov no yog Darlington Transistor Array rau kev siv ncaj qha ntawm TTL-Qib cov txiaj ntsig. Lwm txoj hauv kev siv 8 tib Darlington-Transistors nrog cov tiv thaiv uas tsim nyog tab sis nws tseem ua haujlwm nrog tus qauv BC547-transistors. o1 High-FET FET zoo li IRF520, lossis qee qhov Power-Darlington-transistor zoo li BD649 oA tag nrho pawg ntawm LEDs, xim sib txawv xws li liab, daj, dawb, sov dawb, xiav thiab ultraviolet. Nyeem qib 4 kom paub ntxiv. o1 10k & -potentiometer, zoo dua nrog lub pob qhov ntev o1 300 &-potentiometer rau kev ntsuas lub hom phiaj oSome resistors, qee cov cables, pawg thawj coj los tsim lub Circuit Court thiab ntawm chav kawm soldering-hlau oA ntsuas cov cuab yeej rau tam sim no kuj tseem yuav siv tau, tab sis tsis yog kiag li tsim nyog Nyob ntawm lub hwj chim-qhov chaw koj siv koj yuav xav tau cov txuas txuas ntxiv thiab lub tsev nyob rau LEDs. Kuv siv daim ntawv acrylic uas kuv kho rau lub tsev ntawm Power -supply Hauv cov khoos phis tawj qub-tsev nrog D-Sub-txuas koj yuav pom qhov hloov pauv tau zoo rau lub xov tooj-kab txuas siv rau program picaxe. Picaxes thiab ntau lwm yam khoom muaj txiaj ntsig tuaj yeem yuav ntawm no: https://www.rev-ed.co.uk/picaxe/ Rau qhov tas li tsuas yog txheeb xyuas koj tus neeg muag khoom hauv zos.

Kauj ruam 2: Circuit-layout

Circuit-layout kev
Circuit-layout kev
Circuit-layout kev
Circuit-layout kev
Circuit-layout kev
Circuit-layout kev

ULN2803A yog darlington-array, suav nrog 8 tus neeg darlington-tsav tsheb nrog cov neeg tawm tsam tsim nyog ntawm sab-sab sab kom koj tuaj yeem txuas ncaj qha tso tawm los ntawm microcontroller mus rau cov tswv yim ntawm UNL2803A. Yog tias cov tswv yim tau txais qib siab (5V) los ntawm microcontroller, tom qab ntawd cov zis yuav txuas nrog GND. Qhov no txhais tau tias qhov siab ntawm cov tswv yim yuav ua kom pom qhov sib txawv LED-sawb. Txhua txoj hauv kev yuav siv nrog tam sim no txog 500mA. Standard ultrabright 5mm LEDs ib txwm siv 25-30mA ib kab thiab txawm tias yim ntawm lawv yuav ua rau FET tsuas yog 200-250mA, yog li koj nyob deb ntawm cov ntsiab lus tseem ceeb. Tej zaum koj yuav xav txog kev siv lub zog loj 5W LEDs rau lub teeb ci. Lawv feem ntau siv 350mA ntawm 12V thiab kuj tseem tuaj yeem tsav los ntawm cov kab no. Lub khawm "S1" yog lub pob pib dua rau lub microcontroller. Qhov hloov "S2" yog tus xaiv hnub poob lossis kaj ntug. Koj kuj tseem tuaj yeem hloov nws los ntawm lub laub khawm thiab qhib hnub poob los ntawm kev cuam tshuam hauv software. Peb siv picaxes ADC lub peev xwm los nyeem tawm txoj haujlwm ntawm lub hwj chim thiab siv tus nqi no raws li lub sijhawm teev tseg. Daim duab qhia thawj pawg thawj coj uas kuv tau tsim nrog 7 tus neeg sib txuas (BC547C) thiab cov tiv thaiv kom tsav lawv. Kuv tsis muaj ULN2803 thaum lub sijhawm kuv tsim lub Circuit Court, thiab tam sim no kuv tsis muaj qee qhov ntxiv. Yog li kuv txiav txim siab los qhia koj cov qauv qub, tab sis kuj tseem muab cov txheej txheem nrog tus tsav tsheb tshiab-teeb tsa.

Kauj Ruam 3: Sunset Saib Zoo Li Cas?

Sunset Saib Zoo Li Cas?
Sunset Saib Zoo Li Cas?

Thaum koj saib hnub poob tiag tiag koj yuav pom tias xim ntawm lub teeb tau hloov pauv zuj zus. Los ntawm lub ntsej muag dawb thaum lub hnub tseem nyob saum lub qab ntuj nws hloov mus rau lub teeb daj tom qab ntawd mus rau lub txiv kab ntxwv nruab nrab tom qab ntawd mus rau xim liab tsaus thiab tom qab ntawd lub qia dawb dawb ci, tom qab ntawd tsaus ntuj. Lub hnub poob yuav yog qhov nyuaj tshaj plaws ntawm lub cuab yeej vim tias koj saib nws nrog kev nco qab tag nrho thiab qhov ua yuam kev me me yog qhov txaus ntshai heev. Hnub tuaj yog qhov tseem ceeb tib txoj haujlwm tau thim rov qab tab sis zoo li koj tseem tsaug zog thaum hnub tuaj pib, peb tsis tas yuav txhawj ntau txog xim. Thiab pib koj hnub poob thaum tso, koj yuav tsis xav pib nrog lub hnub ci ci tab sis thaum sawv ntxov nws yog qhov tseem ceeb kom tau txais qhov zoo tshaj plaws ntawm LEDs. Yog li nws yooj yim kom muaj ntu sib txawv rau hnub tuaj thiab hnub poob, tab sis koj muaj kev sim dawb txhua yam uas koj nyiam tau kawg!

Kauj Ruam 4: Xaiv cov LEDs thiab xam cov Resistors

Xaiv cov LEDs thiab Xam cov Resistors
Xaiv cov LEDs thiab Xam cov Resistors
Xaiv cov LEDs thiab Xam cov Resistors
Xaiv cov LEDs thiab Xam cov Resistors

Xaiv cov LEDs yog qhov muaj tswv yim ntawm cov lus qhia no. Yog li cov ntawv hauv qab no tsuas yog cov lus qhia los ntawm kuv rau koj. Xav tias sib txawv thiab hloov pauv lawv, Kuv yuav qhia koj yuav ua li cas. Colours: Nws yog qhov nyuaj rau hloov pauv ib lub sawb rau lossis tawm nrog LEDs ntawm cov xim tshiab tiav. Yog li kuv qhov kev pom zoo yog tias txhua kab ntawv muaj LEDs ntawm txhua xim tab sis hloov pauv ntau. Yog tias peb xav txog hnub poob thim rov qab thawj kab ntawv yuav muaj ntau cov liab LEDs thiab tej zaum ib qho dawb, xiav thiab UV ib qho. Yog li cia peb hais 5 tus liab, 2 daj, 1 sov dawb thiab 1 UV. Yog tias koj nyiam koj tuaj yeem hloov ib qho ntawm cov liab lossis daj LEDs los ntawm ib lub txiv kab ntxwv (Sawb 2 hauv qhov txheej txheem) Cov kab ci ci tom ntej yuav tom qab ntawd muaj ob peb lub xim liab hloov los ntawm daj. Cia peb hais 2 liab, 5 daj thiab 2 sov dawb (kab txaij 3 hauv cov qauv) Hauv kab ntawv tom ntej no ob peb xim liab yuav hloov los ntawm cov daj lossis txawm tias dawb. Wb hais 1 liab, 1 daj, 4 sov dawb thiab 1 xiav. (strip 4 in schematic) Cov kab txaij tom ntej yuav suav nrog 3 txias dawb, 2 sov dawb thiab 1 xiav LED. (strip 5) Qhov no yuav yog plaub kab rau hnub poob kom deb li deb. Txog Hnub Tuaj peb tuaj yeem siv qhov seem peb daim kab xev nrog feem ntau txias dawb thiab xiav LEDs. Yog tias koj txuas qhov 7 thiab 8 qhov kev tawm tswv yim ua ke koj tseem tuaj yeem siv 4 kab rau hnub tuaj, lossis muab hnub poob rau kab thib tsib, ib yam li koj nyiam. Tej zaum koj yuav tau pom tias cov kab txaij uas muaj LEDs liab muaj ntau LEDs rau ib kab ntau dua li cov dawb huv. Qhov no yog tshwm sim los ntawm qhov sib txawv ntawm qhov tsawg kawg nkaus rau qhov liab thiab dawb LEDs Raws li cov LEDs tau ci tiag tiag thiab txawm tias ua rau lawv poob qis mus rau 1% yog qhov ntau heev, Kuv tau suav kab 1 nrog 3 liab, 2 daj thiab sov dawb kom muaj tsuas yog 5mA ntawm tam sim no. Qhov no ua rau cov kab no tsis zoo li lwm qhov thiab yog li ntawd haum rau qhov kawg qhov pom ntawm hnub poob. Tab sis kuv yuav tsum tau muab daim kab xev no UV-LED ib yam, rau qhov muag kawg. Yuav ua li cas los laij cov LEDs thiab cov tiv thaiv: Cov LEDs xav tau qee qhov hluav taws xob kom ua haujlwm thiab txawm tias darlington-array siv 0.7V ib channel rau nws tus kheej lub hom phiaj, yog li los laij cov resistor yog yooj yim heev. Lub FET ua haujlwm tsis ua rau muaj qhov poob hluav taws xob rau peb lub hom phiaj. Cia peb hais tias peb ua haujlwm ntawm 24V los ntawm lub hwj chim. Los ntawm qhov hluav taws xob no peb rho tawm tag nrho cov npe hluav taws xob rau LEDs thiab 0.7V rau cov khoom. Dab tsi sab laug yuav tsum tau siv los ntawm tus tiv thaiv ntawm qhov tam sim no. Law saib ntawm qhov piv txwv: thawj kab: 5 liab, 2 daj, 1 sov dawb thiab 1 uv LED. One liab LED siv 2.1V, yog li tsib ntawm lawv coj 10.5 V. One daj LED tseem siv 2.1V, yog li ob ntawm lawv coj 4.2V. The dawb LED siv 3.6V, UV LED siv 3.3V thiab teeb 0.7V qhov no ua rau 24V -10.5V - 4.2V - 3.6V - 3.3V - 0.7V = 1.7V uas yuav tsum tau siv los ntawm qee tus tiv thaiv. Koj yeej paub Ohm txoj cai: R = U/I. Yog li tus tiv thaiv uas siv 1.7V ntawm 25mA muaj tus nqi 1.7V/0.025A = 68 Ohm uas muaj nyob ntawm cov khw muag khoom hluav taws xob. Txhawm rau suav lub zog siv los ntawm tus tiv thaiv tsuas yog xam P = U * I, qhov no txhais tau tias P = 1.7V * 0.025A = 0.0425 W. Yog li me me 0.25W resistor txaus rau lub hom phiaj no. Yog tias koj siv cov hluav taws xob siab dua lossis xav hlawv hluav taws xob ntau dua hauv cov resistor koj yuav tau siv qhov loj dua! Tias yog vim li cas koj tsuas tuaj yeem ua haujlwm 6 qhov hluav taws xob siab siv cov LED dawb ntawm 24V. Tab sis tsis yog txhua lub LEDs zoo ib yam, tej zaum yuav muaj qhov sib txawv loj hauv qhov hluav taws xob poob los ntawm LED rau LED. Yog li peb siv lub zog thib ob (300?) Thiab lub ntsuas ntsuas tam sim no los kho qhov tam sim no ntawm txhua txoj hlua mus rau qib uas xav tau (25mA) hauv qhov kawg Circuit Court. Tom qab ntawd peb ntsuas tus nqi ntawm tus tiv thaiv thiab qhov no yuav tsum muab qee yam rau peb ib puag ncig los suav tus nqi. Yog tias qhov tshwm sim yog qee yam ntawm ob hom ces xaiv tus nqi siab dua tom ntej yog tias koj xav kom cov kab txaij tsaus me ntsis lossis tus nqi qis dua tom ntej rau kab txaij kom ci dua. Kuv tau teeb tsa LEDs hauv daim iav iav acrylic uas kuv tsau rau lub zog-qhov-tsev. Cov iav acrylic tuaj yeem yooj yim txhawm rau khoov thiab khoov yog tias ua kom sov txog 100 ° C hauv qhov cub. Raws li koj tuaj yeem pom ntawm cov duab Kuv tseem ntxiv lub hnub tuaj - hnub poob xaiv hloov mus rau cov zaub no. Lub hwj chim thiab lub khawm rov pib dua yog nyob ntawm daim phiaj-Circuit Board.

Kauj Ruam 5: Kho Cov Software

Kho Software
Kho Software
Kho Software
Kho Software

Cov picaxes yog cov program yooj yim heev los ntawm qee cov lus yooj yim los ntawm tus muag khoom. Tus Editor thiab software tsis pub dawb. Tau kawg ib tus kuj tseem yuav ua qhov no hauv kev sib sau ua ke rau PICs dawb lossis rau Atmel AVRs, tab sis qhov no yog ib qho ntawm kuv thawj qhov haujlwm tom qab kuv sim cov picaxes. Lub sijhawm no kuv ua haujlwm zoo dua nrog ntau PWMs ntawm AVR. Cov picaxes tau zoo heev rau cov pib tshiab vim tias qhov xav tau rau cov khoom siv tau yooj yim heev thiab cov lus yooj yim kawm tau yooj yim. Nrog tsawg dua 30 € koj tuaj yeem pib tshawb txog lub ntiaj teb zoo ntawm microcontrollers. Qhov tsis zoo ntawm qhov pheej yig nti (18M) yog qhov txwv RAM. Yog tias koj xaiv lwm cov yam ntxwv lossis txuas rau picaxe sib txawv koj yuav tau hloov kho qhov program. Tab sis qhov tseeb koj yuav tsum tau hloov kho rau kev hloov pauv ntawm cov neeg ib leeg. Raws li koj tuaj yeem pom hauv daim ntawv teev npe sib txawv w6 (ib lo lus hloov pauv) ua raws li lub txee-sib txawv thiab raws li qhov ntsuas rau PWM. Nrog xaiv PWM-zaus ntawm 4kHz tus nqi rau 1% rau 99% lub sijhawm ua haujlwm yog 10 txog 990 feem. Nrog kev suav nyob hauv lub voj peb tau txais ze li ntawm qhov txo qis lossis nce ntawm LED-ci ci. Nov yog qhov zoo tshaj plaws thaum koj tswj LEDs nrog PWM. Thaum hloov pauv lossis tshem tawm ib kab, qhov no tau them nyiaj los ntawm software los ntawm kev hloov pauv tus nqi ntawm PWM. Piv txwv li cia saib hnub poob. Thaum pib cov txiaj ntsig 0, 4 thiab 5 tau hloov siab, uas txhais tau hais tias cov kab sib chaws tau hloov pauv ntawm ULN2803A. Tom qab ntawd lub voj txo qhov ci ci kom txog thaum qhov sib txawv hauv w6 me dua 700. Thaum lub sijhawm no tus pin0 tau hloov qis thiab tus pin2 tau hloov siab. Tus nqi tshiab ntawm w6 tau teeb tsa rau 900. Qhov no txhais tau hais tias lub teeb nrog kab txaij 0, 4 thiab 5 ntawm PWM-qib 700 yog ze li ci li lub teeb nrog kab 2, 4 thiab 5 ntawm PWM-qib 800. Kom paub cov txiaj ntsig no koj yuav tsum ntsuas ib puag ncig thiab sim qee qhov txiaj ntsig sib txawv. Sim nyob twj ywm ib qhov twg hauv nruab nrab, vim tias thaum koj dim lub teeb nyob hauv thawj lub voj ntau dhau, koj tsis tuaj yeem ua ntau yam hauv lub voj thib ob. Qhov no yuav txo qhov xim-hloov-nyhuv. Txhawm rau kho PWM-teeb tsa kuv siv subroutine uas tseem siv tus nqi ntawm w5 txhawm rau ncua txoj haujlwm. Txij ntawm no mus qhov nrawm los hauv qhov kev ua si. Tsuas yog thaum pib-pib tshuaj xyuas lub hwj chim thiab tus nqi khaws cia hauv w5. Tus naj npawb ntawm cov kauj ruam hauv txhua lub voj ntawm qhov kev zov me nyuam tau tsau, tab sis los ntawm kev hloov tus nqi ntawm w5 los ntawm 750 txog ib puag ncig 5100, kev ncua hauv txhua kauj ruam hloov pauv los ntawm 0.75s rau 5s. Cov naj npawb ntawm cov kauj ruam hauv txhua lub voj kuj tseem tuaj yeem hloov kho los ntawm kev hloov pauv feem rau qhov nthuav tawm ntawm- lossis nce. Tab sis nco ntsoov tsis txhob siv rau feem me me, vim qhov sib txawv w6 yog ib txwm muaj tus lej! Yog tias koj yuav siv 99/100 ua ib feem thiab siv qhov ntawd rau tus nqi ntawm 10, uas yuav muab rau koj 9.99 hauv cov lej tab sis ntxiv 10 hauv cov lej. Tseem nco ntsoov tias w6 yuav tsis pub tshaj 65325! Txhawm rau ntsuas nrawm, sim tawm lus tawm kab nrog w5 = 5*w5, qhov no yuav ua kom nrawm dua qhov haujlwm los ntawm qhov zoo ntawm 5!:-)

Kauj Ruam 6: Kev teeb tsa hauv chav pw

Kev teeb tsa hauv chav pw
Kev teeb tsa hauv chav pw

Kuv tso kuv lub hnub poob teeb rau ntawm lub khob me me ntawm ib sab ntawm chav kom lub teeb ci mus rau qab nthab. Los ntawm lub moos timer Kuv txhawb lub teeb 20 feeb ua ntej lub tswb nrov. Tom qab ntawd lub teeb tau pib ua haujlwm hnub tuaj thiab maj mam tsa kuv sawv. Thaum yav tsaus ntuj, kuv qhib lub sijhawm pw tsaug zog-ua haujlwm ntawm lub moos timer thiab txhawb lub teeb nrog lub hnub poob hloov. Tom qab qhov haujlwm tau pib kuv tam sim hloov rov qab mus rau hnub tuaj, rau tag kis sawv ntxov. Tom qab ntawd kuv txaus siab rau kuv tus kheej hnub poob thiab tsis tsaug zog sai.

Kauj Ruam 7: Kev hloov kho

Kev hloov kho
Kev hloov kho

Thaum hloov qhov toggle-switch los ntawm lub laub khawm koj yuav tsum hloov mus rau hnub poob-ib feem los ntawm kev qhib qee qhov cuam tshuam hauv txoj haujlwm. Txhawm rau hloov cov khoom siv hluav taws xob koj yuav tsum rov suav dua tus kheej cov hlua LED thiab cov tiv thaiv, vim tias nrog 12V koj tuaj yeem tsuas yog tsav 3 lub LED dawb thiab koj xav tau qhov sib txawv sib txawv ib yam nkaus. Kev daws teeb meem yuav yog siv cov peev txheej tam sim no, tab sis cov no yuav raug nqi koj qee cov nyiaj thiab siv lwm ob peb kaum ntawm qhov hluav taws xob rau kev tswj hwm. Nrog 24V koj tuaj yeem tsav ntau lub LEDs hauv ib kab, los tswj tib qho nyiaj ntawm LEDs nrog 12V cov khoom siv, cov LEDs yuav tsum tau muab cais ua ob kab uas siv sib luag. Txhua ntawm ob daim kab xev no xav tau nws tus kheej tiv thaiv thiab tam sim no sib sau los ntawm cov channel no muaj ntau dua ob npaug. Yog li koj pom, tias nws tsis muaj kev nkag siab los tsav txhua lub LEDs los ntawm 5V, uas yuav yooj yim, tab sis tam sim no yuav nce mus rau qib tsis zoo thiab tus nqi ntawm cov tshuaj tiv thaiv xav tau kuj yuav nce siab. Txhawm rau siv lub zog loj LEDs nrog ULN2803 tus tsav tsheb koj tuaj yeem ua ke ob txoj hauv kev rau kev tswj cua sov zoo dua. Tsuas yog txuas ob lub tswv yim ua ke ntawm ib lub microcontroller-tus pin thiab ob qhov tawm ntawm ib lub zog loj LED-sawb. Thiab nco ntsoov, tias qee qhov muaj hwj chim loj LED me me tuaj nrog lawv tus kheej tam sim no-Circuit thiab tej zaum yuav tsis dim los ntawm PWM hauv kab hluav taws xob! Hauv qhov teeb tsa no txhua ntu nyob deb ntawm ib qho txwv. Yog tias koj thawb yam mus rau ntug koj yuav tau txais teeb meem cua sov nrog FET lossis darlington array. Thiab ntawm chav kawm tsis txhob siv 230V AC lossis 110V AC los tsav lub voj voog no !!! Kuv cov kauj ruam tom ntej dhau ntawm cov lus qhia no yog xaim lub microcontroller nrog peb lub khoos phis tawj PWMs los tswj lub zog loj RGB-Spot.

Yog li muaj kev lom zem thiab txaus siab rau txoj cai ntawm koj tus kheej hnub poob thiab hnub tuaj.

Pom zoo: