Cov txheej txheem:

UCL - IIoT - Cov ntaub ntawv noo noo: 6 Cov Kauj Ruam
UCL - IIoT - Cov ntaub ntawv noo noo: 6 Cov Kauj Ruam

Video: UCL - IIoT - Cov ntaub ntawv noo noo: 6 Cov Kauj Ruam

Video: UCL - IIoT - Cov ntaub ntawv noo noo: 6 Cov Kauj Ruam
Video: Don’t Let Cancer Become the Forgotten C of COVID-19 | Queen's University Belfast 2024, Kaum ib hlis
Anonim
UCL - IIoT - Cov ntaub ntawv noo noo
UCL - IIoT - Cov ntaub ntawv noo noo

Cov lus qhia no, yuav muab cov lus qhia rau koj ntawm cov dej noo los ntawm cov av, uas yuav tuaj yeem pom ntawm UI nrog rau ntawm qhov liab-ntxiv, ntxiv mus yuav khaws cov ntaub ntawv thiab muab tso rau hauv MySQL database, qhov no tuaj yeem pab koj kawm paub cov qauv dej rau koj cov nroj tsuag, kawm thaum lawv xav tau dej.

Kauj Ruam 1: Daim Ntawv Teev Npe

Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe

1 x Arduino Mega 2560

1 x USB cable

1 x I2C LCD npo

1 x Cov av noo noo sensor

Hlau

Kauj ruam 2: Kev thaiv kab

LCD I2C zaub

GND> GND ntawm arduino

VCC> 5V ntawm arduino

SDA> SDA ntawm arduino

SCL> SCL ntawm arduino

Hws noo sensor

GND> GND ntawm arduino

VCC> 5V ntawm arduino

Teeb liab> A0 ntawm arduino

Kauj ruam 3: Flowchart

Daim phiaj
Daim phiaj

Daim duab qhia chaw no nthuav tawm qhov peb ua nrog cov ntaub ntawv los ntawm peb cov arduino, txhua yam pib nrog sau peb cov ntaub ntawv los ntawm peb cov arduino uas tom qab ntawd tau xa mus rau MySQL server, los ntawm qhov uas peb txuas nrog nodeRED kom tau txais cov ntaub ntawv qhia hauv cov zaub.

Kauj ruam 4: Code

Code
Code
Code
Code
Code
Code

Cov cai rau Arduino tuaj yeem pom ntawm no, thiab nws kuj tseem yog ua cov ntawv sau kom yooj yim rub tawm thiab siv hauv Arduino IDE yog li koj tuaj yeem xa nws mus rau koj tus kheej Arduino thiab pom tias cov cai tau teeb tsa li cas.

Kauj Ruam 5: Node-RED

Node-RED
Node-RED
Node-RED
Node-RED

node-liab tau siv hauv txoj haujlwm no kom xa thiab txais cov ntaub ntawv, uas peb tuaj yeem pom tom qab ntawm lub dashboard kom pom cov ntaub ntawv uas peb muab tso rau hauv. los ntawm peb cov ntsuas dej noo ntawm peb Arduino. Nov yog qhov peb xa cov ntaub ntawv mus rau peb MySQL, thiab tseem yuav ua li cas peb sau nws rau peb UI, los ntawm kev khaws nws los ntawm peb cov database.

Koj yuav tsum tau khiav thiab teeb tsa node-liab los ntawm https://nodered.org/docs/getting-started/installat… thiab ua raws li phau ntawv qhia yuav ua li cas rau nruab thiab khiav node-liab.

Thaum nws tau teeb tsa koj yuav tsum tau khiav nws los ntawm CMD kom nws mus.

Cov cai los ntawm kuv qhov liab-liab tau muab xa ua cov ntawv hauv cov lus qhia no thiab yuav tsum tau xa mus rau hauv-liab

Koj yuav tsum tau teeb tsa cov tsev qiv ntawv hauv qab no rau hauv node-liab:

node-liab

ntawm-liab-dashboard

node-liab-node-mysql

ntawm-liab-node-arduino

node-red-contrib-string

ntawm-liab-node-serialport

ntawm-liab-node-feedparser

qhov no yog los xyuas kom meej tias node-liab yuav ua haujlwm nrog cov lej-liab code uas tau muab hauv cov lus qhia no. Txwv tsis pub qhov ntws no tsuas yog ua rau koj yuam kev.

Kauj Ruam 6: MySQL Wampserver

MySQL Wampserver
MySQL Wampserver
MySQL Wampserver
MySQL Wampserver

Wampserver tau siv los tsim MySQL database, uas peb tuaj yeem txuag cov ntaub ntawv los ntawm peb Arduino, uas hauv txoj haujlwm no yog cov ntaub ntawv ntsuas cov dej noo. Thaum siv Wampserver tus neeg rau zaub mov khiav hauv zos ntawm koj lub khoos phis tawj, thiab txhawm rau kos npe rau hauv koj lub database koj yuav tsum tau kos npe nrog "hauv paus" thiab tsis nkag rau tus lej. Txhawm rau sib tham nrog node-liab nws qhov tseem ceeb uas MySQL teeb tsa hauv qhov ntws muaj cov ntaub ntawv ib yam li koj li Wampserver database, txwv tsis pub nws tsis tuaj yeem txuas rau nws.

Hauv qhov haujlwm no kuv tau tsim cov ntaub ntawv tshiab hu ua nodered thiab tom qab ntawd tsim lub rooj hu ua node. Tom qab ntawd koj yuav tsim ob kab, ib qho rau lub sijhawm thiab ib qho rau cov dej noo, qhov no yuav pab sau cov ntaub ntawv ya raws los ntawm lub ntsuas cua, thiab lub sij hawm muab los ntawm node-liab hauv qhov no.

Wampserver tuaj yeem teeb tsa ntawm no:

Pom zoo: