Cov txheej txheem:
- Kauj Ruam 1: Sau Cov Khoom Uas Xav Tau
- Kauj Ruam 2: Txuas lub Rooj Tswjhwm Saib thiab txuas nrog
- Kauj Ruam 3: Txheeb Cov Duab Hluav Taws Xob thiab Kub Kub
- Kauj Ruam 4: Txheeb Cov Dej Dej thiab Cov av noo noo
- Kauj Ruam 5: Tus Neeg Hais Lus thiab Lub Xov Tooj Tso Tawm Coding
- Kauj Ruam 6: Xaus
Video: Kev Ua Liaj Ua Teb Sensor: 6 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:30
Ib qhov haujlwm los ntawm Jackson Breakell, Tyler McCubbins thiab Jakob Thaler rau EF 230
Kev ua liaj ua teb yog qhov tseem ceeb ntawm kev tsim khoom hauv Tebchaws Meskas. Cov qoob loo tuaj yeem siv rau ntau lub hom phiaj sib txawv, xws li los ntawm cov khoom siv raw rau kev tsim khaub ncaws, tshuaj thiab khoom noj ntxiv rau kev noj ncaj qha ntawm cov qoob loo, feem ntau yog cov txiv hmab txiv ntoo. Feem ntau ntawm cov qoob loo hauv Tebchaws Meskas tau cog rau sab nraum zoov, qhov chaw huab cua lossis qhov kub tsis tuaj yeem tswj tau ntawm qhov loj. Muab qhov xwm txheej huab cua tsis zoo tuaj yeem cuam tshuam rau kev loj hlob ntawm cov qoob loo, ua rau cuam tshuam rau Tebchaws Asmeskas Lub Xeev kev lag luam, saib xyuas cov xwm txheej ntawm cov qoob loo yog qhov tseem ceeb.
Peb lub cuab yeej, Cov Khoom Siv Ua Ntej Ua Ntej Ua Ntej, tso cai rau cov neeg ua liaj ua teb los tshuaj xyuas qhov xwm txheej ntawm kev xaiv ua ntej ntawm lawv thaj chaw siv 4 lub ntsuas hluav taws xob: lub ntsuas dej nag, lub ntsuas dej noo hauv av, ntsuas kub thiab ntsuas lub ntsuas hluav taws xob. Kev sib xyaw ntawm cov ntsuas no tso cai rau tus neeg ua liaj ua teb npaj rau lub caij cog qoob loo kom tsim nyog, kho kom tsawg dhau los lossis ntau dhau los nag, ua kom zoo dua nrog kev puas tsuaj uas tuaj yeem tua cov qoob loo thiab txuag lub sijhawm thiab teeb meem los ntawm kev ntsuas cov av thiab siv cov cuab yeej ntsuas ntau dua. Hauv Cov Lus Qhia no, peb yuav taug kev koj hla txoj kab thiab cim tom qab peb Kev Ua Liaj Ua Teb Sensor, yog li koj kuj tuaj yeem ua koj tus kheej.
Kauj Ruam 1: Sau Cov Khoom Uas Xav Tau
Hauv qab no yog cov npe ntawm cov ntaub ntawv xav tau koj yuav xav tau pib"
1. Arduino Board, nyiam dua Arduino Uno
2. Cov ntawv qhia zaub mov yooj yim
3. 1x 220 ohm resistor
4. Cov xov hlau sib txawv ntawm cov xim sib txawv
5. Micro USB rau USB cable
6. Board-mountable hais lus
7. Photoelectric Sensor
8. Kub Sensor
9. Dej nag Sensor
10. Av noo noo Sensor
11. Khoos phis tawj nrog Matlab 2017 thiab Arduino Support Package tau teeb tsa (Cov pob txhawb nqa tuaj yeem nrhiav tau hauv qab Add-Ons)
Kauj Ruam 2: Txuas lub Rooj Tswjhwm Saib thiab txuas nrog
Pib los ntawm kev xaim lub rooj tsav xwm raws li tau hais los saum no, lossis txhua txoj hauv kev zoo tshaj rau koj. Muaj cov lus tsis txwv txoj hauv kev lub rooj tsavxwm tuaj yeem siv tau, yog li qhov kev teeb tsa tseeb yog nyob ntawm koj. Tom qab lub rooj tsavxwm tau xaim, pib txuas koj lub ntsuas. Cov dej nag, av noo thiab cov duab ntsuas hluav taws xob yog txhua qhov kev sib piv, yog li ua kom ntseeg tau tias lawv tau xaim mus rau qhov sib piv-hauv ntu ntawm Arduino. Qhov ntsuas kub, ntawm qhov tod tes, yog cov tso tawm digital, yog li xyuas kom nws tau xaim rau hauv cov khoom siv digital ntawm koj li Arduino. Arduino yuav tsum muaj qhov tso tawm rau 3.3v thiab 5v, yog li nco ntsoov tias cov ntsuas tau txuas nrog rau qhov hluav taws xob uas lawv tau sib xws nrog.
Tom qab koj paub tseeb tias lub rooj tsav xwm tau txuas xov tooj kom raug, ntsaws Micro USB rau USB cable los ntawm koj lub khoos phis tawj mus rau hauv Micro USB chaw nres nkoj ntawm koj lub computer, thiab txuas koj lub Arduino rau. Qhib Matlab, thiab, ua kom ntseeg tau tias koj tau teeb tsa Arduino Support Package hauv Add-Ons, khiav cov lus txib, "fopen (serial ('nada'))", yam tsis muaj ". koj muaj cov comport muaj nrog tus lej. Khiav qhov hais kom ua "a = arduino ('comx', 'uno')", qhov twg x yog tus lej ntawm koj cov ntawv xa mus, txhawm rau qhia koj Arduino mus rau yam khoom. LED ntawm Arduino yuav tsum nyem nrawm los qhia tias nws tau txuas nrog.
Kauj Ruam 3: Txheeb Cov Duab Hluav Taws Xob thiab Kub Kub
Ua ntej koj pib coding, sau tseg qhov chaw uas koj lub ntsuas hluav taws xob tau txuas nrog ntawm Arduino, vim qhov no yuav yog qhov tseem ceeb rau kev nyeem qhov voltage hais kom ua. Pib koj cov cai los ntawm teeb tsa lub hnub ci sib txawv sib npaug rau qhov hais kom ua "readVoltage (a, 'X#') ', Qhov twg X# yog qhov chaw nres nkoj koj txuas nrog, thiab ib qho tsuas yog hu rau Arduino koj teeb tsa rau qhov sib txawv ntawd., thiab teeb tsa thawj qhov xwm txheej rau tshav ntuj <3. Teem cov zis raws li "info. TOD = 'hmo ntuj'" kom tso tawm lub sijhawm nruab hnub raws li tus qauv, thiab tom qab ntawd ntxiv ib qho ntxiv nqe lus nrog cov zis raws li "info. TOD = ' hnub '.. Txij li qhov no yog lwm nqe lus, peb tsis xav tau ib qho xwm txheej, vim nws yuav ua haujlwm rau txhua lwm qhov txiaj ntsig tsis tau hais tseg hauv nqe lus yog. Ua kom ntseeg tau tias koj ua tiav koj li lus hais nrog qhov kawg, thiab txav mus rau qhov program kub sensor.
Teem qhov sib txawv thermo sib npaug rau lwm readVoltage hais kom ua, cov lus txib yog "readVoltage (a, 'X#')". Hauv peb qhov xwm txheej, qhov ntsuas kub yuav tsum tau hloov pauv los ntawm chav ntsuas hluav taws xob mus rau Celsius, yog li qhov sib npaug "tempC = (thermo-.5).*100" kom hloov pauv los ntawm qhov hluav taws xob mus rau Celsius. Txhawm rau kom yooj yim, peb hloov qhov ntsuas kub hauv Celsius mus rau Fahrenheit, tab sis qhov no yog qhov kev xaiv dawb huv.
Code rau cov hom phiaj pasting
tshav ntuj = nyeem Voltage (a, 'A1') yog tshav ntuj <3
info. TOD = 'hmo ntuj'
lwm tus
info. TOD = 'hnub'
kawg
thermo = readVoltage (a, 'A3');
tempC = (thermo-.5).*100;
info.tempF = (9/5.*tempC) +32
Kauj Ruam 4: Txheeb Cov Dej Dej thiab Cov av noo noo
Raws li tau hais hauv qib kawg, nco ntsoov koj paub dab tsi cov chaw nres nkoj koj lub ntsuas hluav taws xob tau ntsaws rau ntawm Arduino pawg thawj coj, vim nws yuav ua rau cov kauj ruam no tsis txaus siab ntau. Pib nrog lub ntsuas dej nag, thiab pib qhov yog hais qhia. Teem thawj qhov xwm txheej rau "readVoltage (a, 'X#')> 4", thiab teeb nws cov zis rau "info. Rain = 'tsis muaj nag lossis daus". Ntxiv ib qho ntxiv, thiab teeb tsa nws raws li qhov readVoltage hais ua ntej, tab sis teeb nws rau> 2. Ntxiv qhov "&&" los qhia lwm qhov xwm txheej uas yuav tsum tau ua tiav, thiab teeb nws mus rau qhov nyeem ua hluav taws xob hais kom zoo li ua ntej, thiab teeb nws rau <= 4. Cov zis yuav yog "info. Rain = 'misting'". Thaum kawg, ntxiv lwm qhov thiab teeb tsa nws cov ntawv rau "info. Rain = 'downpour'". Tej zaum koj yuav tau hloov kho qhov txiaj ntsig rau cov xwm txheej raws li huab cua puag ncig ntawm chav uas koj tab tom ua haujlwm.
Tom ntej no, pib cov cai rau cov av noo noo sensor, thiab pib nrog yog tias nqe lus. Teem qhov xwm txheej ntawm daim ntawv yog "readVoltage (a, 'X#')> 4, thiab ntxiv cov lus tso tawm" info.soil = 'qhuav' ". 2. Ntxiv qhov "&&", thiab teeb lwm lo lus nyeemVoltage rau <= 4. Teev nws cov zis rau "info.soil = 'pom kev txaus siab' '. ", thiab tsis txhob hnov qab ntxiv qhov kawg.
Code rau cov hom phiaj pasting
yog readVoltage (a, 'A0')> 4 info. Rain = 'tsis muaj nag lossis daus'
elseif readVoltage (a, 'A0')> 2 && readVoltage (a, 'A0') <= 4
info. Rain = 'pos huab'
lwm tus
info. Rain = 'nqes hav'
kawg
yog tias nyeem Voltage (a, 'A2')> 4
info.soil = 'qhuav'
elseif readVoltage (a, 'A2')> 2 && readVoltage (a, 'A0') <= 4
info.soil = 'ua kom pom kev zoo'
lwm tus
info.soil = 'dej nyab'
kawg
Kauj Ruam 5: Tus Neeg Hais Lus thiab Lub Xov Tooj Tso Tawm Coding
Cov txiaj ntsig rau cov cuab yeej no tuaj yeem sib txawv, tab sis, hauv qhov no, peb yuav taug kev koj los ntawm tus neeg hais lus tso tawm ncaj qha rau ntawm lub cuab yeej thiab lub thawv ntawv tso tawm uas tuaj yeem pom ntawm lub khoos phis tawj deb. Peb tus neeg hais lus tau tsim los tso tawm cov zaus sib txawv, qis lub ntsiab lus tsis zoo, rau qhov pom tau zoo ntawm cov qoob loo, hnub ci, av noo thiab nag lossis daus. Pib koj tus lej hais lus tso tawm nrog cov lus hais, thiab teeb tsa nws qhov xwm txheej rau qhov hais kom ua "readVoltage (a, 'X#')> 4 || info.tempF = 3 || readVoltage (a, 'A2')> 2 && readVoltage (ib, 'A0') <= 4 ". Ntxiv tib playTone hais kom ua raws li tau hais los saum no, tab sis hloov 200 rau 1000 los ua kom muaj suab nrov dua, zoo dua qub. Tom qab ntawd, ntxiv ib qho ntxiv, thiab ntxiv qhov qub playTone hais kom rov ua dua, tab sis hloov 1000 txog 1500. Cov tones sib txawv no qhia qhov hnyav ntawm qhov xwm txheej ntawm thaj chaw. Nco ntsoov tias koj ntxiv qhov kawg kom ua tiav koj cov lus.
Peb ntu kawg ntawm cov cai yuav yog qhov tsim tawm uas tsim lub thawv lus. Tsim txoj hlua siv 'cov cim hauv kab zauv, thiab hloov pauv ib feem ntawm koj cov qauv rau cov hlua los ntawm kev siv cov lus txib "num2str (info.x)", qhov twg x yog lub npe hloov pauv hauv cov qauv ntaub ntawv. Siv "hlua kab tshiab" txhawm rau ntxiv kab ntawv tshiab rau hauv koj lub npov xov, thiab ntaus koj cov lus hauv kab ntawv siv cov cim hais los, ntxiv tus nqi tiag tiag ntawm daim teb rau hauv txoj hlua siv cov lus hais ua ntej num2str. Thaum kawg, nrog txoj hlua tau hais tseg, siv cov lus txib "msgbox (hlua)" los tso saib cov ntaub ntawv raws li lub thawv lus ntawm koj lub monitor.
Code rau cov hom phiaj pasting
yog tias nyeem Voltage (a, 'A2')> 4 || info.tempF <32 playTone (a, 'D9', 200, 1)
elseif tshav ntuj => 3 || readVoltage (a, 'A2')> 2 && readVoltage (a, 'A0') <= 4
playTone (a, 'D9', 1000, 3)
lwm tus
playTone (a, 'D9', 1500, 5)
kawg
hlua = ['Lub sijhawm yog (deg F)', num2str (info.tempF)]
hlua = [hlua tshiab kab 'Cov av yog', num2str (info.soil)]
hlua = [hlua tshiab kab 'Sab nraum nag lossis daus yog', num2str (info. Rain)]
hlua = [hlua kab tshiab 'Lub sijhawm ntawm hnub yog', num2str (info. TOD)]
msgbox (txoj hlua)
Kauj Ruam 6: Xaus
Thaum lub ntiaj teb tseem tab tom vam khom ntau thiab ntau dua ntawm cov khoom siv hluavtaws hloov pauv rau cov khoom yav dhau los uas tau sau los ntawm cov qoob loo, kev ua liaj ua teb yuav tseem yog qhov tseem ceeb thiab tseem ceeb ntawm kev lag luam mus ntev. Kev saib xyuas thaj av kom txaus yog qhov tseem ceeb rau cov neeg ua liaj ua teb kom tau txais nws cov qoob loo feem ntau, thiab, nrog peb lub cuab yeej, nws tsis yog tsuas yog ua tau los saib xyuas tag nrho cov av ua teb nyob deb, tab sis nws muaj peev xwm ua tau nws hauv qhov pheej yig, yooj yim rau nruab thiab txhim khu kev qha. Peb vam tias phau ntawv qhia no tau ua pov thawj cov ntaub ntawv thiab yooj yim los ua raws, thiab peb cia siab tias lub cuab yeej ua pov thawj muaj txiaj ntsig rau txawm li cas los xij koj xav siv lossis sim nrog nws.
Nyob zoo coding, Pawg Neeg Ua Haujlwm Saib Xyuas Kev Ua Liaj Ua Teb
Pom zoo:
LoRa-Raws Li Pom Kev Pom Kev Pom Zoo rau Kev Ua Liaj Ua Teb Iot - Tsim Tsim Daim Ntawv Thov Ua Ntej Siv Firebase & Angular: 10 Kauj Ruam
LoRa-Raws Li Pom Kev Pom Kev Pom Zoo rau Kev Ua Liaj Ua Teb Iot | Tsim Tsim Daim Ntawv Thov Ua Ntej Siv Firebase & Angular: Hauv tshooj yav dhau los peb tham txog yuav ua li cas cov ntsuas hluav taws xob ua haujlwm nrog loRa module txhawm rau nthuav tawm firebase Lub Sijhawm Teem Sijhawm, thiab peb tau pom daim duab siab heev tias peb txoj haujlwm tag nrho ua haujlwm li cas. Hauv tshooj lus no peb yuav tham txog yuav ua li cas peb tuaj yeem
Qab Zib Ua Ntej Pom Kev Ua Liaj Ua Teb: 8 Kauj Ruam
Qab Zib Ua Ntej Ua Ntej Ua Ntej Ua Ntej: Qhov no yog kev ua liaj ua teb qab zib tsis siv neeg tag nrho. Nws yog qhov ua tau zoo heev
IoT Raws Kev Ua Lag Luam Zoo thiab Kev Ua Liaj Ua Teb Zoo Siv ESP32: 7 Cov Kauj Ruam
IoT Raws Li Kev Ua Lag Luam Zoo thiab Kev Ua Liaj Ua Teb Zoo Siv ESP32: Lub ntiaj teb tab tom hloov pauv raws li lub sijhawm thiab yog li kev ua liaj ua teb.Nyob rau tam sim no, Tib neeg tau suav nrog hluav taws xob hauv txhua qhov haujlwm thiab kev ua liaj ua teb tsis yog qhov tshwj xeeb rau qhov no. Qhov kev sib koom ua ke ntawm cov khoom siv hluav taws xob hauv kev ua liaj ua teb tau pab cov neeg ua liaj ua teb thiab cov neeg uas tswj lub vaj Hauv qhov no
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: 6 Kauj Ruam
Arduino Neeg Hlau Nrog Kev Nyob, Kev Qhia thiab Qib Kev Sib Hloov (Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) Tswj los ntawm Lub Suab Siv Bluetooth Module thiab Kev Siv Tus Neeg Siv Hluav Taws Xob: Cov lus qhia no piav qhia yuav ua li cas thiaj tsim tau Arduino Robot uas tuaj yeem txav mus raws qhov xav tau (Forward, Backward) , Sab laug, Txoj Cai, Sab Hnub Poob, Sab Hnub Poob, Sab Qaum Teb, Sab Qab Teb) xav tau Kev nrug deb hauv Centimeters siv lub suab hais kom ua. Neeg hlau kuj tseem tuaj yeem txav tau tus kheej
Lub Hwj Chim Tsawg FM Transmitter Kav hlau txais xov los ntawm Kev Ua Liaj Ua Teb: 8 Kauj Ruam (nrog Duab)
Tsawg Lub Hwjchim FM Transmitter Kav hlau txais xov los ntawm Kev Ua Liaj Ua Teb: Tsim lub kav hlau txais xov FM tsis nyuaj li; muaj ntau tus qauv tsim tawm. Peb xav tsim qhov tsim los ntawm ntu koj tuaj yeem tau txais yuav luag txhua qhov chaw hauv ntiaj teb rau txheej plaub (tsis ntev 16!) Zej zog cov chaw peb pib hauv Northern Uganda