Cov txheej txheem:

Project ElectroTerra: 9 Kauj Ruam
Project ElectroTerra: 9 Kauj Ruam

Video: Project ElectroTerra: 9 Kauj Ruam

Video: Project ElectroTerra: 9 Kauj Ruam
Video: Mob Txaus Lawm - Txhaij Lauj Ft. Tijlaug Xab Thoj (Special Project) 2024, Kaum ib hlis
Anonim
Qhov project ElectroTerra
Qhov project ElectroTerra

Kuv tau ua "ntse" terrarium/vivarium raws li tsev kawm ntawv txoj haujlwm.

ElectroTerra yog khiav los ntawm Raspberry Pi uas yog tus tswv lub vev xaib thiab khaws cov ntaub ntawv sau los ntawm cov ntsuas hauv MariaDB database.

Lub vev xaib qhia qhov ntsuas kub thiab txheeb ze cov av noo los ntawm cov ntsuas cua thiab tso cai tswj cov kiv cua thiab LED sawb. Cov hlua ntawd tseem tuaj yeem ua haujlwm tau txais bij LDR sensor.

Kuv xav tias qee qhov kev paub paub txog kev siv Raspberry Pi, Arduino, MariaDB (Mysql) thiab txuas xov tooj cua.

Khoom siv

Kuv tau sau cov npe khoom kom koj tuaj yeem pom txhua yam xav tau rau txoj haujlwm no.

Kauj Ruam 1: Teeb Raspberry Pi

Ua ntej koj yuav tsum teeb tsa cov hauv paus rau Raspberry Pi:

Kuv siv kev sib txuas ssh los tswj Pi nrog lub khoos phis tawj:

Rau coding Kuv siv Visual Studio Code nrog ssh txuas ntxiv:

Txhawm rau ua lub vev xaib muaj nyob hauv koj tus kheej lub network koj tuaj yeem tshawb xyuas cov lus qhia no los ntawm qib 1-3: https://www.instructables.com/id/Host-your-website-on-Raspberry-pi/ Tsis muaj kev ruaj ntseg ntxiv hauv qhov haujlwm no yog li ceev faj ntawm kev nthuav tawm nws hauv is taws nem.

Kauj Ruam 2: Tsim Cov Hluav Taws Xob Hluav Taws Xob

Tsim Cov Hluav Taws Xob Hluav Taws Xob
Tsim Cov Hluav Taws Xob Hluav Taws Xob

Hauv cov txheej txheem fritzing koj tuaj yeem pom txhua qhov kev xav tau hauv qhov haujlwm no. 1-xaim ntsuas kub tuaj yeem hloov pauv los ntawm kev ntsuas kub ntawm DHT22.

Arduino tau siv los ntawm Pi ntawm USB cable.

Kauj Ruam 3: Arduino + Programming

Arduino + Programming
Arduino + Programming
Arduino + Programming
Arduino + Programming

Txij li lub luag haujlwm hauv Arduino cov tsev qiv ntawv rau DHT22 thiab cov kab tsav tsheb LED tau nthuav dav heev, Kuv txiav txim siab ntxiv Arduino rau cov ntu no.

Yog li koj xav tau Arduino IDE.

Nco ntsoov ntshuam cov tsev qiv ntawv no:

  • DHT lub tsev qiv ntawv:
  • RGBdriver: hauv electroterra github chaw cia khoom

Kauj Ruam 4: Kuaj Cov Sensors thiab Actuators ntawm Pi

Hauv Github cov chaw cia khoom yog qee cov ntawv xeem rau cov khoom siv ib leeg.

Cov no yog cov chav kawm: mcp.py (npog cov ntaub ntawv sib piv los ntawm LDR) pcf.py (sib txuas I2C cov ntaub ntawv) thiab pcf_lcd.py (cuam tshuam nrog LCD).

Kauj ruam 5: Database

Database
Database
Database
Database

Tsim cov electroterra database ntawm Mysql worckbench ntawm cov ntaub ntawv pov tseg (final_dump_electroterra.sql hauv Github chaw cia khoom) nrog qee cov ntaub ntawv xeem.

Muaj qhov teeb meem sib xws los ntawm kev siv "Forward Engineer to Database" wizzard hauv Mysql Workbench. Nco ntsoov tshem VISIBLE qhov ntsuas hauv kab lus sql txij li qhov no tsis ua haujlwm hauv MariaDB.

Kauj Ruam 6: Ua ntej

Frontend
Frontend

HTML, CSS thiab Javascript code tuaj yeem pom hauv Github chaw cia khoom. Lawv yuav tsum tau muab tso rau hauv phau ntawv teev npe uas lub vev xaib yuav tuav. Tus qauv tsim kho kom zoo rau kev siv mobile thiab tau sim ntawm qhov tseeb ruaj khov Chrome, Firefox thiab Edge versions.

Kauj ruam 7: Backend

Lub app.py, datarepository.py thiab Database.py code yuav tsum nyob hauv cov npe tsev ntawm Pi tus neeg siv. Txhawm rau ua Pi khiav cov ntaub ntawv cia li rov pib dua siv cov lus qhia no:

Koj tuaj yeem pom cov cai hauv github chaw cia khoom:

Kauj Ruam 8: Muab Cov Khoom Ua Ke

Muab Tej Yam Ua Ke
Muab Tej Yam Ua Ke
Muab Tej Yam Ua Ke
Muab Tej Yam Ua Ke

Qhov teeb tsa no yog pov thawj ntawm lub tswv yim.

Kiv cua tau tsau rau hauv qhov chaw nrog kua nplaum kub. Qee qhov qhov ntxiv tau raug laum rau hauv cov pa tawm rau txoj hlua.

Tom ntej no yog lub thawv kom khaws cov khoom siv hluav taws xob. Lub thawv yas yooj yim tau siv. Txiav txim siab ntxiv cov kab pa tawm thaum muaj cua sov.

Kauj Ruam 9: Xeem

Image
Image
Kev Xeem
Kev Xeem

Fais fab Raspberry Pi thiab cov khoom siv fais fab.

Xauj mus rau IP chaw nyob uas pom ntawm LCD zaub.

Los ntawm qhov no, koj tuaj yeem saib xyuas cov ntaub ntawv thiab tswj tus actuators.

Pom zoo: