Cov txheej txheem:

MAG (Tsev cog khoom me me tsis siv neeg): 9 Kauj Ruam
MAG (Tsev cog khoom me me tsis siv neeg): 9 Kauj Ruam

Video: MAG (Tsev cog khoom me me tsis siv neeg): 9 Kauj Ruam

Video: MAG (Tsev cog khoom me me tsis siv neeg): 9 Kauj Ruam
Video: ib sim cas tsis tsim nyog tsom xyooj 2022 2024, Hlis ntuj nqeg
Anonim
MAG (Tsev cog khoom me me tsis siv neeg)
MAG (Tsev cog khoom me me tsis siv neeg)

Kuv niam feem ntau yog tibneeg hu tauj coob zoo nkauj. Yog li kuv xav pab nws los ntawm kev siv nws lub tsev cog khoom. Txoj kev no nws tuaj yeem txuag sijhawm me ntsis vim nws tsis xav tau dej cov nroj tsuag.

Kuv yuav tuaj yeem ua tiav qhov no nrog MAG (Miniature Automatic Garden). Raws li lub npe, MAG yog qhov haujlwm me me uas tuaj yeem nthuav dav rau lub tsev cog khoom loj. MAG yog lub tshuab ua haujlwm saib xyuas lub vaj kom zoo uas nyeem thiab xa cov ntaub ntawv ntawm cov ntsuas sib txawv mus rau lub vev xaib uas khiav ntawm Raspberry Pi. Tus neeg siv yuav tuaj yeem saib xyuas lawv cov nroj tsuag ntawm lub vev xaib. Lub tswv yim no tau tsim los ua qhov phiaj xwm zaum kawg hauv thawj xyoo ntawm kev siv xov tooj cua thiab kev sib txuas lus, ntawm Howest Kortrijk, Belgium.

Kauj Ruam 1: Cov Khoom Siv

Cov Khoom
Cov Khoom
Cov Khoom
Cov Khoom
Cov Khoom
Cov Khoom

Txhawm rau tsim txoj haujlwm no, koj yuav xav tau cov khoom hauv qab no:

Electronics:

1. Raspberry pi 4 - kit2. Raspberry pi T-cobbler3. Cov qhob cij 4. Txiv neej-rau-txiv neej txuas 5. Txiv neej-rau-poj niam txuas 6. LM35 (ntsuas kub) 7. 4x Hws noo sensor8. HWV 119. YWB 300810. Potentiometer (rau kev tswj hwm, tsis tsim nyog) 11. SunFounder LCD-zaub 12. 4x Dej Txhuam Txhuam Tsis Pom 12v13. Cov kav dej 14. Adapter 12V15. 4x 5 v

Casing:

1. Aquarium2. Ntoo ntoo 3. Khoom puag ncig hlau 4. Ntsia 5. Ntsia Hlau 6. Aquaplan Roofprimer

Cov Cuab Yeej:

1. Rauj2. Pom 3. Ntsia Hlau 4. Laum 5. Ntoo ntaub 6. Rab yaj phom 7. Xim txhuam 8. Vuam tshuab 9. Muag khoom

Hauv Pdf cov ntaub ntawv hauv qab no, koj tuaj yeem pom cov npe ua tiav nrog txuas rau ntu.

Kauj Ruam 2: Ua Tsev Ntsuab

Ua Tsev Ntsuab
Ua Tsev Ntsuab
Ua Tsev Ntsuab
Ua Tsev Ntsuab
Ua Tsev Ntsuab
Ua Tsev Ntsuab
Ua Tsev Ntsuab
Ua Tsev Ntsuab

Hauv cov duab muab rau koj koj yuav pom qhov ntsuas xav tau rau cov laug cam. Ua ntej koj yuav pom cov duab nrog ntsuas, ntawm nws koj yuav pom tus lej (hauv qab no yuav muaj cov ntaub ntawv ntxiv nrog tus lej sib xws). Tseem muaj qee qhov muab cov duab ntawm nws yuav zoo li cas.

Tus lej 1 txog 4 yog rau rooj plaub thiab thaum koj tau txiav lawv tawm koj tuaj yeem txuas ua ke los ntawm kev ua rau tes rau hauv qhov.

Lub rooj tsav xwm ntxiv, tus lej 5 + 6, yog lub hau uas koj tuaj yeem tso rau saum lub thawv rau tus pi.

Sau ntawv:

Qhov nruab nrab ntawm lub qhov ntawm txhua lub laug cam yog 0.8cm deb ntawm cov ntug (Cov kab txho, saib daim duab nrog tus lej ib yog siv). Cov qhov tau raug laum nrog 2 hli ntsia hlau rau ntoo.

1.: Nov yog phaj hauv qab. Ntawm sab laug koj muaj 64 cm nruab nrab ntawm 2 qhov. Qhov no suav rau qhov kev ncua deb ntawm lub qhov thiab cov npoo ntawm ob sab laug thiab sab xis. Lub rooj tsavxwm sab saum toj muaj 2cm x 2cm xwmfab nrog lub hom phiaj ntawm kev tso cov hlua hluav taws xob hla. Cov hauv qab plank muaj 8cm x 2.5cm txiav tawm rau qhov chaw lcd zaub.

2.: Cov no yog ob sab ntev tshaj plaws thiab koj yuav xav tau 2 ntawm cov phiaj no. Nyob rau sab saum toj koj muaj 2 qhov txiav tawm ntawm 3mm x 10mm. Qhov no yuav siv tom qab txhawm rau txhawm rau ntsuas cov kab hluav taws xob noo noo.

3.: Cov no yog ob sab luv thiab koj yuav xav tau 4 ntawm cov phiaj no.

4.: Cov no yog qhov sib tshuam rau cov thawv cog, koj yuav xav tau 2 ntawm cov phiaj no. Koj yuav tsum tau tshem daim dawb raws li qhia kom koj tuaj yeem xaub cov no 2 hauv ib leeg

Kauj Ruam 3: Ua Tiav Tsev Tsev Cog Khoom

Tiav Cov Tsev Tsev Cog Khoom
Tiav Cov Tsev Tsev Cog Khoom
Xaus Lub Tsev Cog Khoom
Xaus Lub Tsev Cog Khoom
Xaus Lub Tsev Cog Khoom
Xaus Lub Tsev Cog Khoom

Tam sim no txhua yam tau teeb tsa ua ke, peb yuav ua kom ntseeg tau tias cov chav rau cov nroj tsuag tsis muaj dej. Peb ua qhov no kom ntseeg tau tias tsis muaj dej tuaj yeem xau, tsuas yog thaum muaj xwm txheej. Nrog tus txhuam hniav pleev xim rau hauv qhov chaw, yog tias koj xav tau koj tuaj yeem ntxiv txheej thib ob thaum nws qhuav.

Tom ntej no yog txuas cov hlau tuav ua ke hauv nruab nrab yog li peb xaus nrog tus ntoo khaub lig. Peb yuav muab cov hlau no tso rau ntawm rooj plaub tom qab kev khawb 4 qhov, 1 ntawm txhua qhov kawg zoo li ntawm daim duab. Nco ntsoov thaum koj muab tso rau hauv uas tag nrho 4 sab yog txawm tias.

Thaum kawg peb yuav ua tus thais hauv txhua sab ntawm qhov chaw. Ua kom cov kav dej tuaj yeem so tau. Nco ntsoov thaum siv daim ntoo no koj tseem tuaj yeem tshem cov kav dej tau yooj yim thiab muab rov qab rau hauv yog tias xav tau.

Kauj Ruam 4: Software ntawm Raspberry Pi

Software ntawm Raspberry Pi
Software ntawm Raspberry Pi
Software ntawm Raspberry Pi
Software ntawm Raspberry Pi

Rau kuv tus lej ua haujlwm (uas kuv yuav txuas hauv qab no) koj yuav tsum tau teeb tsa qee pob khoom thiab tsev qiv ntawv. Thawj qhov uas xav tau yog rau koj hloov kho koj li Pi.

Ua ntej, hloov kho koj li kab ke cov npe khoom los ntawm kev nkag mus rau cov lus txib hauv qab no: sudo apt-tau hloov tshiab.

Txhim kho tag nrho koj cov pob khoom teeb tsa rau lawv cov kho tshiab kawg nrog cov lus txib hauv qab no: sudo apt-get dist-upgrade.

Yog tias lub kaw lus tsis nug kom rov pib dua, ua 'sudo reboot'. Qhov no yog kom ntseeg tau tias txhua yam tau teeb tsa raug.

Tom qab koj tau teeb tsa cov pob koj yuav xav tau nruab qee lub tsev qiv ntawv:

  • sudo pip3 nruab -hloov kho setuptools
  • sudo apt-tau nruab python3-flask
  • sudo pip nruab -U flask -cors
  • sudo pip nruab flask-socketio
  • sudo apt-tau nruab rpi.gpio
  • sudo pip3 nruab Adafruit_DHT

Thaum koj ua tiav, ua 'sudo reboot'.

Kauj Ruam 5: Ua Circuit Court

Ua Circuit
Ua Circuit
Ua Circuit
Ua Circuit

Hauv kauj ruam 2 peb yuav ua qhov Circuit Court rau txoj haujlwm no. Qhov no yog qhov tsawg kawg nkaus uas koj xav tau yog tias koj xav kom nws ua haujlwm. Siv lub fritzing lub rooj thiab daim duab los ua daim qauv ntawm daim phiaj. Nov yog qhov uas koj xav tau tag nrho cov khoom siv hluav taws xob los ntawm theem 1.

Cov ntaub ntawv hais txog lub Circuit Court:

Peb muaj 5 lub ntsuas ntsuas txuas nrog MCP3008 uas yog lm35 rau qhov ntsuas kub sab hauv thiab 4 lub ntsuas av noo. DHT11 rau sab nraud qhov kub thiab txias thiab qhov kawg dej ntab hloov los xyuas seb puas muaj dej txaus hauv lub pas dej.

Cov av noo noo sensor muaj qhov tso tawm sib xws thiab siv GPIO-pin ntawm Raspberry Pi.

Ntxiv:

Kuv kuj tau siv LCD-zaub uas yuav ua rau nws yooj yim dua tom qab los txuas rau Raspberry Pi yam tsis tas yuav tsum txuas rau koj lub khoos phis tawj. Qhov no tsis tsim nyog tab sis nws tau pom zoo heev.

Ua ntej soldering nws tag nrho ua ke Kuv siv kuv lub khob cij los txuas txhua yam ua ke thiab sim kuv cov ntsuas kom paub tseeb tias txhua yam ua haujlwm.

Kauj Ruam 6: Tsim Database

Tsim Database
Tsim Database

Nws yog ib qho tseem ceeb heev los khaws koj cov ntaub ntawv los ntawm cov ntsuas hauv kev teeb tsa tab sis kuj tseem muaj kev nyab xeeb. Qhov no yog vim li cas kuv thiaj txiav txim siab khaws kuv cov ntaub ntawv hauv chaw khaws ntaub ntawv. Txoj kev no tsuas yog kuv tuaj yeem nkag mus rau cov ntaub ntawv no (nrog tus as khauj tus kheej) thiab khaws nws kom zoo. Hauv daim duab saum toj no koj tuaj yeem pom kuv daim duab ERD.

Koj tuaj yeem pom kuv daim duab ERD saum toj no, Kuv tseem yuav txuas cov ntaub ntawv pov tseg kom koj tuaj yeem ntshuam cov ntaub ntawv khaws cia rau koj tus kheej. Nrog cov ntaub ntawv no koj yuav tuaj yeem qhia ntau yam xws li:

  • Qhov kub nyob ze thiab siab dua cov nroj tsuag
  • Cov av nyob ze cov nroj tsuag
  • Cov av hauv av ntawm txhua tsob ntoo
  • Saib seb lub twj tso kua mis puas pab tau rau tsob ntoo
  • Lwm yam..

Txuas nrog cov theem no koj tuaj yeem pom kuv Mysql dump. Yog li koj tuaj yeem yooj yim ntshuam nws. Tau txais Mysql pob tseg.

Kauj Ruam 7: Lub Vev Xaib

Lub Vev Xaib
Lub Vev Xaib
Lub Vev Xaib
Lub Vev Xaib

Kuv xav kom tuaj yeem saib xyuas cov nroj tsuag yog li kuv tau tsim lub vev xaib los qhia kuv cov ntaub ntawv no. Ntawm lub vev xaib koj yuav tuaj yeem tshuaj xyuas cov nroj tsuag, ntxiv rau qhib/ua kom lub twj tso kua mis sib cais.

Thaum tus Pi tab tom pib, nws yuav pib khiav kuv cov ntawv nab nab. Qhov no yuav saib xyuas kom tau txais cov ntaub ntawv los qhia hauv lub vev xaib. Ua raws tsab ntawv, tus pi yuav nyeem cov ntaub ntawv los ntawm cov ntsuas hluav taws xob txhua teev thiab muab tso rau hauv cov ntaub ntawv khaws tseg. Lub vev xaib tseem ua haujlwm zoo yog li nws tuaj yeem qhib ntawm txawb.

Kuv tus lej tuaj yeem pom ntawm github ntawm no.

Kauj Ruam 8: Sau Backend

Sau Backend
Sau Backend

Tam sim no nws yog lub sijhawm kom ntseeg tau tias txhua yam khoom ua haujlwm ntawd. Yog li kuv tau sau qee cov cai hauv nab thiab xa nws mus rau raspberry pi. Koj tuaj yeem pom kuv tus lej ntawm Github.

Rau kev tsim cov cai kuv siv Visual Studio Code. Cov cai tau sau hauv html, CSS, javascript thiab sej (Flask)

Kauj Ruam 9: Muab txhua yam tso rau hauv rooj plaub

Muab txhua yam tso rau hauv rooj plaub
Muab txhua yam tso rau hauv rooj plaub
Muab txhua yam tso rau hauv rooj plaub
Muab txhua yam tso rau hauv rooj plaub
Muab txhua yam tso rau hauv rooj plaub
Muab txhua yam tso rau hauv rooj plaub
Muab txhua yam tso rau hauv rooj plaub
Muab txhua yam tso rau hauv rooj plaub

Thaum koj tau ua tiav txhua qib ua tiav, koj tuaj yeem pib tso txhua yam hauv rooj plaub. Txhawm rau ua li ntawd kuv pom zoo kom koj muab koj cov khoom sib xyaw ua ke kom lawv tsis tuaj yeem txuas nrog los ntawm kev sib tsoo.

Kuv tau kaw qhov txuas ntawm ib qho ntoo kom lawv tsis txhob poob thaum nyob hauv rooj plaub. Kuv kuj tau muab cov twj tso rau hauv lub thoob dej kom lawv tsis txhob poob. Kuv kuj tseem qhia rau lo kua nplaum DHT11 sensor nyob rau sab saum toj ntawm tus ncej.

Pom zoo: