Cov txheej txheem:
- Kauj Ruam 1: Pulse Width Modulation hauv Software
- Kauj Ruam 2: Kho Vajtse thiab Cov Khoom Uas Yuav Tsum Tau Ua
- Kauj Ruam 3: Cov software uas seem thiab cov txiaj ntsig
Video: Ntau Cov Tswmciab Hluav Taws Xob: 3 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Cov tswm ciab hluav taws xob tau tshaj tawm ntau zaus ntawm Cov Ntawv Qhia yog vim li cas qhov no?
Hauv tsev kuv muaj cov tsev me me ib nrab pob tshab Christmas uas muaj LED pom thiab lub roj teeb me me. Qee lub tsev muaj LEDs nrog cov tswm ciab thiab qee lub tsev muaj LEDs uas nyuam qhuav qhib. Cov roj teeb me me tsis muaj qhov nrawm dua thiab txij li kuv xav kom muaj lub teeb tswm ciab hauv txhua lub tsev kuv txiav txim siab ua nws qhov project PIC. Tau kawg koj tuaj yeem tig nws mus rau hauv qhov project Arduino ib yam nkaus.
Yog li dab tsi ua rau lub tswm ciab hluav taws xob tshwj xeeb? PIC thiab Arduino txhua tus muaj Pulse Width Modulation (PWM) kho vajtse ntawm lub nkoj uas tuaj yeem siv los tsim cov tswm ciab siv cov LED tab sis hauv kuv qhov xwm txheej kuv xav kom muaj 5 lub tswm ciab hluav taws xob ywj pheej siv ib tus tswj thiab uas tsis muaj tam sim no, yam tsawg tias kuv paub lawm. Kev daws kuv siv yog ua kom tsib qhov ywj pheej PWM teeb liab tag hauv software.
Kauj Ruam 1: Pulse Width Modulation hauv Software
Pulse Width Modulation tau piav qhia ntau zaus, piv txwv. hauv kab lus Arduino no:
PIC thiab Arduino muaj qhov tshwj xeeb PWM kho vajtse ntawm lub rooj tsavxwm uas ua rau nws yooj yim los tsim cov PWM teeb liab no. Yog tias peb xav ua ib lossis ntau PWM cov cim hauv software, peb xav tau ob lub sijhawm:
- Ib lub sijhawm uas siv los tsim PWM zaus
- Ib lub sijhawm uas siv los tsim PWM lub voj voog ua haujlwm
Ob lub sijhawm ua haujlwm thiab cuam tshuam thaum ua tiav thiab yog li kev tuav lub PWM teeb liab tau ua tiav tag nrho cuam tshuam kev tsav. Txog PWM zaus kuv siv timer 0 ntawm PIC thiab cia nws ntws mus. Nrog lub moos oscillator moos ntawm 8 MHz thiab prescale ntawm 64 tus qauv yog: Fosc / 4 /256 /64 = 2.000.000 / 256 /64 = 122 Hz lossis 8, 2 ms. Qhov zaus yuav tsum siab txaus kom tib neeg lub qhov muag tsis tuaj yeem pom nws. Qhov zaus ntawm 122 Hz yog txoj hauv kev txaus rau qhov ntawd. Qhov tsuas yog lub sijhawm ncua sijhawm cuam tshuam niaj hnub ua yog theej lub luag haujlwm rau lub PWM tshiab thiab hloov mus rau txhua lub LEDs. Nws ua qhov no rau tag nrho 5 LEDs ntawm nws tus kheej.
Tus nqi ntawm lub sijhawm siv los tswj lub PWM lub voj voog ua haujlwm nyob ntawm seb peb ua cov tswm ciab li cas. Hauv kuv txoj hauv kev kuv sim qhov txiaj ntsig no los ntawm kev nce lub voj voog ua haujlwm nrog tus nqi ntawm 3 txhawm rau nce qhov ci ntawm LED thiab txo nws nrog tus nqi ntawm 25 kom txo qhov ci ci ntawm LED. Txoj hauv kev no koj tau txais lub tswm ciab zoo li cov nyhuv. Txij li thaum kuv siv tus nqi yam tsawg kawg ntawm 3, tus lej ntawm cov kauj ruam los tswj kev ua tiav lub voj voog nrog ib byte yog 255 /3 = 85. Qhov no txhais tau tias PWM lub luag haujlwm lub voj voos timer yuav tsum ua haujlwm nrog 85 zaus zaus ntawm PWM zaus timer uas yog 85 * 122 = 10.370 Hz.
Rau PWM lub luag haujlwm voj voog Kuv siv timer 2 ntawm PIC. Nov yog lub sijhawm teem nrog pib rov pib dua thiab nws siv cov qauv hauv qab no: Lub Sijhawm = (Reload + 1) * 4 * Tosc * Timer2 prescale tus nqi. Nrog kev rov ua dua ntawm 191 thiab lub sijhawm ua ntej ntawm 1 peb tau txais lub sijhawm ntawm (191 + 1) * 4 * 1/8.000.000 * 1 = 96 peb lossis 10.416 Hz. PWM lub voj voog ua haujlwm cuam tshuam cuam tshuam kev tshuaj xyuas tas li yog tias lub voj voog ua haujlwm tau dhau mus thiab hloov lub LED uas lub voj voog ua haujlwm tau ua tiav. Yog tias lub luag haujlwm tsis dhau, nws txo qis lub luag haujlwm suav nrog 3 thiab xaus txoj haujlwm niaj hnub. Nws ua qhov no rau txhua tus LEDs ntawm nws tus kheej. Hauv kuv qhov xwm txheej no cuam tshuam li niaj zaus siv txog 25 peb thiab txij li nws tau hu ua txhua 96 peb, twb tau 26% ntawm CPU tau siv rau kev tswj hwm PWM lub luag haujlwm hauv software.
Kauj Ruam 2: Kho Vajtse thiab Cov Khoom Uas Yuav Tsum Tau Ua
Daim duab qhia chaw qhia qhov tshwm sim zaum kawg. Txawm hais tias kuv tsuas yog tswj 5 LEDs ntawm nws tus kheej, Kuv ntxiv 6 LED uas ua ke nrog ib ntawm 5 lwm LEDs. Txij li thaum PIC tsis tuaj yeem tsav ob lub LEDs ntawm ib tus pin chaw nres nkoj Kuv ntxiv lub transistor. Cov khoom siv hluav taws xob tau pub los ntawm 6 volt / 100 mA DC adapter thiab siv qhov ntsuas hluav taws xob qis qis los ua kom ruaj khov 5 Volt.
Koj xav tau cov khoom siv hauv qab no rau txoj haujlwm no:
- 1 PIC microcontroller 12F615
- 2 Ceramic capacitors: 2 * 100nF
- Resistors: 1 * 33k, 6 * 120 Ohm, 1 * 4k7
- 6 Txiv kab ntxwv lossis daj LEDs, ci ntsa iab
- 1 BC557 transistor lossis sib npaug
- 1 Electrolytic capacitor 100 uF / 16 V
- 1 qhov ntsuas hluav taws xob qis qis LP2950Z
Koj tuaj yeem tsim lub Circuit Court ntawm lub khob cij thiab tsis xav tau chaw ntau, raws li pom hauv daim duab.
Kauj Ruam 3: Cov software uas seem thiab cov txiaj ntsig
Qhov seem ntawm qhov software yog lub voj loj. Lub voj tseem ceeb nce ntxiv lossis txo qis qhov ci ntawm LEDs los ntawm kev kho lub voj voog ua haujlwm tsis raug. Txij li peb tsuas yog nce nrog tus nqi ntawm 3 thiab txo qis nrog tus nqi ntawm 25, peb yuav tsum ua kom ntseeg tau tias qhov kev txo qis tsis tshwm sim ntau npaum li qhov nce ntxiv.
Txij li thaum kuv tsis tau siv ib lub tsev qiv ntawv twg kuv yuav tsum tsim lub tshuab hluav taws xob tsis zoo siv cov lus tawm tswv yim hloov pauv rau npe, saib:
en.wikipedia.org/wiki/Linear-feedback_shif…
Cov tswm ciab cuam tshuam los ntawm kev nrawm PWM lub voj voog hloov pauv li cas lub ntsiab voj siv ncua sijhawm txog 10 ms. Koj tuaj yeem kho lub sijhawm no los hloov cov tswm ciab rau koj qhov xav tau.
Cov vis dis aus txuas nrog pom qhov kawg-qhov tshwm sim qhov twg kuv siv lub hau hla lub LED txhawm rau txhim kho cov txiaj ntsig.
Kuv siv JAL ua cov lus programming rau txoj haujlwm no thiab txuas nrog cov ntaub ntawv.
Muaj kev lom zem ua Cov Lus Qhia thiab tos ntsoov rau koj cov kev xav thiab txiaj ntsig.
Pom zoo:
Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Igniter: 6 Kauj Ruam (nrog Duab)
Cov Hluav Taws Xob Bluetooth Hluav Taws Xob Igniter: Puas yog nws zoo rau taws ntau dua ib lub foob pob hluav taws tib lub sijhawm? Lossis txawm tias muaj kev nyab xeeb nyob deb rau qhov phom sij txaus ntshai. Hauv qhov haujlwm no kuv yuav qhia koj yuav tsim lub Circuit Court uas tuaj yeem ua tau li cas nrog kev pab ntawm Bluetooth ua haujlwm
Ib Leeg Hluav Taws Xob Hluav Taws Xob / Hluav Taws Xob Hluav Taws Xob: 6 Cov Kauj Ruam
Ib Leeg Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob / Hluav Taws Xob Hluav Taws Xob: Hauv qhov haujlwm no peb tab tom ua kom muaj Ib lub kauj induction lub cev Muaj zog, thiab ntau yam piav qhia ntxiv, cov qauv ntawm lub tshuab hluav taws xob no tau siv ntau yam khoom siv tam sim no. Peb lub cav tsis muaj lub zog loj, nws yog ntau ntxiv txog kev ua haujlwm
Tsau Cov Khoom Siv Hluav Taws Xob Cov Hluav Taws Xob Hluav Taws Xob (ATX Hacked): 15 Cov Kauj Ruam
Txhim Kho Cov Khoom Siv Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob (ATX Hacked): Yog tias koj nkag mus rau hauv hluav taws xob ces koj yuav paub tias qhov ntsuas sib txawv ntawm lub rooj zaum raug teeb tsa lub zog muaj nws tus kheej cov txiaj ntsig piv txwv kuaj koj li DIY Circuit Court, paub txog qhov ua ntej ntawm lub zog loj coj, them cov roj teeb thiab cov npe no mus-n
Yuav Ua Li Cas Siv Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Module: 6 Kauj Ruam
Yuav Ua Li Cas Siv Cov Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob Module: Nco tseg thiab ceev faj: CFL muaj cov mercury uas yog cov khoom phom sij, yog li nws yuav tsum tau ua raws li feem ntau CFL cov teeb, hluav taws xob hluav taws xob tau ua haujlwm zoo thiab tseem siv tau, tsuas yog lub teeb mus tsis zoo. CFL Circuit Court ntawm 18-24 Watts yog
Cov Hluav Taws Xob Hluav Taws Xob Cov Hluav Taws Xob: 5 Cov Kauj Ruam
Cov Khoom Siv Hluav Taws Xob Tsis Txaus Siab: Thaum lub tsev poob lub zog, thiab tom qab ntawd thaum kawg tig rov qab, peb lub tshuab A/C nqa tau tsis tig rov qab. Koj yuav tsum tau thawb lub pob rau ntawm lub hauv ntej ntawm chav tsev, lossis ntaus lub hwj huam khawm ntawm cov chaw taws teeb. Peb chav A/C tshwm sim nyob rau hauv peb cov se