Cov txheej txheem:

Watering Sab Hauv Nroog Nroj Tsuag Nrog NodeMCU, Local Blynk Server thiab Blynk Apk, Kho Cov Teeb Taw Qhia: 3 Kauj Ruam
Watering Sab Hauv Nroog Nroj Tsuag Nrog NodeMCU, Local Blynk Server thiab Blynk Apk, Kho Cov Teeb Taw Qhia: 3 Kauj Ruam

Video: Watering Sab Hauv Nroog Nroj Tsuag Nrog NodeMCU, Local Blynk Server thiab Blynk Apk, Kho Cov Teeb Taw Qhia: 3 Kauj Ruam

Video: Watering Sab Hauv Nroog Nroj Tsuag Nrog NodeMCU, Local Blynk Server thiab Blynk Apk, Kho Cov Teeb Taw Qhia: 3 Kauj Ruam
Video: Zoo Siab Nrog Koj - Paj Tsua Thoj [ Official MV ] Nkauj Tawm Tshiab 2022 2024, Kaum ib hlis
Anonim
Watering Sab Hauv Nroog Nroj Tsuag Nrog NodeMCU, Local Blynk Server thiab Blynk Apk, Hloov Kho Teeb Meem
Watering Sab Hauv Nroog Nroj Tsuag Nrog NodeMCU, Local Blynk Server thiab Blynk Apk, Hloov Kho Teeb Meem

Kuv tau tsim txoj haujlwm no vim tias kuv cov nroj tsuag sab hauv tsev yuav tsum muaj kev noj qab haus huv txawm tias thaum kuv nyob rau hnub so rau lub sijhawm ntev thiab kuv nyiam lub tswv yim kom muaj kev tswj hwm lossis tsawg kawg saib xyuas txhua qhov ua tau uas tshwm sim hauv kuv lub tsev hauv internet.

Khoom siv

NodeMCU ESP-8266

Raspberry Pi 3

SD daim npav (16Gb pom zoo)

Capacitive Av Humidity Sensor (lossis DIY)

3-6 V (DC) Mini twj tso kua mis

2N2222 lossis sib npaug NPN transistor

1x 1 N4148 diode

1x 1K resistor 0.25W

Breadboard los yog Prototyping board

Dhia xov hlau

Kauj Ruam 1: Npaj Koj Hauv Zos Blynk Server

Npaj Koj Hauv Zos Blynk Server
Npaj Koj Hauv Zos Blynk Server

Cov software tseem ceeb ntawm txoj haujlwm no yog Blynk IOT platform. Lawv tau muab pub dawb pub dawb rau cov haujlwm me me uas muaj peev xwm yuav yuav cov qhab nia ntxiv yog tias koj tab tom npaj yuav nthuav koj cov tswv yim. Ib feem zoo ntawm lub platform no muaj peev xwm los teeb tsa hauv zos lawv cov Java raws server hauv ntau lub platform suav nrog Windows lossis Raspberry Pi3, uas kuv yuav siv hauv qhov kev qhia no.

Ua ntej tshaj plaws, koj yuav tsum teeb tsa qhov tsim muaj tshiab Raspbian, Buster yog qhov uas kuv siv tam sim no. Rau cov lus qhia, cov ntsiab lus thiab teeb tsa, kev qhia zoo yog qhov no.

Pom tseeb, yuav tsum txuas koj li RPi3 rau koj lub router ntawm LAN lossis WiFi. Txawm hais tias koj tsis muaj keyboard lossis saib xyuas txuas rau koj li RPi3, koj tuaj yeem txuas nws mus rau koj li WiFi nrog kev pab los ntawm kev qhia no.

Tam sim no, Blynk server teeb tsa ntawm koj lub khoos phis tawj tshiab Raspbian tuaj yeem ua tiav yooj yim tom qab nyeem ntawv no. Kuv yuav tsum qhia koj tias koj yuav tsum tau hloov qee cov lus qhia los ntawm nws vim tias txij li cov ntawv nyeem tau sau, Blynk server tau txais qee qhov hloov tshiab thiab koj yuav tsum hloov kho kom haum. Yog li, thaum lawv nug koj kom rub tus neeg rau zaub mov, koj yuav tsum hloov lo lus txib wget "https://github.com/blynkkk/blynk-server/releases/download/v0.23.0/server-0.23.0.jar" nrog wget "https://github.com/blynkkk/blynk-server/releases/download/v0.41.8/server-0.41.8-java8.jar"

Vim tias Blynk server yuav tsis pib cia li tom qab RPi rov pib dua, koj yuav tsum ntxiv hauv Crontab cov ntaub ntawv raws li lawv qhia los ntawm kev ntxiv qhov kawg ntawm nws, cov kab hauv qab no:

@reboot java -jar /home/pi/server-0.41.8-java8.jar -dataFolder/tsev/pi/Blynk &

Qhov kawg hais txog kev teeb tsa Blynk server yog tias nplooj ntawv koj yuav nkag mus rau lub hom phiaj kev tswj hwm yuav yog https:// IP_BLINK_SERVER: 9443/admin thiab koj yuav tsum tau them sai sai rau tus lej chaw nres nkoj, 9443, vim hauv qhov kev qhia ntawd, ntawm qhov ntawd sijhawm, qhov chaw nres nkoj siv yog 7443

Txhawm rau nkag mus rau server los ntawm internet, koj yuav tsum xa chaw nres nkoj 9443 mus rau sab hauv Blynk server IP chaw nyob thiab koj tseem yuav tsum tau siv DDNS kev pabcuam yog tias pej xeem IP chaw nyob yuav hloov thaum lub router rov pib dua. Yog tias koj yog tus tswv ntawm ASUS lossis Mikrotik routers (Kuv muab cov piv txwv no vim tias kuv muaj ob lub npe thiab kuv tab tom siv ua tiav lawv cov kev pabcuam DDNS), lossis lwm lub npe nrog lawv tus kheej DDNS kev pabcuam, txhua yam yuav yooj yim dua rau koj.

Kauj ruam 2: Teeb Kho Vajtse

Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb
Kho vajtse teeb

Raws li rau cov cuab yeej khoos phis tawj, cuam tshuam tus qauv ntawm lub sensor, twj tso kua mis thiab Blynk server, Kuv xaiv NodeMCU ESP8266. Cov qauv no tau nruab nrog ESP8266 chipset rau WiFi (uas tau sau tseg zoo heev thiab suav nrog ntau qhov haujlwm IoT). Yog tias koj xav sim ntxiv, koj tuaj yeem xaiv qhov yooj yim tshaj plaws, ESP8266 ESP-01, tsuav yog cov phiaj xwm no tsuas xav tau 2 tus pin los ua haujlwm: ib qho Analog cov tswv yim los nyeem qhov tseem ceeb los ntawm av av noo thiab ib qho tso tawm kom pib lub twj tso kua mis rau tso dej

Tab sis hauv txoj haujlwm no peb yuav siv NodeMCU vim tias nws yooj yim dua rau upload cov duab (ntawm USB cable) thiab yog cov khoom noj khoom haus zoo, ua rau muaj kev txhim kho yav tom ntej (raws li ntxiv LCD piv txwv los nyeem cov av noo tiag tiag thiab teeb tsa taw tes lossis ntxiv qhov txuas mus loj hlob rau koj cov nroj tsuag).

Raws li tau hais ua ntej, peb yuav siv ib qho av av noo sensor, yam muaj peev xwm. Ntawm kev ua lag luam koj tuaj yeem pom hom tiv taus kuj, nrog tib yam ntawm cov txiaj ntsig zoo sib xws tso tawm tab sis muaj pov thawj los ntawm ntau DIY-ers uas tsis ruaj tsis khov thiab tsis ntsuas qhov av noo tiag tiag hauv av tab sis qhov ntom ntawm cov ntsev yaj, ions hauv koj cov av.

Rau lub twj tso kua mis, Kuv siv NPN transistor los tsav lub cav. Cov kev sib txuas uas koj tuaj yeem pom hauv cov ntawv fritzing txuas nrog thiab cov duab hauv cov npe duab. Nco ntsoov tias koj yuav xav tau lub hwj chim thib ob, xws li ntawm 7 txog 9 V, nrog tam sim no txaus los tsav lub twj tso kua mis. Hauv kuv qhov xwm txheej, ntsuas tam sim no ntws los ntawm lub twj tso kua mis yog 484mA thiab kuv siv lub zog 9 V. Lub flywheel diode yog siv los tshem tawm qhov rov qab tam sim no ntws los ntawm lub cav kauj thaum qhov no yuav tsum nres, txhawm rau tiv thaiv kev puas tsuaj ntawm transistor.

Kauj Ruam 3: Coding thiab teeb tsa Blynk Daim Ntawv Thov hauv Koj Lub Txawb

Hauv cov kauj ruam no koj yuav tsum thauj cov duab kos txuas rau hauv NodeMCU.

Ua ntej tshaj plaws, koj yuav tsum ntxiv ESP8266 pawg thawj coj hauv koj li Arduino IDE. Qhov no tuaj yeem ua tiav yooj yim, ua raws cov lus qhia no. Thaum koj yuav txuas NodeMCU rau koj lub khoos phis tawj, siv USB cable koj yuav tsum txheeb xyuas qhov chaw nres nkoj COM thiab xaiv nws raws li Arduino IDE.

Qhov thib ob, koj yuav tsum ntxiv Blynk lub tsev qiv ntawv rau hauv IDE, los ntawm kev ua raws cov lus qhia no.

Thiab thaum kawg, koj yuav tsum nruab rau hauv koj lub xov tooj ntawm tes, Blynk daim ntawv thov los ntawm Google Ua Si.

Tam sim no, qhib Blynk daim ntawv thov hauv koj lub xov tooj thiab teeb tsa koj tus as khauj. Xaiv tus neeg rau zaub mov kev cai hauv lub vijtsam tseem ceeb thiab nkag mus rau DDNS lub npe koj teeb tsa hauv Kauj Ruam 1 hauv qhov kev qhia no. Tawm ntawm qhov chaw nres nkoj tsis hloov pauv (koj twb tau xa cov chaw nres nkoj no hauv koj lub router ua ntej lawm). Hauv tus neeg siv lub npe teb koj tus email chaw nyob thiab xaiv tus password. Tus lej yuav raug tsim thiab tam sim no ntxiv qhov haujlwm tshiab, npe nws raws li koj xav tau., Kuv tau hais meej qhov twg koj yuav tsum sau nws, hauv kev sab laj.

Tom qab ntawd, hauv Blynk daim ntawv thov koj yuav tsum ntxiv cov cuab yeej hauv qab no:

LCD widget - yuav nyeem tus pin V9 (tus pin virtual V9), thiab hloov mus rau qib siab; qhov no yuav qhia WiFi lub zog thiab tus IP chaw nyob

Gauge widget - yuav nyeem tus lej virtual V2, nrog thaj tsam ntawm 0 txog 100, qhov no yuav yog qhov av noo tiag

Cov lej lej suav nrog - txuas rau tus pin virtual V1, thaj tsam daim ntawv 0 txog 100, qhov no yuav xa cov teeb taw tes rau cov av noo mus rau cov lej siv hauv daim duab

Super Chart (xaiv tau) - yuav nyeem cov ntaub ntawv ntws los ntawm tus pin virtual V2 txhawm rau tsim daim duab nrog koj cov av noo.

Thaum kawg, hloov daim duab kos koj daim ntawv pov thawj kev lees paub tau txais hauv koj tus email, hloov WiFi lub npe thiab Tus lej nkag rau WiFi thiab rub koj daim duab mus rau NodeMCU.

Kuv vam tias txhua yam yuav mus zoo thiab tsis muaj teeb meem li koj cov nroj tsuag yuav tsum muaj kev noj qab haus huv!

Hmoov zoo!

Pom zoo: