Cov txheej txheem:

Tsis Siv Neeg Tsob Ntoo Dej: 4 Kauj Ruam
Tsis Siv Neeg Tsob Ntoo Dej: 4 Kauj Ruam

Video: Tsis Siv Neeg Tsob Ntoo Dej: 4 Kauj Ruam

Video: Tsis Siv Neeg Tsob Ntoo Dej: 4 Kauj Ruam
Video: Tseem Ev Lub Kawm - Koos Loos 2024, Lub Xya hli ntuj
Anonim
Tsis Siv Neeg Dej Dej
Tsis Siv Neeg Dej Dej

Puas yog cov nroj tsuag tsis txaus siab rau koj kev saib xyuas?

Puas yog lawv ib txwm tuag yam tsis piav qhia lawv cov teeb meem rau koj?

Zoo ces tseem nyeem yuav ua li cas tsim koj tus kheej tsis siv neeg cog dej ywg dej, uas muab rau koj txhua cov ntaub ntawv koj yuav xav tau kom ua rau koj cov nroj tsuag nyob tau lub neej zoo siab. Kuv ua kom ntseeg tau tias tsis tsuas yog suav nrog cov dej noo, tab sis kuj tseem kub thiab lub teeb rau kev siv ntxiv. Koj tuaj yeem pom qhov kev loj hlob ntawm koj tus kheej cov nroj tsuag.

Thiab nyob rau sab saum toj ntawm qhov ntawd, nws ua rau koj cov nroj tsuag noo.

Khoom siv

Cov khoom siv hluav taws xob:

  • Raspberry Pi (4)
  • LCD Zaub 16x2 (rau tso saib IP-chaw nyob)
  • Lub Teeb Ntsuas Tus Kheej
  • TXP 36
  • (Sparkfun) Hws noo sensor
  • YWB 3008
  • Potentiometer
  • Relay module
  • Cov twj tso kua mis me me (nyiam dua 5-9V)
  • Breadbord
  • Cov xov hluav taws xob

Cov cuab yeej thiab cov ntaub ntawv:

  • Ib co ntoo
  • Cov cuab yeej yooj yim
  • Woodglue
  • Lub khob los yog lub khob iav kom khaws dej

Software: (Kuv siv, xav tias dawb siv lwm txoj hauv kev)

  • win32diskimager
  • Putty
  • MySQL Workbench
  • Visual Studio Code

Kauj ruam 1: Teeb tsa Pi

Ua ntej peb yuav teeb tsa peb Raspberry Pi. Lob cov duab Raspbian los ntawm https://www.raspberrypi.org/downloads/raspberry-pi-os/ thiab sau rau SD daim npav.

Tam sim no txuas rau koj li internet thiab khiav cov lus txib hauv qab no txhawm rau txhim kho cov haujlwm tsim nyog thiab tsev qiv ntawv.

Apache, PHP

sudo apt nruab apache2 -y

sudo apt nruab php libapache2-mod-php -y

MariaDB

sudo apt nruab mariadb-server mariadb-client -y

sudo apt nruab php -mysql -y

sudo systemctl rov pib dua apache2.service

PHPMyAdmin

sudo apt nruab phpmyadmin -y

Nab hab sej

pip3 nruab mysql-connector-python

pip3 nruab flask-socketio

pip3 nruab flask-cors

pip3 nruab gevent

pip3 nruab gevent-websocket

pip3 nruab spidev

pip3 nruab CharLCD

Kauj ruam 2: Tsim Circuit Court

Tsim lub Circuit
Tsim lub Circuit

Ua ntej peb yuav ua kom ntseeg tau tias txhua yam khoom siv tau npaj txhij. Ua tib zoo txuas txhua cov xov hlau raws li qhia.

Txhua 3 lub ntsuas tau txuas nrog MCP3008. MCP3008, ua ke nrog LCD thiab Relay IN1, txhua tus tau txuas ncaj qha nrog Pi.

Tsis txhob txuas lub twj tso kua mis nrog Pi, vim qhov no tuaj yeem ua rau puas tsuaj!

Kauj Ruam 3: Txoj Cai thiab Database

Code thiab Database
Code thiab Database

Txhua tus lej thiab cov ntaub ntawv tuaj yeem nrhiav tau thiab siv los ntawm kuv Github:

github.com/SnauwaertSander/RaspiPlant

Muab lub Frontend (html) sab hauv '/var/www/' Muab Backend (project1) hauv/home/pi/

Txuas rau koj li MySQL server (nrog MySQL workbench lossis ib tus neeg siv khoom los ntawm SSH) thiab ua qhov pov tseg pom hauv github.

Txhawm rau ua kom cov cai siv tau, tso Raspiplant.service hauv/etc/systemd/system/thiab khiav cov lus txib hauv qab no:

sudo systemctl pab Raspiplant.service

Tom qab txhua yam nyob hauv nws qhov chaw, tus lej yuav tsum tau ua haujlwm pib thaum pib, kom paub tseeb tias txhua yam ua haujlwm raug thiab rov pib dua koj li pi thiab mus rau IP uas qhia hauv lcd. Yog tias koj tsis tuaj yeem nkag mus rau lub xaib lossis lub xaib tsis qhia qhov muaj txiaj ntsig tom qab 30s, tshem koj tus Pi thiab tshuaj xyuas koj cov xov hlau.

Tam sim no txhua teev qhov kev zov me nyuam yuav tsum kuaj xyuas koj cov nroj tsuag. Nws yuav sau cov txiaj ntsig hauv kab ntawv thiab qhib lub twj tso kua mis yog xav tau. Hauv cov ntawv no, tib txoj hauv kev ntxiv cov nroj tsuag tshiab yog hauv cov ntaub ntawv khaws tseg.

Kauj ruam 4: Casing

Casing
Casing
Casing
Casing
Casing
Casing

Kuv tsim kuv cov ntaub ntawv nrog qee cov ntoo qub thiab cov cuab yeej siv yooj yim. Kuv paub tseeb tias koj tuaj yeem ua haujlwm tau zoo dua li kuv tau ua, yog li mus tom ntej thiab sim qee yam.

Yog tias tsis yog ntawm no yog cov lus piav qhia yooj yim ntawm qhov kuv tau ua nws li cas: Kuv tau ua lub thawv ntoo me me uas siv cov kua nplaum ntoo. Txhawm rau nkag mus rau cov khoom siv hluav taws xob, Kuv siv pob khawm nyob rau sab saum toj. Tom qab ntawd kuv tau ua qee qhov rau lub ntsuas cua, lub zog thiab lub LCD. Tom qab txhua qhov uas kuv ua tiav nws nrog txheej xim xim.

Pom zoo: